F1 type gantry race start LED cluster controller

Practical PIC Projects

 

 

F1 Gantry
 Race Start Lights
(version 2)

  • Description

  • Operation photo's

  • Circuit Description

  • Circuit schematic

  • PCB Artwork

  • Construction notes

  • Software download

 


From April 2009 we'll be releasing an upgraded version of this project with new PCB and software.  We'll also be selling a PCB and pre-programmed PIC for self assemblers and a fully assembled and tested board

contact us for more details


Description

Featured in Electronics Weekly Gadget Freak (15/08/2008)

This project provides an simple F1 motor racing style 5 light race start sequence with a random delay that you can use on a real race track, kart circuit or even your slot-car circuit. 

Operation is simple; when the start button is pressed all the LED clusters are off. They then illuminate sequentially at one second intervals until all five LED clusters are on.  After a random interval between 1 and about 7 seconds the LEDs extinguish, signalling the start of the race.  Once the LEDs have extinguished simply press the start button again to initiate another race start sequence.

This project takes the simple battery operated F1 style race track grid start light project on the main page and combines it with some 52mm Kingbright LED clusters.  These LED clusters are both large enough and bright enough to be used outdoors.

This page presents a complete application using 52mm LED clusters, but the software in the PIC microcontroller has been written to allow it to operate electro-mechanical relays, large arrays of LEDs, low voltage lamps, or even simply single 5mm LEDs.


Operation photo's

Power-on

When the circuit is first powered on the outputs do the following.

2 seconds

Only appears if Start switch input is active
(switch pressed)
LED's will stay in this state until Start
 switch is released.

10 seconds
(or Start switch pressed)

Start sequence

When the start switch is pressed and released the first output turns on followed by the next four outputs at 1 second intervals until all five outputs are on.

After the fifth output has been on for 1 second, the controller starts a random delay that will last anywhere from 1 to 7 seconds at which point all outputs are turned off.

Once a start sequence has completed, simply press the start button again to initiate another start.

Photo showing operation with 2 rows of 5 LED clusters
(using the version 1 design)

 

Raceway Karting


 

Circuit description

The circuit described on this page is designed around Kingbright's 52mm LED cluster module which comprises 50 red LEDs in a waterproof housing with a brightness in excess of 16000mcd.  In the original version of this project each LED cluster was directly driven and all those LED's required a hefty current with the ten LED cluster version requiring a power supply capable of delivering 2amps at 12V DC.

In the new version of this project, I've written the software to provide three output drive modes. 

  1. Direct drive - for use with relays

  2. Direct PWM - for use with LED clusters, driven by a PWM signal to allow control of brightness.

  3. Multiplexed PWM - for use with LED clusters, PWM provides brightness control, multiplexing reduces power requirements to < 500mA with 10 LED cluster. 

For the new version I've also done a single sided PCB layout for the circuit which is designed around the use of LED clusters using drive mode 3.  It can also be used to drive small relays mounted off-board in drive mode 1.  Since we make the software and pre-programmed PICs freely available, drive mode 2 provides flexibility for people who want to build it into their own controller.

This version also includes an optional isolated switch input.  This uses an opto-coupler to allow the controller to be triggered from another system, to provide electrical isolation for safety reasons, or reduce the possibility of false triggering in an electrically noisy environment.

Circuit Schematic

 

Schematic

Connection diagram (jpeg)

PCB Artwork

Copper

Overlay

For those of you who don't have access to PCB making facilities the photo's below may be helpful if you wish to build this project on stripboard. Click on the photo's below for hi-res images.

 

Construction notes

Construction details for the PCB version are presented in pictures below.  The PCB can be built up to drive either LED clusters or off-board relays but not both.  There are a number of build options which require a choice to be made as to which parts are installed and these are described with the accompanying text.

A full component list and part numbers for Rapid Electronics is provided at the end of the section.

PCB straight from the etch process

PCB after drilling. Note the three holes for the DC power connector (top right) need to be milled into slots.

Solder the small components to the board first.  Fit the voltage regulator (IC3) so it matches the profile on the overlay. You may need to bend its centre pin out slightly to line up with the holes in the PCB.

Next install the medium sized parts.

 C4 needs to be installed with the negative lead the correct way round. 

If you construct the circuit to drive off-board relays, install wire links into positions JP1 and R1 (circled red).  Do not fit R1 or R2 or the second row of 2 pin header plugs

                

