Am designing a small project using a single AA 1.5V alkaline battery boosted to 3.3V to power a 18F1220. I would like to have a way to detect a low battery situation which it reaches around 1.25V or lower (not obsessed with accuracy).
What is the best way to achieve this? One way I read involves the use of an IC (eg TSM9118 or STM1601) but detecting single battery low voltage at 1.25V seems to be outside their range.
Am looking for a design involving the least parts and cost involved.
At a quick look at the datasheet, the 18F1220 has an analogue to digital converter.
Use one of the analogue inputs to read the battery voltage and set a low alarm at your required low volt point.
However, I read that this may not be workable as the MCU is powered by the same battery it is trying to measure. So as the battery depletes, its voltage drops, the ADC is also affected.
However, I read that this may not be workable as the MCU is powered by the same battery it is trying to measure. So as the battery depletes, its voltage drops, the ADC is also affected.
You said that the battery voltage is boosted to 3.3V. If that voltage is regulated, then you can use it as reference voltage for the ADC and then measure the battery voltage correctly.
Also, Neat way to measure battery voltage is to set the battery voltage as the voltage reference and then measuring the internal reference voltage. Not sure if this is possible in PIC.
For 10 bit conversion the battery voltage is then: Vbat = INTERNAL_REF*1024 / ADC_READING
You might be able to measure the duty cycle of the power supply. When it is boosting to the max is a good time to shutdown.
The output of the error amp can also indicate the amount of boost.
Have decided to use the ADC pin of the MCU to determine the voltage of the AA battery using the regulated 3.3V Power to the MCU as the reference.
I plan to measure the battery level occasionally but am wondering if there's a simple way to prevent the battery from "leaking" when there is no need to measure it.
When the ADC pin is not measuring the battery (not in input mode I suppose) would there still be current from the battery going into the pin? My primary objective is to conserve the limited power of the AA battery since I want the circuit to run as long as possible.
Must admit I do not quite understand your question (still a newbie ) but is it something I should be worried about?
I have not looked at your data sheet but most of those ADC input pins have a worst case leakage current of 10uA and a typical leakage current is very very low.
There is a time (fraction of second) when the battery is 1.5 but Vcc is less than 1.5 because the boost up supply is just starting up. I am thinking about the diode from input to VCC in side the micro. I would break open the wire from micro-input to battery and add a 1k to 10k resistor. This should not change the readings but will limit current through the protection diode.
Bill, the lowest voltage that can be measured by the LVD module is 1.99V according to the datasheet. This is still above the 1.5V of the battery. Are you suggesting I measure the 3.3V going into the MCU itself?
The LVD is not measuring the 1.5 battery but the 3.3v.
When the 3.3V gets too low you get a signal.
You are watching when the power supply can't do its job any more.
Correct, it compares VCC to a built in voltage reference.
That PIC is still functional down to 2V if I recall, so unless your peripherals would suffer I'd pick the lower. What do you plan for it to do when low voltage occurs?