Bike Lighting Project

Thread Starter


Joined Oct 21, 2009
Hello, im tring to design a lighting system for my bicycle...

Im tring to use a joule thief circuit tuned at 12-16VDC, so that i have a high frequency going to these 20Watt LEDs. im going to have a brake light, 4 Turning signal LED (2 front & back) and a head light. I want to use the joule
thief becuase of its fast pulse, and hoping that the current use is low. but if thats not the case, I want to find a microcontroller capable of driving these LEDs, via a pulse in the 120Hz+ Range. Here's what it should do:

Get on my bike, and start to pedal, a switch gets tripped on every rotation, telling the microcontroller to turn on.
Now we have front light, and rear lights on.
Rear light will need to be at like 25% to %50 of full brightness (Software Variable), until the brakes are hit.
Blinkers need to have a variable ON/Off time.
and last: Switch for high/low-Beams on front light.

so... any sugestions on what microcontroller to use?



Joined Nov 16, 2007
First, drop the "Joule Thief" scheme as it was not designed to do what you want to do with it. What you need, if your going by way of micro controller, is an MC with PWM capability built in. This is where you can get the pulsing you want to adjust the LED brightness of the LED's.


Joined Jun 15, 2011
I think it largely depends on what programming language you want to use and if you're already comfortable with a certain family of microcontroller. Personally, I would go with a PIC with hardware PWM built-in. Many of the microcontrollers in the PIC16 and PIC18 family have built-in PWM like this one. From what you've described, it sounds like you only need one PWM output, so the PIC16F616 would probably work.

On another note, I would abandon the concept of turning the microcontroller on at every rotation (unless it's meant to trip and then stay on). It might not be a big deal, but I'm fairly certain that one of the things that limits life of a microcontroller is the number of times it's turned on/off (also the number of times it's programmed, but that won't matter), and that's a lot of on/off if it's every rotation. Not to mention your PWM won't function very well either. I'd just figure out a way to turn it on and keep it on until you're done riding.

In summary, a microcontroller is probably your best bet. And you'll want one with built-in PWM to control the brightness of the LED's. Then when the brake is hit, just increase the duty cycle to 99%, or disable PWM and just turn the output fully on. The other stuff you can work on ;)

Have fun, it sounds like a neat project. I might do this for my wife's old Schwinn Stingray now that you've sparked the idea. :)


Joined Aug 12, 2011
One project I did was a motorcycle dash panel using an LCD graphic display and a PIC24F to display various mileage and engine data.

Similar to a bicycle, the conventional way of sensing wheel rotation for a motorcycle is with a reed switch and magnet typically located at the front disk brake rotor. You can optionally use a Hall effect sensor, but the reed sensors hold up fine and they're cheap. You just need to debounce the signal with a couple resistors and a cap. You employ it pretty much exactly like a debounced tactile switch.

If using an MCU, a wheel speed sensor is a good way to sense when the unit needs to wake-up and return to sleep and you can easily add other functionality if you like. You can actually go in and out of sleep mode on an MCU at a relatively high frequency. It's only limited by the MCU's clock startup and any transients resulting from signals changing state on output pins, but I wouldn't go that route. I'd use one of the MCU's timers to provide an elapsed time before entering sleep mode and thereby shutting down the system.

My understanding about the Joule Thief is that lighting is a good application for it. You get better efficiency out of an LED when pulsed with higher voltage for shorter time versus lower voltage for longer time.
Last edited: