Searching \ for '[PIC]: self battery sensing' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/power/batterys.htm?key=battery
Search entire site for: 'self battery sensing'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: self battery sensing'
2000\11\29@235617 by staff

flavicon
face
> I'm starting work on a project using a PIC powered by a battery.
>
> The idea is that the PIC will spend most of the time in sleep mode so the
> batteries will last a nice long time - at least a year would be our target.
>
> The PIC will probably be something like a PIC16C711.
>
> We need some way of providing an alarm when the battery is low. i.e. a
> voltage sensor that doesn't itself use much power.
>
> Are there any chips around to do this?
>
> Anyone got any ideas about how I could do this?
>
> Brian Gregory.



Brian, I have a one-pin solution but need to know
if the PIC is running from a regulated voltage,
or if the PIC is running from the (ever decreasing)
battery voltage?
-Roman

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics



'[PIC]: self battery sensing'
2000\12\03@154954 by Brian Gregory
flavicon
face
Roman Black <spam_OUTfastvidTakeThisOuTspamEZY.NET.AU> wrote:
> Brian, I have a one-pin solution but need to know
> if the PIC is running from a regulated voltage,
> or if the PIC is running from the (ever decreasing)
> battery voltage?
> -Roman

I will probably be running the PIC from 5V from a LDO regulator.
The battery will probably be 9V Alkaline.

Brian Gregory.
.....briangKILLspamspam@spam@cix.co.uk

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2000\12\04@023913 by Roman Black

flavicon
face
Brian Gregory wrote:
>
> Roman Black <fastvidspamKILLspamEZY.NET.AU> wrote:
> > Brian, I have a one-pin solution but need to know
> > if the PIC is running from a regulated voltage,
> > or if the PIC is running from the (ever decreasing)
> > battery voltage?
> > -Roman
>
> I will probably be running the PIC from 5V from a LDO regulator.
> The battery will probably be 9V Alkaline.


Did you see Dan's suggestion? Basically have a high value resistor
from bat + to the PIC pin. 560k will do nice. Use a small ceramic
cap, like 0.1uF or 0.047uF etc from that pin to ground.
Pull the pin low and then switch it to input and count time
in software until it reaches a "1" level, about 1 to 2 volts
depending which PIC pin you are using (schmidt input or not).

This charge time will be dependant on the battery voltage,
and since the PIC is run from regulated 5v it's input pin
threshold will give a fairly reliable trigger point. You don't
need an analogue input pin.

For low power use hold the pin at logic high, 5v, so current
will be 9v-5v = 4v/560000 = 7uA so not too bad. I imagine
the PIC pin protection diodes will handle that 7uA, but if
you have the space and budget put a 5.1v 400mW zener from
pin to ground to keep everything in spec. I would do this
if the product was for commercial sale. Heck I always have
5.1v zeners around so I would do it anyway! Check zener
leakage, with the PIC unplugged, you may need a higher
voltage zener to balance at such a low current, like 7uA.

I am not sure how this circuit will hold up under battery
measuring when the battery gets to 5v, but hopefully the
user has seen the low battery indication and changed the
battery by the time it gets under 7v or so. :o)
-Roman

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2000\12\04@233524 by Dan Michaels

flavicon
face
Roman wrote:
{Quote hidden}

Actually this was my "guess" as to what Roman's ckt was,
as he wasn't saying at the time :). Turns out he liked my
guess better than his own actual ckt.

I hadn't really thought about it much, but Alice mentioned
offlist that this dohicky is quite dependent upon the tolerance
on the cap. Then of course you have to worry about calculations
related to exponential charging waveforms, but I am sure the
s.w. weenies got a way around exp/log computations.
===============


>This charge time will be dependant on the battery voltage,
>and since the PIC is run from regulated 5v it's input pin
>threshold will give a fairly reliable trigger point. You don't
>need an analogue input pin.


Actually, as mentioned last week, my "preferred" ckt would
use an A/D channel connected to a digital I/O pin thru 10K
as well as to the battery thru a 5.1v zener. Pull the I/O
pin low, and you get battery value directly, Vanal_in = Vbatt-5.1v.

Also, when you pull the I/O pin high, the only current thru
the zener is gonna be leakage - hopefully low. But you could
probably deal with that by floating the I/O pin rather than
pulling high. If you don't like floating tie a 500K from the
pin to Vdd.
=================

