Use a 2 resistor divider, no op amp needed. Try a 22K from the battery to the A/D, and a 47K from the A/D to GND. Sherpa Doug > -----Original Message----- > From: Kosmerchock, Steve [mailto:Steve.Kosmerchock@RFSWORLD.COM] > Sent: Wednesday, March 27, 2002 3:20 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: measuring battery supply via A/D > > > Glen, > > Two diodes would give you a drop of 1.4VDC. > So REF V would be 5.8V, still too high. You could use > an op-amp and resistor network. > > Steve > > > > -----Original Message----- > From: Glen Wiley [mailto:gwiley@GWILEY.COM] > Sent: Wednesday, March 27, 2002 1:12 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: measuring battery supply via A/D > > > From a software guy to the EE's of the world... > > I would like to measure the voltage level of my battery > power supply (6 NiMH AAA cells) which should start at around > 7.2V. Using the A/D (AN0) pin on a PIC16F872, what is the > best way to do this. My first guess was to insert 2 diodes > in series to take the max input voltage down to 4.8V. > > The goal here is to log the battery supply voltage (along > with some other info which is stored in serial EEPROM) for > later analysis. This does not have be absolutely accurate, > only relatively accurate - this portion of the data will be > used to generate data for trending battery life under normal > operating conditions for the device. > > thanks in advance for your time > -- > Glen Wiley > > Everything should be made as simple as > possible, but not simpler. -- Albert Einstein > > -- > 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 > > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu