----- Original Message -----
From: "Alan B. Pearce" <.....A.B.PearceKILLspam
@spam@rl.ac.uk>
To: "Microcontroller discussion list - Public." <piclist
KILLspammit.edu>
Sent: Wednesday, February 02, 2005 11:11 AM
Subject: Re: [PIC]: Monitoring battery status.
{Quote hidden}> >I have a PIC16F873 that sends through the USART some analogic
>>acquisition. Now I want to watch the status of the battery
>>(Ni-Mh or Alcaline) that powers the pic.
>>I suppose to:
>>- measure the voltage between the battery pin with one of the
>>ADC to get voltage and
>>- measure the voltage between the cap of a shunt resistor in
>>series with one pole of the battery to get the intensity.
>
> There is a sneaky way to do this.
>
> Use the internal reference for the ADC
> Use an external reference that is a lower voltage then the low voltage
> drop
> out point of the battery. Many of the 2.5V reference chips are probably
> suitable for this. One like the Analog Devices AD580 is what I have in
> mind,
> as it has an internal constant current supply from the battery, but you
> may
> wish to hook that to a PIC pin to turn on when you want to take the
> measurement, otherwise you have a constant drain of 1.0-1.5mA with this
> device, that is doing nothing for you for most of the time. also check the
> minimum operating voltage (4.5V in this case) for the current source to
> stay
> stable. Other devices may give you better specs than these.
You may be able to use the same PIC pin that you use for the analog input to
power the reference chip. Simply connect a diode, anode to PIC pin, cathode
to Vdd pin of reference chip. Then connect a capacitor to the Vdd pin of the
reference and ground. Now you simply set the PIC to be a digital output, set
it high for a while, and then set it back to analog input to read the
reference.
Bob Ammerman
RAm Systems