Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Analog reading accuracy


  • Please log in to reply
9 replies to this topic

#1 Miha

Miha

    Advanced Member

  • Members
  • PipPipPip
  • 94 posts

Posted 27 November 2011 - 01:36 PM

Hi!

I'm currently using KTY 11-6 temperature senzor to read temperature from using ND+. What I am currently doing is making a series of measurments and averaging them, because I'm otherwise getting different reading of temperature on each read.

How I've setup the sensor:

3V3+ ---- [KTY 11-6 temp senzor] ---- | ------ [3300 Ohm resistor] ----- GND
                                      | 
                                      | 
                                 [ND Analog input]

Im calculating resistance using voltage divider formula and then calculating temperature using alpha and beta values for this sensor.

I'm retrieving 15 samples and then averate out the final reading. But even after 15 readings, the temperature reading error is 0.3 degrees C. Increasing number of readings to 50 reduces error to 0.1 C.

Is there anything I could do to get more consistent voltage/resistance readings from analog input?

Miha

#2 Stefan W.

Stefan W.

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts

Posted 27 November 2011 - 02:30 PM

Did you try the usual methods to stabilize the voltages, like in http://highfieldtale...highfieldtales/ - connect aref to 3v3 via a inductor, use a (fast) capacitor between aref and ground and a "big" one between 3v3 and ground?
I believe that no discovery of fact, however trivial, can be wholly useless to the race, and that no trumpeting of falsehood, however virtuous in intent, can be anything but vicious.
-- H.L. Mencken, "What I Believe"

#3 Miha

Miha

    Advanced Member

  • Members
  • PipPipPip
  • 94 posts

Posted 27 November 2011 - 02:38 PM

Did you try the usual methods to stabilize the voltages, like in http://highfieldtale...highfieldtales/ - connect aref to 3v3 via a inductor, use a (fast) capacitor between aref and ground and a "big" one between 3v3 and ground?


Hi Stefan!

No, I didn't (I'm mostly clueless about electronics :(). I'll re-read the article you linked and buy some capacitors and try this out. Thanks!

Miha

#4 Miha

Miha

    Advanced Member

  • Members
  • PipPipPip
  • 94 posts

Posted 27 November 2011 - 03:38 PM

Did you try the usual methods to stabilize the voltages, like in http://highfieldtale...highfieldtales/ - connect aref to 3v3 via a inductor, use a (fast) capacitor between aref and ground and a "big" one between 3v3 and ground?


So I connected 3V3 to Aref and my readings are much better. Now, the deviation is 0.04 degrees C. Wow! Seeing how that capacitor and inductor make it even more reliable, my questions are:

Should I use the values outlined in Mario's post? I'm not sure how to connect those things together. Is this the correct way?

3V3+ ---[220uF capacitor]-- [temp sensor] ---- | ------ [3300 Ohm resistor] ----- GND
  |                                   | 
  |                                   | 
[47uF]--GND                      [ND Analog input]
  |
  |
[1mH inductor]
  |
[AREF]

Thanks,
Miha.

ps: the local IC shop has this kind of capacitor: TANT 47uF 16V 20% R2,54 (among others). I don't understand all of the data -- is this the type of capacitor I should use? (even though it says 16V?)

Edited by Miha, 27 November 2011 - 03:49 PM.


#5 Coding Smackdown

Coding Smackdown

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationLewisville, TX USA

Posted 27 November 2011 - 03:38 PM

Did you try the usual methods to stabilize the voltages, like in http://highfieldtale...highfieldtales/ - connect aref to 3v3 via a inductor, use a (fast) capacitor between aref and ground and a "big" one between 3v3 and ground?


Stefan,

That is a really good article, I never realized how much noise was going on. Being pretty rusty with electronics do you have a sample schematic that shows what your final solution was to filter out the noise?

Thanks,

Jim Lavin
Brewing Award Winning Beer with a Netduino!
http://diybrewery.com

#6 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 27 November 2011 - 04:04 PM

Hello guys, and thanks for the article.
I attach here a simple example on how to connect the components.

