Pages: [1]   Go Down
Author Topic: wrong values ​​of tmp36 when used with an Ethernet sheild and arduino  (Read 1154 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello
I'm new to the forum.

I started a "weather stations project'' with 2 Arduinos, 2 Ethernet sheilds, 2 tmp36 temperature sensor, and software MAx / Msp to display sensor data with the osc protocol.

pending delivery of the tmp36 sensor, I managed to make it work, using photocell sensor, think it would have the same behavior as the tmp36, communication between sensor, Arduino, Ethernet and scheild Max / msp no problem. However, when I tried to change the photocell sensor by tmp36, values ​​was completely erroneous data without any visible reason.

I wanted to retest only the tmp36 on arduino, playback will do very well and I do not understand the behavior of the sensor.

why the values ​​of tmp36 are wrong when used with an Ethernet sheild and arduino?

note that I have two identical systhème on the same patch Max / Msp but two different serial port because I do a temperature reading at 2 different places.

Moreover, I wanted to put more sensors on each arduino and it also gave erroneous value

Do you have any ideas?

thank you in advance for your help

emmanuelle
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Welcome on the Arduino forum,

Quote
why the values ​​of tmp36 are wrong when used with an Ethernet sheild and arduino?
The formulas assume a steady 5V power supply. If this is 4.5V the thing will work but readings will not be accurate.

Can you tell what values you expected and what you got?
How do you power the system? USB/ battery/other?
Can you post your electric schema?

Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

0
Online Online
Shannon Member
****
Karma: 200
Posts: 11688
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds like you have ground currents flowing in the sensor circuit, causing offsets that add/subtract from the sensor value.

It is vital to separate ground-return paths for the sensor and the high-current parts of your circuit (the ethernet shield consumes a lot
for instance).  Find out which pin(s) the ethernet shield is using for its ground supply and if possible use a different ground connection for
the TMP36.

Alternatively connect both sides of the sensor to analog pins and take the difference in readings - the ground side of the sensor
should read 0 of course, but if there are errors due to IR voltages in the ground path then you'll be correcting for this error.

And of course there may be errors due to the supply rail dropping too.  Perhaps use the 3.3V to power the sensor and AREF pin, then
use analogReference (EXTERNAL) in the setup() function (remember to change the code to compensate)
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 1
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi

for robtillaart:

Can you tell what values ​​you expected and what you got?

Here are the data:
there is an increase in temperature due to the fact that I heat the sensor fingertips.
16.41 degrees C
0.65 volts
14.94 degrees C
0.68 volts
17.87 degrees C
0.67 volts
17.38 degrees C
0.69 volts
18.85 degrees C
0.67 volts
17.38 degrees C
0.67 volts
17.38 degrees C
0.71 volts
21.29 degrees C
0.71 volts
21.29 degrees C
0.72 volts
22.27 degrees C
0.72 volts
22.27 degrees C
0.74 volts
24.22 degrees C
0.74 volts
24.22 degrees C
0.74 volts
24.22 degrees C
0.74 volts
24.22 degrees C
0.72 volts
22.27 degrees C
0.74 volts
23.73 degrees C
0.75 volts
25.20 degrees C
0.73 volts
23.24 degrees C
0.75 volts
24.71 degrees C
0.76 volts
26.17 degrees C
0.76 volts
26.17 degrees C
0.73 volts
22.75 degrees C
0.74 volts
24.22 degrees C
0.75 volts
25.20 degrees C
0.76 volts
26.17 degrees C

they are not super stable but it illustrates the reality.

I add a ceramic capacitor in parallel with only one sensor and the arduino and values ​​are much more stable than that.



How do you power the system? USB / battery / other?[

I use a 5v dc supply, 1 A, I do not use the USB cable for the arduino and the sensor will be a 250 'of the computer.

Can you post your electric scheme?

I started with this tutorial:
http://learn.adafruit.com/tmp36-temperature-sensor/overview

Here is the datasheet:

http://www.analog.com/static/imported-files/data_sheets/TMP35_36_37.pdf

for MarkT

indeed, the tmp36 is sensitive to electrostatic waves. I test by adding a ceramic capacitor 0.1 uf without Ethernet scheild and values ​​are more stable. I have not tested the Ethernet scheild. I wanted to make the circuit of Figure 32 of the datasheet because it is suppose to help stop interference, but I do not understand how to connect the circuit to the wire ... because it has only 3 pin and 2 wire ...

are you'd do?

In any case, thank you all 2

Emmanuelle
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


The measurements reflect a correct formula.

you can improve the stability by averaging multiple readings too. works a bit like this.

Code:
void loop()
{
  int value = 0;
  for (int i=0; i<8; i++) value += analogRead(A0);
  value /= 8;

  long mVolt = value * 5000 / 1023;
  float temp = (mVolt - 500) /10.0;
  //....
}

Voltage supply should be higher, see - http://arduino.cc/en/Main/ArduinoBoardUno - The recommended voltage is 7-12V, the limits 6-20V. 
A 5V dc adapter is too low so the reference voltage for the analogRead() is to low too.

Rob
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Pages: [1]   Go Up
Jump to: