Excuse my ignorance but doesn't the A/D converter need a reference which in this case would be the supply voltage, which would be dropping at the same rate as the analogue signal of the battery supply.
If you use a constant voltage source and measure that with the ADC, as the battery voltage falls, the ADC reference falls but the voltage you are measuring doesn't.
Therefore the value you read back from the ADC will increase as the battery voltage drops and you can work out what the battery voltage is.
If you use a constant voltage source and measure that with the ADC, as the battery voltage falls, the ADC reference falls but the voltage you are measuring doesn't.
Therefore the value you read back from the ADC will increase as the battery voltage drops and you can work out what the battery voltage is.
Yes battery powers regulator, regulator powers PIC, so measure raw battery voltage before the regulator by using a two resistor divider and measureing 1/2 battery voltage with the PICs A/D function. In your software you can compare A/D value with a constant value you select and do something meaningful when the battery goes below your setpoint value.
You power the PIC from the battery and use a micro power voltage reference IC, for example an LM385 to present a constant voltage at the AD input of the PIC.
Excuse my ignorance but doesn't the A/D converter need a reference which in this case would be the supply voltage, which would be dropping at the same rate as the analogue signal of the battery supply.
Thanks for the help on this. I tried it last night and it worked a treat! I put a pot inseries with the battery to simulate it running down and fine tune my alarm. Came out supprised how little voltage a PIC can run on, don't know how reliably though.