>
>For low power use hold the pin at logic high, 5v, so current
>will be 9v-5v = 4v/560000 = 7uA so not too bad. I imagine
>the PIC pin protection diodes will handle that 7uA,


Yeah, supposedly 25 mA - although I have put 75-100 mA into
PIC pins in qual testing without frying the diodes.

Also, if you look in the old AN521 appnote, Mchp shows a
ckt where they connect 120VAC out of the wall straight into
a PIC thru a 5M resistor. Gives me the willies, but they do
it. They obviously figure the clamping diode knows its job.
================


but if
>you have the space and budget put a 5.1v 400mW zener from
>pin to ground to keep everything in spec. I would do this
>if the product was for commercial sale. Heck I always have
>5.1v zeners around so I would do it anyway!

Bingo - see comments above about 120VAC to pin.
===============

check zener
>leakage, with the PIC unplugged, you may need a higher
>voltage zener to balance at such a low current, like 7uA.
>
>I am not sure how this circuit will hold up under battery
>measuring when the battery gets to 5v, but hopefully the
>user has seen the low battery indication and changed the
>battery by the time it gets under 7v or so. :o)

Hopefully you track Vbatt and catch it before the ckt
crashes.

[hey Roman, I'll trade you some good stepper motor code
for your milling machine - having but one of those and a
1 Ghz scope, and I'll die happy :)].

best regards,
- Dan Michaels
Oricom Technologies
http://www.oricomtech.com
=========================

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2000\12\05@030547 by Roman Black
flavicon
face
Dan Michaels wrote:
{Quote hidden}

Hi Dan, yeah the t=rc curve is very non linear but you have to
imagine the main use of a simple circuit like this is with a
cheap pic (12 series??) and one digital pin, for say a simple
"low battery" threshold sensor, which is how many cheap commercial
devices work, or indeed for a 9v battery it would be fine to sense
say 9.2v, 9.0v, 8.8v etc so I imagine a lookup table with less
than 20 bytes would do fine.

When I used this system I just used it for medium/low battery
sensing with two simple thresholds, which I just hardcoded
after a few trial/error measurements. I didn't expect performance
similar to ADC input but how accurate do you want your battery
level sensing anyway? I have a $300 AU walkman that has a low/
med/high battery indicator. Works fine for me! :o)
-Roman

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2000\12\05@030735 by Roman Black

flavicon
face
Dan Michaels wrote:

> I hadn't really thought about it much, but Alice mentioned
> offlist that this dohicky is quite dependent upon the tolerance
> on the cap.

Forgot to mention that I chose ceramic cap as they are the most
reliable of the small caps, with very little temperature drift
for a 0.047uF cap under these circumstances. Tolerance of these
caps does suck if they are cheap ones, I use a cap tester which
permanently lives on my workbench and is good down to 1pF so
I test just about every cap that get soldered in to anything.
-Roman

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2000\12\05@033935 by Morgan Olsson

picon face
>> Basically have a high value resistor
>>from bat + to the PIC pin. 560k will do nice. Use a small ceramic
>>cap, like 0.1uF or 0.047uF etc from that pin to ground.
>>Pull the pin low and then switch it to input and count time
>>in software until it reaches a "1" level, about 1 to 2 volts
>>depending which PIC pin you are using (schmidt input or not).

In practice that don´t work reliably.

First, the guraranteed tolerance of the PIC high threshold is horrible, and even if it was: a cap with low enough tolerance is not cheap.

I suggest using some cheap reset chip and resistive voltage divider or comparator + reference.  
Or to be cheap: use one single transistor to comapre regulated Vdd to batt voltage trrough resistive divider: a resiistive divider feeding the base of a PNP with emitter to Vdd, and collector with a pulldown resistor to GND.  Four components, but much better guraranteed precision than RC-time solution.  Function: When Batt voltage divided by resistor divider is lower than Vdd-0,6V the PNP start conducting and driving a high level into PIC.

Both alternatives need Vdd to be regulated, BTW.

Another solution i often use is to simply moinitor the voltage drop avross the regulator using a resistive divider and PNP sensing between input-output of regulator, and as long as it is higher than min specified drop for that regulator the PNP os on, feeding input to controller (though another resistive divider).  Five cheap components and nice function.

/Morgan

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...