![]() Note that lower supply voltage means higher ADC results, since input voltage and reference voltage are swapped to the usual way. So when the supply voltage drops below 3.0V, the ADC result goes higher than 699: In the case of the 12F1822, the internal reference is 2.048V, and the ADC has 10 bit resolution. Given that, one can simply measure the voltage reference with respect to the supply voltage, and get the supply voltage as an result. But it can also use the supply voltage as reference for ADC measurements (the ADPREF selector on the top). The PIC has an internal voltage reference, and can measure its value (the 'FVR buffer' which goes into the multiplexer). For an example, look the the ADC datasheet for a PIC12F1822, (on page 141): So you could measure the supply voltage of the micro controller.ĭepending on its actual capabilities, you can do that without using a voltage divider. ![]() The output voltage of the regulator will fall below 3V before the battery reaches its minimum voltage. When you need to find out only when the battery is going to be dead (or give a warning shortly before that), you don't need to measure the its voltage directly. One final thing - how does the voltage regulator perform on it's standby current when the micro is off - do you need to take care of it as well? If you can program the MCU to have a pull-down on its control pin when asleep that should be it, else add another (say) 10k resistor from that point to ground - this ensures the P channel FET is completely off.Ī small word of warning, choose a P channel fet with low leakage current when off else there will be a slight drain on battery life but most fets are going to be under 100nA and many in the region of 1nA. Without activation, the P channel FET is turned off and virtually open circuit. The ADC input is shown to the right and there will be no voltage reaching it unless the MCU has activated the BC547 via the 10k resistor. When the MCU wakes up, it will want to measure the battery voltage so what it can do is turn on a circuit formed around a P channel FET that connects the battery +V to the voltage divider:. This can be achieved with a P channel FET (for instance). The voltage divider needs to join the MCU in deep-sleep mode then.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |