![Photo](http://www.gravatar.com/avatar/039e23208b5c91e51cdab04b109037ca?s=100&d=http%3A%2F%2Fforums.netduino.com%2Fpublic%2Fstyle_images%2Fmaster%2Fprofile%2Fdefault_large.png)
Analog input varying too much on temp sensor (LM335A)
#1
Posted 23 December 2010 - 03:18 AM
#2
Posted 23 December 2010 - 02:15 PM
http://forums.netdui...ch__1#entry3556
I even went so far as to get an external ADC (MCP3204) and still couldn't get it to work well. I came to the conclusion that something about the netduino is too noisy, or analog circuits are too hard.
That's when I switched to the DS18B20 digital temp sensor.
#3
Posted 24 December 2010 - 11:37 AM
#4
Posted 24 December 2010 - 06:44 PM
#5
Posted 26 December 2010 - 09:55 PM
#6
Posted 26 December 2010 - 10:21 PM
![:lol:](http://forums.netduino.com/public/style_emoticons/default/laugh.png)
#7
Posted 26 December 2010 - 10:26 PM
#8
Posted 27 December 2010 - 02:32 AM
#9
Posted 27 December 2010 - 02:56 AM
Shouldn't it always read 1023 (or 1024?) it its connected to 3.3V? my MM reads 3.29 most of the time and sometimes blips to 3.3 (its a VERY cheap MM though).
If you connect both AREF and A0 to the 3.3V header, you should generally get a consistent reading of "1023" on analoginput #0.
Do you have a "Rev A" or "Rev B" board? Netduino or Netduino Plus? When did you buy it?
If you connect A0 directly to GND, do you get a consistent reading of "0"?
Have you plugged AREF into any voltage higher than 3.3V? Or any of the analog references into a voltage higher than 3.3V?
Please note that the analog-digital converter on the Netduino is 10-bit, but it is not uncommon to lose 1- or 2-bits of accuracy with integrated microcontroller ADCs (for a variance of 2-4 on the 0-1023 scale).
Chris
#10
Posted 27 December 2010 - 05:06 AM
Rev A Netduino plus, bought it from amazon a couple weeks ago. The ones in this thread http://forums.netdui...pluses-on-sale/Do you have a "Rev A" or "Rev B" board? Netduino or Netduino Plus? When did you buy it?
Mostly zeros, but some 1's and 7's are in the data also.If you connect A0 directly to GND, do you get a consistent reading of "0"?
0
0
0
0
0
0
7
7
0
1
7
0
0
0
7
0
0
0
0
7
0
0
7
7
7
5
0
I do not believe so.Have you plugged AREF into any voltage higher than 3.3V? Or any of the analog references into a voltage higher than 3.3V?
Thanks for the information, that variance wont be that big of a problem, this is mostly an exercise for learning. But, it sounds like this should not be happening?Please note that the analog-digital converter on the Netduino is 10-bit, but it is not uncommon to lose 1- or 2-bits of accuracy with integrated microcontroller ADCs (for a variance of 2-4 on the 0-1023 scale).
Chris
#11
Posted 27 December 2010 - 05:26 AM
#12
Posted 27 December 2010 - 06:07 AM
WannaFly, what is your netduino sitting on? Are you using your rubber feet?
Does anyone know how to calculate what value you should see when given a certain resistance on an Analog Input.
-Valkyrie-MT
10K resistor on A0 with 3.3V AREF:
RAW Analog: 519
RAW Analog: 515
RAW Analog: 514
RAW Analog: 512
RAW Analog: 516
RAW Analog: 542
RAW Analog: 543
RAW Analog: 516
RAW Analog: 516
RAW Analog: 516
RAW Analog: 515
RAW Analog: 512
RAW Analog: 514
RAW Analog: 515
RAW Analog: 543
RAW Analog: 516
RAW Analog: 512
RAW Analog: 515
RAW Analog: 543
RAW Analog: 512
RAW Analog: 527
#13
Posted 27 December 2010 - 03:06 PM
#14
Posted 27 December 2010 - 04:22 PM
...unplug my network cable, i get VERY consistent 0's and 1023's.
Holy Crap! I see that too (samples every 1 second):
Raw: 1023 <- Start with Network cable unplugged
Raw: 1023
Raw: 1023
Raw: 1023
Raw: 1023
Raw: 1023
Raw: 1023
Raw: 1023
Raw: 1023
Raw: 1023
Raw: 1023
Raw: 1023
Raw: 1023
Raw: 1023
Raw: 1023
Raw: 1023
Raw: 1023
Raw: 1018 <- Network Cable plugged in!!!
Raw: 1023
Raw: 1023
Raw: 1021
Raw: 1022
Raw: 1023
Raw: 1020
Raw: 1021
Raw: 1023
Raw: 1023
Raw: 1023
Raw: 1021
Raw: 1022
Raw: 1023
Raw: 1018
Raw: 1023
Raw: 1020
Raw: 1022
Raw: 1023
Raw: 1018
Same sort of thing when I read from GND.
-Valkyrie-MT
#15
Posted 27 December 2010 - 08:55 PM
#16
Posted 02 January 2011 - 12:26 PM
Those are still pretty stable readings overall, but I wonder if there's a grounding/shielding issue with some network cables (and perhaps bursts of network traffic causing some fluctuation in the ADC/AREF readings)...
Chris
So what was the final solution to reducing the analog voltage reading variation? I am using the LM335 temp sensore and do not get a stable reading!
tony
#17
Posted 02 January 2011 - 10:02 PM
So what was the final solution to reducing the analog voltage reading variation? I am using the LM335 temp sensore and do not get a stable reading!
Question, how are you powering the NetDuino?
If via USB the drive voltage may be varying during your test sequence. I would suggest a repeat of the messurement with feeding 9 volts to the DC Jack.
#18
Posted 03 January 2011 - 04:01 AM
So what was the final solution to reducing the analog voltage reading variation? I am using the LM335 temp sensore and do not get a stable reading!
I was doing a moving average of 20 points (each point collected every second) before I noticed the variation. But to compensate for this a little better, I switched to a moving Median, so I bubble sort the latest 21 points and just take the middle (aka. median) because I have not seen a case where most of the points in a 21 point span look bad... I hope that makes sense.
-Valkyrie-MT
#19
Posted 03 January 2011 - 05:03 AM
Question, how are you powering the NetDuino?
If via USB the drive voltage may be varying during your test sequence. I would suggest a repeat of the messurement with feeding 9 volts to the DC Jack.
I am powering by USB for my testing, so I plugged in a 9V DC adapter and the variation is still present with the 9V adapter. I wrote the values to the SD card and here is a sample below... A0 connected to ground (column 1) and A1 connected to 3.3V (column 2):
7 1012
0 1023
0 1023
15 1023
0 1020
0 1023
0 1023
0 1014
0 1022
0 1021
0 1013
0 1023
15 1023
0 1023
0 1023
0 1016
-Valkyrie-MT
#20
Posted 19 February 2011 - 07:13 PM
The reading fluctuate wildly depending on what power source you're using. If I use the rear USB ports or the AC adapter I get much more stable readings (within ~1 degree). However, I agree with the post above that if I take the median of the last 20-40 readings I get a pretty consistent value between all power sources.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users