Low Battery Indication

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
mel
Posts: 9
Joined: Tue Dec 12, 2006 4:11 pm
Location: UK
Contact:

Low Battery Indication

Post by mel »

I want to be able to monitor & turn on an LED when my circuit supply line drops from about 9.8Volt (New Battery) to about 7Volts( Low Battery). I would anticipate setting the battery reference voltage in the circuit,with a potentiometer to about 7 Volts & when the battery drops lower than this ,then the pic turns on the LED.Can someone tell me how I can do this using Flowcode please. Using a Pic type 12F629.

User avatar
Steve
Matrix Staff
Posts: 3427
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Low Battery Indication

Post by Steve »

That chip has a comparator module with a selectable internal voltage reference. I'd suggest using this feature, with an external potential divider that divides the battery voltage down suitably - perhaps halving it will be ok.

You will need to resort to some C code for this, but it is fairly minimal - you'll just need to set up the CMCON and VRCON registers appropriately and periodically check the status of CMCON:COUT.

Post Reply