The external switch input can use either a 2 way 5mm screw terminal (shown left) or a skeleton phono socket [cinch connector] (shown right) depending on your preference.

For the LED cluster version you will need to install R1 and R2. 

After installing R1 and R2 use the off-cuts from their leads to make the wire links LK2 - LK5 as shown.

Assembled board for use with LED clusters. The optional isolated switch input components have not been fitted.

For the LED cluster version DO NOT fit JP1

The IC's must be installed with the small notch as shown.
Also note the black band on Diode D1

Underside of the completed board.

Completed board with isolated switch input components installed.  Ensure D1 is located with the black band as shown.  The value of R6 needs to be chosen according to the voltage used in the external input application.

DC Power input

The board needs a DC regulated input of 12 volts.  Power supply current rating should be at least 500mA, a 1A supply is preferred.   Do not use an unregulated DC power supply as these generally only deliver the specified voltage at full load.  As the board has no fuse or over current protection, this should be provided externally.  Typically a regulated DC power supply will have overload protection built-in and if this is the case nothing further is required.  If you power the circuit from a battery or other source then you must ensure there is a suitable in-line fuse.

Switch Inputs

There are two external switch inputs and an on-board switch.  Any of the switches can be used to operate the unit; you choose which one depending on your specific requirements.

The on-board switch is primarily for testing although it can be used for normal operation if desired.  All three switches are connected to the controller in parallel therefore the use of any one switch input does not preclude the use of the other two.

SW1 Switch

The SW1 switch on the PCB can be used for testing the board without any external switches connected. 

The start sequence is triggered on the release of the switch not the initial press.

Non isolated switch input

The CN1/CN2 connector provides input for a non-isolated switch to be connected to the controller. 

Isolated switch input option

The isolated switch input needs its own power source to turn the LED on in the opto-isolator.  If you include the isolated switch input option you need to select the value of R6 according to the voltage used in the external circuit.

Suggested values are shown in the table below. Use a 5% 1/4watt carbon film resistor.  With the values shown the LED current will be approximately 30-35mA.

Voltage (DC) R6
3 47R
5 100R
6 150R
7.5 180R
9 220R
12 330R

for safety reasons do not use voltages > 18volts at this input

Right. Testing the board using  the isolated switch option.

The red/black crocodile clips are connected to a bench power supply.

The isolator will work with various input voltages provided R6 is correctly specified (see table above)

LED Clusters

The LED clusters are Kingbright type BL0307-50-44.  These contain 50 LED's connected as 10 parallel strings of 5 LEDs as shown in the schematic below.  Available from Rapid Online - Rapid Electronics Ltd., part No 56-2985 

Download datasheet for Kingbright LED Cluster

Ensure they're connected to the controller with the red and white leads as shown in both the photos and indicated on the PCB overlay.  The  LED clusters illuminate sequentially from 1 to 5 and this is indicated on the PCB overlay.

The board will drive either a single row of 5 LED clusters or two rows.  When using it with two rows, connect the second set of LED clusters to the second column of 2 pin headers (circled yellow) in the photo below.

Adjusting Brightness

When JP1 is open, the controller drives the outputs using a PWM (pulse width modulated) signal.  This allows the brightness of the LEDs to be controlled by adjusting the position of PR1.  The PWM frequency is ~350Hz to avoid any visible flickering.   

The brightness control input is an analogue signal varying from 0 volts (dim) to 5 volts (bright).  For the technically minded it is possible to modify the circuit to use a Light Dependant Resistor to automatically adjust the LED brightness to match the ambient lighting.

Drive modes

The software supports three drive modes of which two are supported on the PCB.  The third mode may be used if you incorporate the microcontroller into your own hardware design.

The design of the circuit uses a single current limiting resistor (R1 & R2) for each row of LED clusters. For this to work only one LED cluster can be on at any time otherwise the more LEDs that turn on, the dimmer they get.  The software drives each output one at a time but it does so 350 times a second and through persistence of vision to the human eye they appear to be on at the same time.  The reason it has been implemented this way is for two reasons.

  • The total maximum current required is that of 2 LED clusters rather than 10 so a smaller and cheaper power supply can be used.

  • The drive circuit uses a single ULN2003A transistor array and two resistors which keeps the cost down and the complexity of the circuit and PCB layout are simplified.

