pic 16f684 a to d

Status
Not open for further replies.

jkmadsci

New Member
Ive used the a to d many times before, but im about to make a project using a battery(6volts) and no regulator. What is the cheapest easiest way
to get a refrence voltage to measure battery voltage?
 
Well i guess im gonna answer my own question. I took an led with
a 3k resistor and found that the voltage on the led varied between 1.83 and 1.87 volts as the supply varied from 3 volts to 7 volts. i guess ill hook up the led to a to a pin(high) and read the voltage on the led with an adc pin. Then all i need to do is back calculate my input based on the led ref voltage.
 
Iy you connect your LED to the 6V line and a 1n4148 (or any small diode) to the LED and then your series resistor to gnd. By measureingthe voltage at the resistor/1N4148 junction you should get between 0.5V and 4.5V. The voltage will be Vcc - LED voltage -Forward voltage of 1N4148.

= 6 - 1.8 - 0.7 = 4.5
= 3 - 1.8 - 0.7 = 0.5

HTH

Mike.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…