Bike flashlight driver

with PIC12F1501 and MIC5209
Next ProjectNext ProjectNext Project
Previous ProjectPrevious ProjectPrevious Project
The driver!
Bike Flashlight Driver | 11 April 2022
Open-source bike flashlight driver with 4 modes, suitable for almost any power led smaller than 500ma. I made this because my bike flashlight's circuit got burned and because I didn't like it anyway and because I could not find a "good" (in my opinion) flashlight on the market.
The driver!

The driver requires at least 5V input as power source. MIC5209 is a LDO with a max of 500mV dropout voltage @ full load (500ma). PWM is used to power the led from 4.2 regulated voltage. The pulse width can be changed in the code via PWM4DCH register. Examples have been given as contants in main file ranging from 17ma@1.19V to 490ma@2.98V. When sleeping only few microamps are consumed. Economic mode uses only 56ma@1.4V and is ideal for longer battery life. MCP1826T-ADJE/DC with an output of 1A and super low voltage dropof about 250mV, can also be used if it fits in the small flashlight space but it also comes with two additional resistors for the voltage adjust. One can play with a different output, instead 4.2V, 5V can be used along with different PWM values.

A quick demo shows different modes are being changed with short clicks: full, full blink, economic and economic blink. To shut down/sleep the flashlight one must do a long push > 1.4 seconds. To turn on the flashlight a short press is required. The last mode will be active on wake-up.