CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

OT: ADC with variable Vdd

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
djpark



Joined: 02 Mar 2004
Posts: 49

View user's profile Send private message

OT: ADC with variable Vdd
PostPosted: Wed May 19, 2004 11:32 pm     Reply with quote

This is not exactly related to CCS so it may be OT, but I believe this is where I get the best advice.

I have a project using 12F675 which runs on a Li-Ion rechargeable bettery set and plan to include a over-discharge protection feature by shutting down when the battery voltage goes below a cetain level. I expect to use any of AN pin and internal Vref to measure the battery.

My question is: when Vdd from the battery goes down, I presume the Vref is also going down. So is the ADC result the correct (absolute) value of the lower battery voltage or still showing full measurement value (100%)?

If ADC result is relative to Vref derived from Vdd, is there any way to get the correct voltage without using an external Vref? The board size limits the use of extra components.

Thank you in advance.

-- dj
Kenny



Joined: 07 Sep 2003
Posts: 173
Location: Australia

View user's profile Send private message

PostPosted: Thu May 20, 2004 12:24 am     Reply with quote

If the battery were connected to an analog input, and the reference is the battery voltage, then the measurement will always be 100% (it's ratiometric to the reference).
I think a reference and other components are needed, unfortunately.
SLomas
Guest







PostPosted: Thu May 20, 2004 2:22 am     Reply with quote

Kenny is correct, connecting the battery supply directly to the ADC input will give maximum values every time as the ADC input & reference are the same.
I had a similar application to monitor the state of a battery powering a remote control with a 12F675, I used a zener as a constant voltage reference and fed this into the ADC, what happens then is the ADC reading rises as the batterv (and ADC reference) voltage falls towards that of the constant reference.
The upshot of this is that you will need some sort of constant voltage reference, so you need extra components, however these could be minimal, I used a zener diode & resistor.

Steve.
djpark



Joined: 02 Mar 2004
Posts: 49

View user's profile Send private message

PostPosted: Thu May 20, 2004 3:21 am     Reply with quote

SLomas wrote:
I had a similar application to monitor the state of a battery powering a remote control with a 12F675, I used a zener as a constant voltage reference and fed this into the ADC, what happens then is the ADC reading rises as the batterv (and ADC reference) voltage falls towards that of the constant reference.
The upshot of this is that you will need some sort of constant voltage reference, so you need extra components, however these could be minimal, I used a zener diode & resistor.


Your design looks like using internal Vref (from battery) and measure the constant voltage at zener diode, so the ADC value rises as the battery goes down. A clever way to save an io pin.

A part of PIC manual suggest 2k impeadance of ADC and max 10k. If the PIC is running on a Li-Ion with battery voltage starting at 4.2V down to 3V, what voltage zener diode and register value do you recommend? I am trying to minimize the current usage.

-- dj
jaremek16
Guest







PostPosted: Thu May 20, 2004 3:53 am     Reply with quote

Don't use zener. Better use LM431 instead or the best is using LDO regulator as well LP2950.
Accuracy will be much better.

regards
SLomas
Guest







PostPosted: Thu May 20, 2004 4:33 am     Reply with quote

dj, does your existing circuitry have an LED driven by an IO pin, if so you can be cunning and use no extra components.
I changed my remote control design to save components, what I actually do is use the forward volt drop of the LED as the constant voltage reference. Not as accurate as a zener, or other sources as suggested by jaremek16, but very cheap as I was already using the LED anyway.
This allows me to monitor the state of the 3V button cell and gives a change in ADC (8bit) reading of 4 steps per 0.1V change in battery voltage over the range 2.2-4V which covers my operating range.
It's a question of accuracy vs cost, for me cost was more important.

Steve.
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Thu May 20, 2004 7:29 am     Reply with quote

djpark -

There are relatively inexpensive ICs that act as low-voltage cut-outs for Li-Ion rechargeable batteries, the UCC3952 family from TI for example. Protects agains over charge and under charge.

If you are not using a rechargeable battery in your circuit the trip levels may not be quite what you are looking for though.

And if you are using Li-Ion rechargeables but taking them out to recharge, then the over-charge protection portion of the IC is wasted but you can still use it to prevent over-discharge.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Amsterdamned



Joined: 13 Aug 2004
Posts: 5
Location: Amsterdam

View user's profile Send private message

PostPosted: Sun Feb 13, 2005 12:55 pm     Reply with quote

It aint that critical so you can use the led thats indicating the on state and when you puls the led with max 10ms. 1/10 of the time you can save a lot of the lithium power or make the led very bright by giving it 10 times the current! (trick used for power leds)
If the led is on the voltage depending on the type is +- 1,6V. Components needed is: 3 resistors, 1 led.

Greetings,
Amsterdamned.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group