Pages: [1] 2   Go Down
Author Topic: Maximum cable lengths for Dht22 and TMP36 Sensors  (Read 6740 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

This is my first post here and I'm afraid I'm a beginner at this stuff.

Got myself an Arduino Uno R3 a few weeks ago and have gradually got up and running with the above two sensors, a 16x4 LCD displaying the humidity and Temperature and an ethernet shield connecting the Arduino to my network. I'm now working on the logging and streaming of the data.

My main question though is how long can the cables be on these sensors. I need to run them at a minimum of about 12 meters. Is this possible?

My other question was about the TMP36 sensors. I have 4 of them and they are all off what I would consider to be correct by about 10 degrees (i've got two commercial thermometers that I consider correct). I've adjusted the offset in the code to fix this but i've used the same code I've seen many examples of online (for TMP36). Is this normal?

Appreciate any help.
Sam.
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
My main question though is how long can the cables be on these sensors. I need to run them at a minimum of about 12 meters. Is this possible?

For the TMP36 definitely not, for the DHT22 probably not.

The TMP36 is an analog sensor and this signal will take up lots of electrical noise even if the cable is only 1 or 2 meters. You won't get a usable value with long cables even if you put some caps in place to filter out some of the noise.

The DHT22 uses a digital protocol to transmit it's sensor data, so it's much more immune to taking up electrical noise but for 12 meters of cable you probably need a differential signal as RS485.

One possible solution is to take an additional Arduino, put it near the sensors and connect the two via some MAX485 chips (RS485 drivers).
Logged

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11694
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why won't the TMP36 work with a long cable?  So long as you filter out the noise (100nF or more across the output at the Arduino end?) it should do pretty well at DC! (temperature readings are effectively DC really!).  Induced noise is not DC, its AC, and will be short-circuited by the capacitor. 

You'd do best by running two signal wires (signal & signal-ground) and two power wires (power & ground), and measure the voltage difference of the signal wires at receiving end.  Add another 100nF capacitor between signal-ground and ground at receiving end.   That way power supply current isn't introducing IR voltage into the signal wires.  I reckon you'd get a reasonable results over a good distance.

For logic signals the faster the switching the shorter the cable needs to be (unless you go to a transmission line).  So 12m is really going to be a issue here.  In general you need to choose a lower signalling frequency for longer cable runs and condition the signals at the receiving end.  Or move to a differential transmission line like RS485 (although this is power-hungry).
Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To be able to set the DC, we need to charge capacitance at the load (including parasitic).

If wire (i.e., cable: signal and gnd wire)  is long, eventually we have pretty large capacitance associate with this;
Even before considering noise induced due to the long wire, we need to use a sensor that is strong (more precisely, strong driving capability).

So, we need to build some sort of driving circuitry to assist sensor to send data.
If digital data go through the cable, we will have robust data against noise.


Datasheet says
Although the TMP3x family of temperature sensors can drive
capacitive loads up to 10,000 pF without oscillation, output
voltage transient response times can be improved by using a
small resistor in series with the output of the temperature
sensor, as shown in Figure 35. As an added benefit, this resistor
forms a low-pass filter with the cable capacitance, which helps
to reduce bandwidth noise. Because the temperature sensor is
likely to be used in environments where the ambient noise level
can be very high, this resistor helps to prevent rectification by
the devices of the high frequency noise. The combination of this
resistor and the supply bypass capacitor offers the best protection.

Logged

UK
Offline Offline
Full Member
***
Karma: 1
Posts: 129
mini mini mini
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You might be better off using another micro at the remote end, it will allow the sensor wire lengths to be very short. You can then process the data and send it using serial down the 12 meter cable, preferably using RS485.

More work yes, but it will be very reliable.

The other thing to consider of course, the DHT22 has a temperature sensor built in.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the detailed responses. Got a lot to consider now.

Beige, the DHT22 is certainly an option, are you saying you think this would be easier? I don't care if I need to buy new sensors. I'd rather not have to buy more micros.

I'm looking to be using 12 sensors in a small room divided in two. The cables will have to run on the ground but will then run up the walls to the eventual reading points.

If I wanted to keep the cables short, I would need 5 or six arduinos. I can do that if necessary but was hoping to go for something cheaper.
Logged

Sussex UK / CT USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1028
Forums forever
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The Dallas 1-Wire devices (DS1820, etc) will repay study if you want 12 sensors in the room.

They will need to be daisychained, not connected via a star topology... but just three wires from host, to sensor0, to sensor1....

For rapid development, you may want to start this project with a PC rather than an Arduino, as host... but once various things ironed out, the Arduino could be "trained" to do the work.

Very non-trivial... but 12 sensors in inherently non-trivial, and a little work to get started with 1-Wire will repay you with years of being able to do many fun, or at least useful, things.

The following is mine, a mish-mash of imperfect early efforts and more recent, more informed articles....

http://www.arunet.co.uk/tkboyd/e1didx.htm

===
In the Arduino world, we often just put a single sensor on an Arduino pin, and thus get around the issues of "addressing" ONE of several chips on a MicroLan. You can, in theory, "talk" to many (100?) 1-wire chips... temperature sensors and more... using just one Arduino pin... but to do that, you have to master "advanced" 1-Wire concepts, beyond those used by Arduino/1-Wire users.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a lot tkbyd. That's really helpful to me and it looks like your content is a great place to start.

Appreciated.
Logged

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

On the DHT22 transmission distance question, 20m according to this document http://cdn.shopify.com/s/files/1/0045/8932/files/DHT22.pdf?100745

I have one operating quite OK over 25m of CAT 5 cable

Logged

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

Hello
I´m quite new to arduino.
I was also wondering of max cable lenght....
so I made program which read from data pin (of same dht22) to two different pins of arduino. Wires to one pin were short to other pin were connected through 60m of UTP.
temperatures were same....
Sorry for my english, it´s not my first language

PS: for pictures DOLGE_ ZICE means long wires, kratke zice/short


* rht03_beschriftet.jpg (117.49 KB, 732x636 - viewed 597 times.)

* temp2.png (102.5 KB, 646x910 - viewed 341 times.)
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

thanks akaj9!

60 Meter is a very nice distance!
(and your English is OK too! what is your native language? Slovenia?
« Last Edit: September 25, 2013, 01:43:26 pm by robtillaart » Logged

Rob Tillaart

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

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

@robtillaart
Yes my native language is slovenian. How did you assumed that it is?
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

@robtillaart
Yes my native language is slovenian. How did you assumed that it is?
DOLGE  ZICE kratke => into google translate autodetect mode => smiley-wink
Logged

Rob Tillaart

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

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello
I´m quite new to arduino.
I was also wondering of max cable lenght....
so I made program which read from data pin (of same dht22) to two different pins of arduino. Wires to one pin were short to other pin were connected through 60m of UTP.
temperatures were same....
Sorry for my english, it´s not my first language

PS: for pictures DOLGE_ ZICE means long wires, kratke zice/short


Thank you ... Thank you very much akaj9...
I've tried anything but nothing works....
With your picture, I can reach 150m of UTP Cat 5E.

You save my life !!!! LOL...
Thank you akaj9
Logged

Wales
Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I'm looking into which humidity sensor I should use for my project and the DHT22 looks to be an option. (http://forum.arduino.cc/index.php?topic=240219.msg1723308#msg1723308). The sensors are located up to 10m from the Arduino.

Do I understand from previous posts here that the the DHT22 signal can be transmitted 60m+?

Thanks

Ron
Logged

Pages: [1] 2   Go Up
Jump to: