View Single Post
 
Old 05-25-2010, 12:30 AM
John_K John_K is offline
Silver Member
 
Join Date: Jul 2008
Posts: 548
Thanks Bit's

Quote:
Originally Posted by Bit's-n-Bytes View Post
First you must set up a voltage divider. Let's say the desired voltage of the battery is 12.5 Volts. You will need the voltage divider to present you with about 2.5 volts so a resistor value of 10k and 22K works pretty well. Once this is set up correctly, @12.5 volts the chip will see 2.5 volts on the pin you have selected for the ADC input. On the attached drawing, pin 0 is the pin sensing the voltage divider, so your command in the chip will be "ReadADC 0, Volts" (or whatever variable you choose). If your were to look at the value of "Volts" in this case, you would see that the value is 127. In the digital world, an ADC pin see's values from 0 to 255. This is why you set your voltage divider at half scale so you'll be able to read the voltage swing from about 10.5 to 15.5.

Hope this helps.

Bit's
Hey Bit's,

Thanks for the tip and the pic, I'll try this on my PICAXE too.

Sorry I haven't been posting much, but I'm still working on variations of the TS every now and then when I get an idea.

Would your circuit work for sensing capacitor voltages instead of battery voltages? Any mods needed?


John K.
__________________
 
Reply With Quote