Background : Tubular Front White Light
For a number of years 'bar' type LED front and rear bike lights have been popular. I decided that i would implement my own version using high brightness LED's and a PIC to generate various light patterns. The light has to be light weight, operate from around 5V or lower and be easily transportable.
Below is the outline of the solution that was developed.
Below is the outline of the solution that was developed.
A basic simple circuit was designed using 5 high brightness white 10mm LED's, a switch and a Microchip PIC 12F675 in an 8 pin DIL package in much the same way the red LED rear light version was developed.
The 12F675 was chosen as a number of other projects have been developed using it so a it was readily to hand, it has up to 6 configurable input/output pins and has only 8 pins so can be packaged into small areas.
Of the 6 I/O pins, one is used as an input for the light pattern selector switch and the remaining 5 I/O pins are used to drive the LED's.
A prototype circuit was developed on breadboard and the PIC 12F675 was programmed using a PicKit1 development board.
After the prototype circuit was constructed the software was developed using the Microchip MPLABX IDE. The program was written in C using the Microchip XC8 compiler.
After the software was developed and debugged the prototype circuit was constructed on single sided copper strip board. The layout of the circuit board and its dimensions were controlled by the dimensions of the acrylic tube to be used to house the circuit board.
To make the construction simpler, rather than use wire connecting links on the component side enameled copper wire was used to make the connections on the solder side of the board. This was achieved using a homemade wiring pen which i had not used for almost 30 years. For more details about the wiring pen refer to the Red Tubular/Bar LED Rear Bike Light page.
When all the wiring was completed the enameled copper wires were held in place with a few drops of hot weld glue along their length.
After the software was developed and debugged the prototype circuit was constructed on single sided copper strip board. The layout of the circuit board and its dimensions were controlled by the dimensions of the acrylic tube to be used to house the circuit board.
To make the construction simpler, rather than use wire connecting links on the component side enameled copper wire was used to make the connections on the solder side of the board. This was achieved using a homemade wiring pen which i had not used for almost 30 years. For more details about the wiring pen refer to the Red Tubular/Bar LED Rear Bike Light page.
When all the wiring was completed the enameled copper wires were held in place with a few drops of hot weld glue along their length.
The circuit was mounted in a piece if acrylic tubing with plastic push fit end caps.
Suitable sized holes were drilled in the end caps for the light pattern selector switch and the power supply cable.
Some metallised plastic film was cut and inserted into the acrylic tube to reflect and direct the light output.
This picture shows one of the end caps with the light pattern selector switch installed.
The switch is soldered to the PCB with stiff wires and secured to the end cap with a lock washer and nut. Together these secure the PCB inside the acrylic tube. The PIC 'remembers' the light pattern last selected in the PIC 12F675 on chip EEPROM so that it does not have to be re-selected each time the light is switched on. |
The power cable was made from a recycled USB cable using only the power wires.
The power cable was secured in place with some hot weld glue on both the circuit board and where it passed through the plastic end cap. |
This photograph shows the finished light in operation displaying one of the light patterns.
The light was tested outside in a dark street and is easily visible well beyond 200m with all light patterns.
The PIC 12F675 can operate down to 2.5V. This means that the maximum capacity of the batteries can be used. The light was tested with fully charged batteries running them down until the pack was producing 3.0V at the terminals while operating the light. The light output was still very good and the patterns were still able to be selected. The running time of the batteries was greater than 35 hours continuously. White LED's have a higher forward voltage than red ones so the useful light output occurs at a higher supply voltage than is possible using the red LED's.