Mode RA0 (JP1) RA4  
Direct closed (Gnd) open  Use with relays and other devices that can't use PWM
Direct PWM * open closed (Gnd)  Use with LED driver that has individual current limiting
Multiplexed PWM open open  Use with LED driver that has common current limiting

The RA0 / RA4 inputs have internal weak-pull enabled so there is no need for external pull up resistors. 

* On the PCB, RA0 is connected to JP1 but RA4 is not made directly available since the Direct PWM mode isn't supported by the hardware on the PCB.

Driving Relays

If you use the PCB to drive relays they should be rated for operation at 12V DC and the coil resistance should be >150 ohms otherwise there is a risk of damage to IC2 (ULN2003A).

Connect each relay coil to the 2-pin header on the PCB.  You'll need 5 relays in total, one connected to each output.

Also ensure JP1 is closed otherwise the relays will be driven with a PWM signal and won't operate correctly.


Parts Listing

In the UK all the components can be obtained from Rapid Online - Rapid Electronics Ltd..  I've provided a component list with their part numbers and descriptions.  The parts used are all commonly available and should be obtainable from most good electronic component distributors anywhere in the world. 

Note: where it says (option) in the description, you only need the part if you are building it with the selected option.

 

Schematic part Qty Description Rapid Part No
LED Clusters 5(10) 52MM ULTRABRIGHT LED CLUSTER (RC) 56-2985 
C1, C3 2 100N 2.5MM Y5V DIELEC.CERAMIC (RC) 08-0275
C2 1 220N 5MM Y5V DIELEC.CERAMIC (RC) 08-0280  
C4 1 100UF 25V LOW IMPEDANCE ELECTROLY CAP RC 11-2922
R1, R2 1 pack PACK 10 10R PR02 2W POWER RESISTOR RC 62-6708
R3 1 pack PACK 100 3K3 0.25W CF RESISTOR (RC) 62-0382
R4 1 pack PACK 100 100R 0.25W CF RESISTOR (RC) 62-0346
R5 1 pack PACK 100 150R 0.25W CF RESISTOR (RC) 62-0350
R6 1 See text (option) -
PR1 1 6MM CERMET POTENTIOMETE HIGH TEMP 10K (RC) 67-0354
PWR-ON LED 1 MINIATURE 3MM PURE GREEN LED (RC) 55-0107  
D1 1 1N4148 75V 150MA SIGNAL DIODE. (RC) (option) 47-3308
       
IC1 1 PIC16F684-I/P MICROCONTROLLER (RC) (Needs programming) 73-3388
IC2 1 ULN2003A TRANSISTOR ARRAY 7 MATCHED (RC) 82-0618
IC3 1 DA78L05 V REG +5V 100mA TO-92 TRU (RC) 47-3612
IC4 1 CNY17-3 TRANSISTOR OPTOISOLATOR (RC) (option) 58-0886
LED cluster plug 10 2 WAY SINGLE ROW PCB HEADER PLUG (RC) 22-0520  
       
Socket for IC1 1 14 PIN 0.3IN DIL SOCKET (RC) 22-0155
Socket for IC2 1 16 PIN 0.3IN DIL SOCKET (RC) 22-0160
Socket for IC4 1 6 PIN LOW PROFILE IC SOCKET (RC) (option) 22-0145
SW1 1 5.85MM RIGHT ANGLE TACT SWITCH (RC) 78-1154
PSU 1 15W MINIPLUG TOP SM PSU 12V DC 1.2A (RC) 85-2902
DC Power Skt (J1) 1 2.1MM PCB DC POWER SOCKET (RC) 20-0970 
CN1 1 BLACK PCB SKELETON PHONO SKT (RC)  (option) 22-1122
CN2 / CN3 1 2 WAY 16A PCB TERMINAL BLOCK (RC) (option) 21-0112
  • All Rapid parts/descriptions correct at 22-May-2008.  You should check part# and descriptions are correct when ordering in case I've made a mistake transferring them onto this page.

  • I assume you have previous experience of assembling electronic circuits and have the necessary tools, equipment, miscellaneous wire etc. needed.


Software

The PIC 16F684 microcontroller needs programming before use. Source code and programmer ready HEX files can be downloaded here.

Download:

Firmware version 1.0.6, release date 23/05/2008

Not got a programmer?  Buy a pre-programmed PIC from the On-line store


Contact us: