Voltage Monitor: "Vref+ < Battery supply" can I do this?

hugoxp1

Member
I know that already exist many posts about Voltage monitor... but after reading all the posts I’m still have doubts :(

My rechargeable battery has 3,7v and because of some ICs I will use a 3,3v voltage regulator supplying my 20x2 Picaxe and all the others ICs.

I want to monitor the battery’s voltage (to alarm in low battery).
My internal Vref+ will be 3,3v (Picaxe’s Vcc)


What will be my ADC readings «readadc10» (if I connect to ADC3 the battery’s voltage) when battery is fully charged with 4,2v (since the Vref+ will be 3,3v)?
(note: because this is a rechargeable battery the voltage will change from 4,2v to 3,2v and I want to alarm when the voltage drops to 3,6v)

Thank you
 

hippy

Ex-Staff (retired)
The general rules are -

Vcc <= 5V5
Vref+ <= Vcc
Vadc <= VRef+

So as Andrew notes, you will have to use a divider.
 

Dippy

Moderator
well, someone has got to don the anorak... so let it be me.

Remember, we have " VDD " on PICs . MOS.

I know it sounds a little pedantic but others may struggle searching for Vcc in the PIC datasheet.

I suggest people use V+ or +V as used in PICAXE Manuals Pinout diagrams to save confusion.
 

John West

Senior Member
Dippy: Your comment reminded me about having to explain once that the orange capacitors were OK to use in place of the blue capacitors.
_
Inasmuch as the goal here is to have a "low voltage" alarm circuit, would it be acceptable to simply use say a 5K or 10K Ohm current limiting resistor into the ADC input and then just read the values after they have dropped down below the rail?

That would save one resistor from the voltage divider and the associated power loss as well as making the code smaller and simpler by a few bytes.
 
Last edited:

MartinM57

Moderator
...fine...except that you won't be able to tell the difference between any voltage above 3V3 (they'll all read 255 or 1023) - but you want an alarm (post #1) at 3V6...
 

John West

Senior Member
...fine...except that you won't be able to tell the difference between any voltage above 3V3 (they'll all read 255 or 1023) - but you want an alarm (post #1) at 3V6...
Tnx. I wasn't keeping the specified levels straight in my head. Been a rough morning.
 

BeanieBots

Moderator
Actually, it's worse than that.
With just a current limiting resistor, Vsupply will ALWAYS be slightly higher than the regulator output (which is supplying Vdd) so the ReadADC will ALWAYS return 255 no matter what the voltage is.
 

Technical

Technical Support
Staff member
A simple potential divider across the battery (e.g. two 4k7 resistors) will give you 2.1V to 1.8V (half of 4.2 and 3.6) at the midpoint. So you can either just do a readadc on this value or use a comparator to compare to a fixed voltage from the IVR (see compsetup command).

The nice thing about the comparator approach is you could use setintflags to interrupt when the comparator flag changes, so the battery checking is done in the background.
 

John West

Senior Member
Actually, it's worse than that.
With just a current limiting resistor, Vsupply will ALWAYS be slightly higher than the regulator output (which is supplying Vdd) so the ReadADC will ALWAYS return 255 no matter what the voltage is.
Good point, BB. It's a tail chase to ground. Ugly scenario. I'll keep that little problem in mind on my future ADC projects. Tnx.
 
Top