MooseFET said:
No, the PIC is the wrong part for this. You want an LM555 :>
A two LED or two color LED indicator is a better way to go. You have
more than two states to indicate:
Blink green I don't see a battery
Green The battery is fully charged
Blink yellow The battery is very low
Yellow The battery is being charged
RED Big trouble I've stopped charging this battery
What's wrong with a PIC? They now have the PIC12HV615 and the PIC16HV616
that have built-in voltage regulator, 4 channel PWM, comparator with S-R,
600 mV reference, and other goodies that are specifically for switchmode
power supplies and motor control. You can sense battery voltage and current
for both charging and discharge, and directly drive LEDs as you suggest. I
would use a slightly different color scheme, and use a low repetition blink
to indicate status when not under charge (to conserve energy).
The difficult part is the isolation. But you can make a very simple DC-DC
converter on the 12 VDC generator side, to produce an unregulated raw 12-20
VDC nominal supply on the battery side. Then it is easy to make an
efficient current regulated, voltage limited charging supply similar to the
PWM LED drivers that are being designed and built by many companies (Zetex,
Linear, TI, etc.). The PIC can be programmed for various cell chemistries
and charging profiles, and also compensate for temperature.
I have also seen a PIC circuit for Lithium cells that can be chained to
others in a series battery pack, and it will communicate with the others to
provide an optimal charge for all, and shut down if there is danger of
current reversal.
Paul