I had mentioned earlier that at the slowest ADC clock speed, and a couple of sucessive samplings through 10 meg ohm resristors produced somewhat flakey LSbits, after trying it in my actual battery powered circuit, the numbers are rock solid. I guess my evaluation board, powered by a wall wart with all its extra chips and goings-on, was producing a lot of noise that the resistors were picking up. ----- Original Message ----- From: "Mike Harrison" To: Sent: Monday, October 13, 2003 2:06 AM Subject: Re: [PIC:] Low voltage detection On Mon, 13 Oct 2003 09:50:29 +0100, you wrote: >> > Olin wrote: >> > A better solution would be to only turn on the divider >> circuit for a short >> > time around each reading. It can then draw more current, >> but it's average >> > current draw will be very low For situations where the battery supply is higher than the PIC's supply (e.g. 9V battery), things get complicated by level shifting. Here's a neat way round this (use ficed pitch font): Vbat | +----+ | Q1 | | | R3 \| | C1 |--+--R4--||---Vsense (ADC/Comparator input) | R2 | +-- 0V Q1 = any PNP, emitter to VBat R1,2=10K R3,4 = 100K C1 = 100n R1/2 divide the supply voltage, e.g. both 10K for a 9V supply and 5V PIC supply C1 acts as a level-shifter The 'Switch' line is normally held high, and taken low briefly to turn on Q1 for long enough to read the voltage. The 'Switch' line can often be shared with other functions. Where space is at a premium, use a digital transistor for Q1 so R3 and R4 aren't needed. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu