Hi,
A couple of years ago I built my own bike light for my daily commute and it's worked pretty much flawlessly since. That was until last Friday when suddenly turned off as I was about half way home. I have a 'low battery' LED that is steady when the supply voltage is getting low and then blinks when it's critical and that's what it was doing. Once it decides the voltage from the battery is below a certain threshold, it turns off the light to avoid discharging the battery too far. On Friday it went from LED off (voltage fine) to blinking (critical).
As a quick overview, a small 12v battery powers a halogen bulb and my rear light. A PIC allows me to control the brightness and checks the battery voltage.
Because of a lack of pins on the PIC, I use the PWM output to the main bulb to feed a 'smoothing' circuit to give me a power supply feed that is only on when the light is on. This feed is used for a voltage divider so that the PIC can measure the supply voltage and supplies a voltage regulator for the rear light. The problem seems to be in this smoother circuit somewhere.
I've attached the schematic and two oscilloscope traces that I don't quite understand.
R4 is where the smoother circuit begins. If I measure on the left of R4, I get the nice square wave signal shown in R4_left.png.
If I measure on the right of R4, the square wave is suddenly not getting any lower than 11.6V.
If anyone has any ideas why this should be the case, I'd love to hear them. I welcome any constructive criticism about the circuit, but be gentle on me. I'm teaching myself this as I go along.
I've noticed a one or two things I would probably do differently were I to do it again, but as I said, it's worked flawlessly for the last couple of years so either it's not that bad, or I've just been extremely lucky
I appreciate any help anyone can give me.
Regards,
Richard.