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

Measure value with A/D, but no accurate ref.

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



Joined: 09 Mar 2010
Posts: 314
Location: Denmark

View user's profile Send private message

Measure value with A/D, but no accurate ref.
PostPosted: Tue Nov 02, 2010 11:09 am     Reply with quote

How to solve this.

My input to the A/D is stable and ok!

The PIC system itself is powered from a bat. that will say the power will drop slowly from about 4,3 down to 3,7, and then I power the system off.

How to make some measurement with the AD when the ref. voltage is not constant?

Maybe the ref. can be made with a 2,5V zener? but the power drain against the zener must be around 1ma. and this is too much.

Another solution is to use one port pin and feed this to the zener system, and then feed the zener voltage to the ref voltage on the PIC only some ms before making the measurement?

I don't want a lot of extra components!

Suggestion?
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Tue Nov 02, 2010 12:18 pm     Reply with quote

what are you measuring?
is it a sensor?
is the sensor running of the same battery pack?
is it a linear sensor?

if its something like a voltage divider with a LDR then then i believe you should be ok..... you wouldn't need anything.. the voltage source of your "sensor" varies proportionally to your Vref....

if R1(LDR)=R2 on your divider (assume 8 bit ADC)
Assume Vref= Vcc.
at 4V Vcc your output is 2V or ~127
at 3V Vcc you output is 1.5V or ~127 .... you cant still figure out the values of the LDR.... regardless of the voltage....


If i am terribly mistaken.... please feel free to correct me.... i have my doubts on this issue too....
_________________
CCS PCM 5.078 & CCS PCH 5.093
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Tue Nov 02, 2010 12:45 pm     Reply with quote

IMO your best choice is to use a low power voltage reference in order to meet the imposed restrictions
of your project, a low voltage reference at very low power. For example the MAX6035, it can give a stable
2.5V draining less than 100µA of battery current and support Vin min=4.4V

Regards


Last edited by Humberto on Tue Nov 02, 2010 1:07 pm; edited 1 time in total
hmmpic



Joined: 09 Mar 2010
Posts: 314
Location: Denmark

View user's profile Send private message

PostPosted: Tue Nov 02, 2010 1:07 pm     Reply with quote

Hi

The problem is that the output from the sensor is not floating with VCC but give a stable linear signal.

I think the solution with a low drain ref. can be a choice. Ex MCP1525 cost 0,45$ and work from 2,7-5,5 output is 2.5V

Thanks for reply!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Nov 02, 2010 1:28 pm     Reply with quote

You didn't say what PIC you are using. If your PIC has it, you can use
LVD or HLVD. Here is an example program for the LVD (low voltage
detect) module:
http://www.ccsinfo.com/forum/viewtopic.php?t=24577
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