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

Measuring temperatures


  • Please log in to reply
17 replies to this topic

#1 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 01 June 2011 - 10:51 AM

I'm looking for a simple way to measure temperatures with the Netduino to experiment with analog interfaces. It doesn't need to be 100% accurate, as long as I have stable readings.

I thought of two ways;
1. using a Negative Temperature Coefficient Resistor (I got one of 1kΩ at 25°c)
2. using a LM335 Precision Temperature Sensor

Offcause I can try to get it working, but before I reinvent the wheel, anyone has done something simular and/or can point me into the right direction?
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 01 June 2011 - 11:34 AM

The NTC is the simples way to measure the temperature, but it is far from being precise. We are using (still now maybe?) the LM335 sensor, and it is pretty good. In both cases you should provide a very stable and precise voltage reference. For high precision temperature measurement (i.e. -/+ 0.1'C), you should rely on PT100 probes. Essentially a platinum league having a very well-known behavior with temperature. Everything depends on what is your target. Cheers
Biggest fault of Netduino? It runs by electricity.

#3 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 01 June 2011 - 11:47 AM

For high precision temperature measurement (i.e. -/+ 0.1'C), you should rely on PT100 probes. Essentially a platinum league having a very well-known behavior with temperature.

I don't need high precision, I just want to have a very cheap solution.

Everything depends on what is your target.

Just to experiment

The NTC is the simples way to measure the temperature, but it is far from being precise.
We are using (still now maybe?) the LM335 sensor, and it is pretty good.
In both cases you should provide a very stable and precise voltage reference.


Do you have a schematic and perhaps a code sample? I guess I need to use the VRef-pin on the Netduino?
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#4 chizz

chizz

    New Member

  • Members
  • Pip
  • 3 posts
  • LocationPrestwick, Scotland

Posted 01 June 2011 - 12:45 PM

Might I suggest you take a look at the TC77
http://ww1.microchip...edoc/20092a.pdf
SPI interface stable and accurate and you can choose Celsius
or Fahrnheit.


Chic

I don't need high precision, I just want to have a very cheap solution.


Just to experiment



Do you have a schematic and perhaps a code sample? I guess I need to use the VRef-pin on the Netduino?



#5 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 01 June 2011 - 12:56 PM

Might I suggest you take a look at the TC77
http://ww1.microchip...edoc/20092a.pdf
SPI interface stable and accurate and you can choose Celsius
or Fahrnheit.


Hi chizz,

First post? Welcome to the Netduino community :)

Thanks for your suggestion! It looks like a very nice chip, going to check it out besides this experiment.
But I should state the goal of my experiment; to do some more advanced stuff with an analog input, instead of just using potmeters. That's why I came up with the two suggestions I mentioned in the opening post.
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#6 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 01 June 2011 - 01:00 PM

The schematic is trivial.
Basically you should use the NTC as a voltage-divisor. You have to connect another resistor R1 between the Vref and the analog input, then the NTC from this input to the ground.
The R1 value depends on the NTC characteristic: the manufacturer should give it.

After that you should measure the voltage on the input using the ADC.
Since the voltage on the input will have this behavior:

Vadc = Vref * Rntc / (R1+Rntc)
and the Rntc varies linearly(*) along with the temperature, you may write a C# function to obtain the desired value from the ADC read.

(*) within a range, usually around a point, typically 25'C

Hope it helps
Cheers

PS: we are using this probe very often. It is cheap, but with a limited precision.
Biggest fault of Netduino? It runs by electricity.

#7 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 01 June 2011 - 01:31 PM

I'm looking for a simple way to measure temperatures with the Netduino. It doesn't need to be 100% accurate, as long as I have stable readings.


There is the TMP35 / TMP36 / TMP37 sensors. These are analog sensors and give readings of 10mv per C for the 35 and 36 and 20mV per C for the TMP37. All three have different rabges - I have a couple of TMP36's but had the same problems as others in the Community - variable readings. I'm waiting to see what comes out of the analog investigations as at the time I only had the N+ - I may hook it up to the mini (and maybe the scope) and see if there is a difference. At least with the scope I can see if I get stable voltage - that will certainly point to the N+.

There is also a class available for the TMP102 breakout board in the foums here. This one uses the I2C bus.

Hope this helps,
Mark

EDIT: Just remembered - I hooked the TMP102 to the N+ and an LCD a while ago using the code from the forums.

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#8 chizz

chizz

    New Member

  • Members
  • Pip
  • 3 posts
  • LocationPrestwick, Scotland

Posted 01 June 2011 - 03:19 PM

First post indeed, thanks for the welcome, I'm sure i'll fit right in.

Just starting with netduino, though been doing embedded programming for ever
I am looking for some starter projects to get the feel of the netduino, I'll
mibbe just start on a TC77 I/F myself.

best regards

chizz



Hi chizz,

First post? Welcome to the Netduino community :)

