View previous topic :: View next topic |
Author |
Message |
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
(Off Topic) Battery Voltage Detector |
Posted: Fri Aug 26, 2005 9:08 pm |
|
|
I think this has been covered before, but I couldn't find the topic.
How does one control the power to a voltage divider to sense the battery voltage? This is a 4 AA powered app that runs at either 3 or 5V and needs to last as long as possible. So, the goal is to only power the voltage divider to the ADC when taking a reading.
The topology below is an obvious option. Simply set RA4 as an input to power it up. Take a reading and then turn it off.....
However, I remember there being some issues with the configuration....
Code: |
Vbat(6V)
|
|
|
\
/
\
/
\
/
|
|___________ AN0
|
|
\
/
\
/
\
/
|
|___________ RA4
|
Thanks,
John |
|
|
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
Posted: Fri Aug 26, 2005 9:46 pm |
|
|
When you put the RA4 into the high-Z state, +6V will appear on AN0 and RA4, and +6V is higher then the max allowed voltage. You could ground the bottom of the divider and add a small MOSFET (like 2N7000) in series with the top resistor. Or you could pick the higest possible values for the resistors, and have the smallest leakage. I remeber that the maximum value for the lower resistor is 2.5k, this was mentioned in the PIC's datasheet. |
|
|
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
Posted: Fri Aug 26, 2005 10:01 pm |
|
|
Thanks Kender,
I can't believe that didn't dawn on me. I'll go the FET route and everything should workout.
John |
|
|
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
Posted: Fri Aug 26, 2005 10:09 pm |
|
|
kender wrote: | ... add a small MOSFET (like 2N7000) in series with the top resistor. |
Come to think of it, it should be a P-channel MOSFET, because it's a high-side switch (2N7000 will not work). You could also use a high-side switch IC. |
|
|
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
Posted: Fri Aug 26, 2005 10:44 pm |
|
|
Wouldn't have caught that one. I've got other designs using FETs and they are always on the ground leg (low-side). Probably would have plowed right into the wall. Thanks for the correction.
I Googled and found this option:
http://www.micrel.com/product-info/products/mic2514.shtml
Printing out the data sheet now to read up on. Just another wild Friday night! |
|
|
|