Transcription of 1 ELECTRONIC DICE - Picaxe
1 1 Picaxe -08 ELECTRONIC dice PROJECT revolution1 copyright 2002-10 - AXE105 ELECTRONIC dice Project Notes Version by:Revolution Education Ltd. Web: DICEWhat is a microcontroller?A microcontroller is often described asa 'computer-on-a-chip'. It can be usedas an ELECTRONIC brain to control aproduct, toy or microcontroller is an integrated circuit("chip") that contains memory (to store the program), aprocessor (to process and carry out the program) and input/output pins (to connect switches, sensors and output devices like motors).
2 Microcontrollers are purchased 'blank' and then programmed with a specific controlprogram. This program is written on a computer and then 'downloaded' into themicrocontroller chip. Once programmed the microcontroller is built into a product tomake the product more intelligent and easier to use of a picture above shows an ELECTRONIC dice that can be made to generate a randomnumber. It can be used like a normal dice in dice works by switching Light Emitting Diodes (LEDs) on and off in the pattern ofdots found on a traditional dice .
3 The microcontroller is the brain of the are powerful ELECTRONIC components that have a memory and can beprogrammed to switch things on and off in any sequence. The microcontroller in thedice can switch the LEDs on and off to show numbers between one and the diagonal pairs on LEDs in the dice always light at the same time, they can beswitched on and off by the same microcontroller output. Therefore 4 outputs (3 pairsand the central dot ) are required. 2 Picaxe -08 ELECTRONIC dice PROJECT revolution2 copyright 2002-10 - AXE105 ELECTRONIC dice Project Notes Version by:Revolution Education Ltd.
4 Web: DIAGRAMSThe ELECTRONIC system for an ELECTRONIC dice can be drawn as a block diagram .The push switch is an ELECTRONIC device that can detect movement and is known as an input . The microcontroller then decides how to behave and may then switch theoutput LEDs on in different IS THE Picaxe SYSTEM?The microcontrollers used in devices such as ELECTRONIC games can be difficult toprogram, as they generally use a complicated programming language called assemblercode , which can be quite difficult to Picaxe system makes the microcontrollers much easier to program.
5 The controlsequence can be drawn (and simulated) on the computer as a flowchart, or written in asimpler programming language called BASIC. This makes it much easier to use themicrocontroller as the complicated assemblercode does not need to be sample BASIC program and Logicatorflowchart are shown here. In this case bothprograms do the same thing - flash a light(connected to output 0) on and off :high 0wait 1low 0wait 1goto main 3 Picaxe -08 ELECTRONIC dice PROJECT revolution3 copyright 2002-10 - AXE105 ELECTRONIC dice Project Notes Version by:Revolution Education Ltd.
6 Web: YOUR OWN ELECTRONIC DICED esign BriefDesign and make an ELECTRONIC dice The dice must show the numbers 1-6 randomly byswitching LEDs on and Specification Points1) The design will use any 8 pin Picaxe microcontroller as it s ) The design will include LEDs in a dice DiagramThe block diagram for your safety light may look like this:Personalising Your ELECTRONIC DiceThere are several ways to personalise your are some things to think about:1) Are you going to build your dice on the circuit board or mount it in a case?
7 If youuse a case you will need to attach the LEDs and switch using ) What colour and size of LEDs are you going to use? The most common LEDs are red,but many other sizes and colours are available ( blue).3) How will you activate the dice ? Normally a push switch is used, but you could usemany other types of sensor, for example, you could have a light sensor (LDR) thatcan detect changes in light level when you put your hand over it. 4 Picaxe -08 ELECTRONIC dice PROJECT revolution4 copyright 2002-10 - AXE105 ELECTRONIC dice Project Notes Version by:Revolution Education Ltd.
8 Web: COMPONENTSThe main ELECTRONIC components you may need for your ELECTRONIC dice are shown next few pages describe each of these components in more detail, and also providesome programming ideas that may be useful when you are later programming your dicelight microcontrollerlight emitting diode (LED)push switch3 x AA battery boxand you will also needpicaxe download socketresistors5 Picaxe -08 ELECTRONIC dice PROJECT revolution5 copyright 2002-10 - AXE105 ELECTRONIC dice Project Notes Version by:Revolution Education Ltd.
9 Web: SECTION 2 - ELECTRONIC COMPONENTSMICROCONTROLLERSWhat is a microcontroller?A microcontroller is often described as a computer-on-a-chip . It is anintegrated circuit that contains memory, processing units, and input/output circuitry in a single are purchased blank and then programmed with a specificcontrol program. Once programmed the microcontroller is built into aproduct to make the product more intelligent and easier to are microcontrollers used?Applications that use microcontrollers include householdappliances, alarm systems, medical equipment, vehiclesubsystems, and ELECTRONIC instrumentation.
10 Some modern carscontain over thirty microcontrollers - used in a range ofsubsystems from engine management to remote locking!As an example, a microwave oven may use a single microcontroller to processinformation from the keypad, display user information on the seven segmentdisplay, and control the output devices (turntable motor, light, bell and magnetron).How are microcontrollers used?Microcontrollers are used as the brain in ELECTRONIC circuits. These ELECTRONIC circuits areoften drawn visually as a block diagram . For instance a simplified block diagram for themicrowave above could be drawn like this:The program for the microcontroller is developed (and tested) on the computer and thendownloaded into the microcontroller.