You are welcome! That's the idea of the forum, help each other!
Ioannis
thank you all for all your responses. I think i have all the info that i need and now have to do some experiments.
sam
I measure negative voltages accurately without any external active components.
All you have to do is connect a resistor from Vref to the A/D input pin, and another resistor from that A/D pin to the voltage to be measured.
For example: To measure -12V, I use a National 4.096V reference on RA3 and a 2K resistor from that pin to the A/D input I want to use. From there, I use a 7.5K resistor to the voltage to be measured.
The code then loops 19 times and adds the results of the conversions (for averaging). The result is then subtracted from 15360. The answer is in tens of millivolts.
I have used this technique for years with good results.
Charles Linquist
Hi Charles. Yeap, this is the superposition theorem. I really forgot about it. Too many years ago...
Clever though.
Ioannis
Hi Charles:
That is exacly what i was looking for. do you have any formulas as to how to calculated different resistor values and to know how much offset you have and what not.
thank you
sam
You build a voltage divider from Vref. For example:
If you are trying to measure a -5V (full-scale) voltage and you have a 5V reference:
Build a voltage divider with a 4K resistor from Vref to the input of the A/D and another 4k from that pin to the voltage to be measured (the INPUT).
If the INPUT voltage is at "0" volts, the A/D pin will be at 2.5V (or 512 counts if you are using a 10-bit A/D).
At -5V input, the voltage at the A/D pin will be at "0" volts.
So, to obtain a reading, run the converter and SUBTRACT the count from the "0" voltage input reading (512) and scale the result.
If you still need more help, I can show you some more.
Charles Linquist
Bookmarks