@Miha: the capacitor of the shop is okay...
TANT 47uF 16V 20% R2,54
^ ^ ^ ^ ^
tantalum capacity max.volt tolerance lead spacing

As I pointed out in the article, when you deal with analog measurements, you should avoid to power the Netduino (i.e. the whole circuit) using the USB. However, you may use it during the debugging, for practical reasons.

Another question to remember is toward the Ethernet: if you don't have or don't plug the Ethernet cable, the noise is much lower.

Finally, I performed the test using my Netduino Plus, which is the first revision (rev. A). If you take a look the current schematic (rev. B), there's a greek-pi filter (how do you call it?) on Aref.
To know what is your board revision, take a look at the corner of your board, just near to the "Analog IN" inputs.

Hope it helps.
Cheers

EDIT: I used those components value, because I had in my box. I don't think they are critical at all.

Attached Files


Edited by Mario Vernari, 27 November 2011 - 05:10 PM.

Biggest fault of Netduino? It runs by electricity.

#7 Miha

Miha

    Advanced Member

  • Members
  • PipPipPip
  • 94 posts

Posted 27 November 2011 - 04:32 PM

Hello guys, and thanks for the article.
I attach here a simple example on how to connect the components.


Mario, thanks for the schematic. I see mine is wrong. How would I connect my temp sensor then? I have a REVB board.

At the moment, where deviation in temp reading is around 0.03C, I've connected the temp sensor as per attached schema. Where should I put 220uF capacitor? If it helps, the fritzing schema is available here:http://dl.dropbox.com/u/163584/vezava.fz

Even though my ND+ is RevB (and I'm not using ethernet), there is a big difference in accuracy when AREF is connected to 3V3.

Thanks,
Miha.

Attached Files



#8 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 27 November 2011 - 05:05 PM

How would I connect my temp sensor then?

You don't need to change your sensor connection, you can use Mario's circuit exactly as it is shown and just move your Aref (blue) wire.

#9 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 27 November 2011 - 05:09 PM

Even though my ND+ is RevB (and I'm not using ethernet), there is a big difference in accuracy when AREF is connected to 3V3.

Wow, interesting!
It means that the filter added on the RevB boards isn't enough.

Well, since in your case the load (i.e. the current involved) is very low, the best thing is to take the +3.3V, filter it with the L-C pair, then power both the Aref and the probe.
This should let you gain a bit more of stability.

Capacitors.
The tantalum capacitor are not common as the electrolytic.
Whilst the electrolytic are cheaper, they are (internally) built using a very long metallic films wrapped around, *really* tight (but insulated). This "wrapping" as long as the length of the conductors (the film), causes a parasitic inductance. And not so low as expected!
The tantalum are totally different: it's a kind of "sponge" (really can't call it differently!), thus there's no parasitic inductance...we may say that the capacitor is actually a capacitor!

NOTE: I always remember some "strange" behavior about the capacitors, electrolytic and tantalum.
AVOID reversing the polarity, especially when the current involved are enough (above 100-200mA), the capacitor may overheat and sometime explode.
any capacitor has a max voltage indication labeled: always keep within this range. You may reach the limit without any worry, but -as before- the component may overheat, and explode.

In the high school, a friend of mine, who accidentally reversed the polarity of a electrolytic cap, almost lost an eye. The overheat shot the metallic cap as a bullet on his forehead.
However, even a blade can kill a man, but we can't miss to cut our steak!

Cheers
Biggest fault of Netduino? It runs by electricity.

#10 Miha

Miha

    Advanced Member

  • Members
  • PipPipPip
  • 94 posts

Posted 27 November 2011 - 05:44 PM

...
However, even a blade can kill a man, but we can't miss to cut our steak!


So true! :)

Mario, CW2, thanks for the pointers and schematics. I'll try to purchase the components during the week and I'll report back if it makes a difference. I'll test with external power supply (although I don't know whether it is switched or "regular") as I also use GSM modem with ND which requires more current than USB can provide.

Miha




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.