Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ADC on 16F877 to measure voltage

Status
Not open for further replies.

blackened69

New Member
hi

i was wondering how would i go about measuring the voltage of a battery powering a PIC 16f877 via the pic's ADC? i need to keep track of the battery's power and need to detect when the battery goes bellow a certainlevel (eg under 3 volts). from what i understand the 16f877's integrated ADC can be used. can i set thins up so no other power source is needed to keep a reference voltage. I just wanna have one battery and wanna detect when its below a ceratin level.......


thnk you all
 
I think this might be a problem...

The pic requires a reference voltage for it's ADC, these negative and positive references will be used to compare against the measured signal.

so you need a stable voltage to be used as a reference for the adc, if you want to measure the battery powering the pic, then the reference voltage will drop along with the measured voltage... The ADC will report a full battery every time...
 
Do you need to measure the voltage level (e.g.: 4.8V) or is it enough just to know when a voltage level reaches a certain treshold (e.g.: falls below a certain level)? If that is the case, then you can use a comparator that would output HIGH when voltage falls low enough...
 
just wanna know when a treshold is reached. will i need to use another IC (voltage comparator) or does the pic have such capabilities?
 
You may setup the F877's internal A/D converter to use VCC as reference. However, it is only as accurate as the VCC's value. That is, if the VCC has a tolerance of 10% (4.5V-5.5V), then the error of measuring @ 3V threashold is +/- 0.3V.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top