Low Battery Indication
Low Battery Indication
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.
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: Low Battery Indication
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.
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.