Sigma-Delta ADC
W9GFO
Posts: 4,010
My ADC is giving me these values;
0.00v = 8191
1.31v = 7166 ???
3.28v = 10549
4.42v = 12743
5.34v = 14547
6.05v = 16030
How do I figure out a formula so that I can get accurate voltage readings? It is not linear like I thought it would be. They are better now that it is rewired.
Rich H
Edited to add yet another data point
Post Edited (W9GFO) : 5/27/2009 4:01:25 PM GMT
0.00v = 8191
1.31v = 7166 ???
3.28v = 10549
4.42v = 12743
5.34v = 14547
6.05v = 16030
How do I figure out a formula so that I can get accurate voltage readings? It is not linear like I thought it would be. They are better now that it is rewired.
Rich H
Edited to add yet another data point
Post Edited (W9GFO) : 5/27/2009 4:01:25 PM GMT
Comments
V-IN goes to Pin 16 via a 332k resistor,
there is a 100k between Pins 16 & 17,
102 caps going to ground and 3.3v.
Rich H
-Phil
Sure! It's an object from the Obex with very minor changes.
Rich H
Edited to replace wrong copy of code...
Post Edited (W9GFO) : 5/27/2009 3:06:51 AM GMT
Rich H
I considered them to be non linear because I could not find a coefficient that worked for the entire range.
Since I made the changes these are the readings I get;
The three middle ones seem reasonable to me but I am not getting the range expected. Also, now that I have wired it up "correctly" the readings are much less steady. Before they would vary +- ~ 10, now it is +- 100. To get a useable value I am averaging 500 readings.
According to the calculator here the 332k resistor should give me up to a 7.1v range. Is it normal that it is so far off? I checked the values of resistors before soldering them in. They were 331k and 101k - pretty close - that changes the range to 7.05 v. Still, not close to what I am seeing.
Also, shouldn't the ground value be closer to zero? It is nearly halfway up the scale at 14 bits.
Rich H
Post Edited (W9GFO) : 5/27/2009 4:17:29 PM GMT
On reason that the calculations can be off is that the digital threshold is not precisely Vdd/2 and can vary from unit to unit. Also, ground won't be near zero. Think of it this way: with "Analog In" at ground potential, what voltage has to be present on fbpin to leave adcpin at Vdd/2?
You could revert to your divider again, and add a 330K or larger resistor from the common node to ground. That may help to center your range a little better.
-Phil
Remember that the response is symmetrical around the Prop threshold (nominally 1.65 volts). So 1.65+5.4 = 7.05 V and on the low end 1.65-5.4= -3.75 V. Ground should not be zero, but indeed the expectation is that it would be lower than your result.
If you adust your analog input slowly until you find half scale (count=8192 at 14 bits), then that voltage is the effective Prop threshold, which will not be exactly 1.65 volts. Your results suggest that the effective threshold is lower, and the whole range is shifted downward.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ain't gadgetry a wonderful thing?
aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
I don't mind it not being centered, just need it to measure up to 7 volts. A larger resistor should work right? Maybe around 500k?
Is it normal that it is shifted downward? I wonder why it would be like that. Using the Prop's ADC may be adding extra challenges that I don't need. I'm working on a project for Gadget Gangster where one feature is to be able to display battery voltage. With such variations in values from the ADC, and no option for the kit builder to change the code, it may not work to do it this way.
I suppose I could create a 'setup' menu where the ADC is calibrated, saving the value to EEPROM - but I haven't done that sort of thing yet.
When using the Prop's ADC to measure a non-changing voltage, what deviation in values is to be expected? With 14 bit resolution the numbers are varying by 100 each way, just want to know if that is common.
Rich H
Voltage to be measured goes through the resistor in the middle of the picture then through the red jumper and to pin 16. The 100k resistor joins pin 16 and pin 18.
Post Edited (W9GFO) : 5/30/2009 4:58:54 AM GMT