Thanks for your suggestion! It looks like a very nice chip, going to check it out besides this experiment.
But I should state the goal of my experiment; to do some more advanced stuff with an analog input, instead of just using potmeters. That's why I came up with the two suggestions I mentioned in the opening post.



#9 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 01 June 2011 - 06:09 PM

tried several options but so far not much luck.

We are using (still now maybe?) the LM335 sensor, and it is pretty good.

Mario, any change you would be so kind to provide me a schematic for that sensor please? ;)
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#10 JonnyBoats

JonnyBoats

    Advanced Member

  • Members
  • PipPipPip
  • 155 posts
  • LocationPhillips, ME

Posted 01 June 2011 - 10:27 PM

Here are a couple of low cost sensors: http://www.adafruit....-sensor-extras/

#11 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 02 June 2011 - 04:19 AM

Stefan, today is holiday in Italy and all the schematics are in our lab.
Anyway, our schematics are pretty complex due to the precision requested.

According to the LM335 specs, the simplest circuit you may try is as follows.
(NOTE: refer to the last circuit shown at page 8)
Connect the LM335 from ground to the analog input of the Netduino;
Place a 10K pot in parallel (as the circuit shows);
Connect a 12K resistor from +15V to the analog input.

At this point you should adjust the pot so that the input will be +2.982V at 25'C (refer page 6).
That's all.

The only problem is that you cannot overflow the Vref limit, that is +3.3V.
Anyway just try this basic circuit, then we will make some improvement.
Cheers
Biggest fault of Netduino? It runs by electricity.

#12 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 02 June 2011 - 11:23 AM

The only problem is that you cannot overflow the Vref limit, that is +3.3V.
Anyway just try this basic circuit, then we will make some improvement.
Cheers

So I actually have to put a 15V power supply in the cirquit of my netduino? Not impossible, but I don't want to damage a netduino :) Is it actually safe to do it that way?
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#13 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 02 June 2011 - 11:40 AM

Stefan, you DO NOT have to feed 15V to the board. Anyway, to be sure, you may add a diode from the analog input to the +3.3V. The ring drawn on the diode body must be connected to the +3.3V. In this way, any accidental overvoltage will be limited by the diode, that "discharges the overflow" on the 3.3V line. Remember that you feed from the +15V with a 12K resistor. In the worst case, the current cannot exceed 1mA. Cheers
Biggest fault of Netduino? It runs by electricity.

#14 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 02 June 2011 - 11:57 AM

Hmm I found this schematic on two Arduino-based sites: https://sirleech.wor...o-and-lm335-11/ http://www.arduino.c...=1204583768/7#7 but as a newb as I am, I don't know which pin is what :) The LM335 had 3 pins, which one is what...
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#15 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 03 June 2011 - 02:57 PM

Hmm I see a new wiki page in development: http://wiki.netduino...emperature.ashx I think I'll wait for Dan to finish that page :D
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#16 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 03 June 2011 - 06:21 PM

Hmm I found this schematic on two Arduino-based sites:

https://sirleech.wor...o-and-lm335-11/


This is exactly the circuit I meant: it is the basic circuit suggested by the LM335 specs.
Cheers

PS: the specs show what are the legs also.
Biggest fault of Netduino? It runs by electricity.

#17 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 12 June 2011 - 02:55 PM

Cool, the schematic and code from this thread works: http://forums.netdui...sb-protoshield/ Didn't found that one before ;)
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#18 Mark H

Mark H

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts
  • LocationPerth, Western Australia

Posted 13 June 2011 - 07:05 AM

National also make the LM60 (and similar) series of sensors. They are extremely easy to use and reasonably accurate.




With 6.25mv/C, and a 424mv offset to 0C... you just need to take the ADC port value in milivolts (3300/ADC value) and subtract 424, then divide by 6.25f to get your reading in celcius.

// gain = 6.25 mV/Deg C 
            int mv = sensor.Read() - 424; // 424mv = 0 

            return mv / 6.25f;





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.