My nephews got a Scalextric slot car racing circuit from Santa for Christmas. This was a blast-from-the-past for my brother and me and we were soon showing the kids how to race. However it quickly became apparent that β3-2-1-Goβ wasnβt the best way to start a race so I put this together to simulate the gantry lights used for starting F1 motor races.
When the circuit is first powered on LEDβs D2 and D4 light just to indicate the circuit is operating.Β
When the start button (SW2) is pressed all the LEDβs turn off. They then illuminate sequentially at one second intervals until all five LEDβs are on.Β After a random interval between 0 and about 7 seconds the LEDβs extinguish, signaling the start of the race.
Once the LEDβs have extinguished simply press the start button again to initiate anotherΒ race start sequence.Β While waiting for the start button to be pressed the PIC is put into a sleep state.Β This drops the current consumption to around 10uA
- Source Code (zipped)
- HexΒ for 16F627A ready to program. (right-click Save As)
(This code will also run, unmodified, on a 16F628A) - Schematic
- Images of the prototype. At power on. During a start. In a small case
Notes:
- The circuit is really quite simple.Β I tested it on a breadboard with standard 5mm red LEDβs using 220R resistors from a 5Volt supply.Β The one on the prototype board operates at 3Volts usingΒ two AA cells.Β I dropped the value of the LED current limiting resistors to 150R for this since the LEDβs I used werenβt hi-efficiency types.Β If you can use hi-efficiency LEDs you could probably use 270R or 330R resistors and operate it from a CR2032 3Volt Lithium coin cell.
- With all five LEDs on, the prototype circuit was drawing about 25mA from a 3V supply. This drops to a meagre 10uA with all LEDs off which should allow the circuit to operate for many months, or even years depending on use, from a couple of AA cells without the need for a power switch.
- The code enables weak-pull up on the Port B pins but the unused Port A pins are all configured as inputs and need pulling down to Vss.
For more detail: Mini F1 race track Grid Start Lights using PIC12F627A