Bike light follow-up: reverse engineering time!
here is my almost complete circuit diagram.
IC1 is a voltage regulator: 2.5V, exact type I could not find out. Only the MSP runs on the regulated voltage, all the rest runs from the raw battery voltage.
Voltage divider R2 1M / R3 330K measure the battery voltage (some microamps get lost here)
LED2 and 3 are indicator (red/green)
LED1 is the power led
PWM is 20kHz, coming from pin 11 of the MSP.
Main switch is a Si4562, N and P channel 20V 5A mosfet. Inductor is 100uH.
Instead of using only the upper fet, they alternately switch on the upper / lower FET, avoiding one diode voltage drop, increasing effiency.
The circuitry around IC3 (a weird CMOS 4572) creates a small dead time (less than a microsecond) to avoid cross-conduction.
Note the resistors in the signal path ;-)
They managed to regulate the LED current without a shunt resistor. Took me some time to find out how:
The voltage across the inductor is low-pass filtered, R14 390k / C4 0.1u, then fed into the MSP. Of course the DC-part of the inductor voltage depends on the current flow.
Pretty clever. The regulation is rather slow (ramp-up of current is so slow it is actually visible).
The circuitry around Q8 and Q9 takes care of the battery charge turn on/off. Input is from a wall-wart adaptor which is 500mA constant current type.
R10/R11 tell the MSP that external voltage is present.