measuring voltage with PIC

You simply need a voltage divider to scale the battery voltage to whatever the PIC is running. If it's on 3.3V (for example), then taking roughly 1/4 of the battery voltage would suffice (although a nominal

12V battery may well be somewhat above that).

A typical solution (to account for a battery of up to 14V) might be a divider of 33K and 10K (33K connects to battery, 10K connects to 33K and other end of 10K to ground, take the junction point to the A-D input).

This yields a division ration of 4.3:1 for ADC readings (i.e. 12V on the battery will give 2.79V at the ADC input).

Simply scale the data from the ADC accordingly.

All PIC ADC inputs have cautionary notes on their input impedance. In this case, the input impedance would be roughly 7.7k from the divider pair, assuming a small output impednace from the battery. You could put a small cap (0.1uF) across the 10k, but this will increase the sample switch required time. If you aren't worried about incredibly fast conversions, that's no real issue.

Cheers

PeteS

Reply to
PeteS
Loading thread data ...

victor maybe this link might help

formatting link

Larry Keegan

Reply to
larry k

One of my early circuit designs featured a battery voltage monitor going to the uP. Of course I went _straight_ to the uP from the _battery_, instead of that switch...

The uP kept trying to run from the current that was finding its way from the battery voltage divider to VCC.

So pay attention to which side of the power switch you put things...

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
Reply to
Tim Wescott

Hello Im looking for a schematic on how to monitor a battery voltage using a PIC16F871 which is connected to a LCD.

Battery is NiCad 12vdc. Software I can get organised.

Many thanks Victor

Reply to
Victor Nowecki

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.