temperature-sensor with robust digital interface (long distance wiring 20 meters)
StefanL38
Posts: 2,292
Hi,
I would like to measure the temperature"distribution" in a room with 10-20 sensors.
So this means that the wires from sensors to datalogger are 2-20 meters long.
That's the reason why I want to use sensors with build-in digital interface.
But maybe for these big distances (20meters) there are even not all temperature-sensors with digital interface
suitable.
I want to keep things simple. Best thing would be no need for shielding of the interfacewires.
Just a double- or tripple-wire with no shielding mounted on the wall or ceiling with adhesive tape
I don't need much precision and resolution 1°C or 0,5°C will do.
Which interface would you recommend? I²C (LM75) or 1-wire (DS1820)?
Is a SPI-interface driven at a low busspeed (1 kHz) more robust?
Are there certain limitations to wire-length?
Would something like a MCP3208 (SPI) combined with a semiconductor analog temperature-sensor like KTY-81
with a two-point-calibration (0°C and 30°C) and linear interpolation deliver a precision of 1°C?
thank you very much in advance for tips or shared experiences
best regards
Stefan
I would like to measure the temperature"distribution" in a room with 10-20 sensors.
So this means that the wires from sensors to datalogger are 2-20 meters long.
That's the reason why I want to use sensors with build-in digital interface.
But maybe for these big distances (20meters) there are even not all temperature-sensors with digital interface
suitable.
I want to keep things simple. Best thing would be no need for shielding of the interfacewires.
Just a double- or tripple-wire with no shielding mounted on the wall or ceiling with adhesive tape
I don't need much precision and resolution 1°C or 0,5°C will do.
Which interface would you recommend? I²C (LM75) or 1-wire (DS1820)?
Is a SPI-interface driven at a low busspeed (1 kHz) more robust?
Are there certain limitations to wire-length?
Would something like a MCP3208 (SPI) combined with a semiconductor analog temperature-sensor like KTY-81
with a two-point-calibration (0°C and 30°C) and linear interpolation deliver a precision of 1°C?
thank you very much in advance for tips or shared experiences
best regards
Stefan
Comments
Do you intend to run a cable to each Sensor, from the main controller ?
Yes, more length equals more capacitance, and usually more ringing.
There is also another class of sensor, those with PWM outputs.which do not have complicated protocols.
A part like the TMP06/TMP05 from ADI even mentions a Daisy Chain mode, that may make your wiring easier ?
I know Brian Riley and MJB both love their 1-wire temperature sensors networks, and it works for them, even over quite a distance. However I can't see the sense in using an ADC such as the MCP3208 with an analog sensor. Besides the fact that the MCP3208 costs more than many micros with 12-bit ADCs (with internal voltage reference!) there are plenty of cheap micros with on-board temperature sensors that you can use to create your own digital temperature sensing network. You could essentially run asynchronous over a single wire where each chip has it's own address, much like we do with RS-485. If you were running great distances then I would allow for RS485 on the board but since 1-wire passive pullup networks work fine then low-impedance source/sink will work even better.
So using cheap micros as digital temperature sensors means you could run 3 cores (probably twisted pair phone cable) in multidrop mode to power and communicate with all the sensors. You only need a single Prop I/O and I would probably protect the I/O on the Prop and micros with a simple resistor of around 220R.
I would definately recommend the DS18B20 as I have been using them reliably for over 12 months, to do something not unlike your requirements. I have five sensors connected on a single, 2 conductor 'bell wre' about 20 metres long. This is one of those enjoyable projects where the datasheet is clear, the protocol simple, the devices very cheap and accurate to 1/16 degree, and if all the instructions are followed - just works.
I think its something that would suit a newbie (not implying you are!) because it is different enough to require a data sheet, but not so difficult as to have you doubting your sanity. Rather than use some one elses object, do all the bitbanging from scratch and roll your own...
Have fun.
Dave
thank you very much for your answers.
Hi Peter,
years ago I was playing around a little bit with Amtel AVR-micros. Then I discovered the propeller-chip and use it for all projects.
So I'm not familiar with all the other µC-lers and their onbaord-features.
Can you give an example which micros has an onboard temperaturesensor?
Another micro for me is only an option when coding the firmware is pretty easy.
Pretty easy for me means something simple like setting up the PropellerTool
Start setup.exe - install driver - start coding - download through a standard USB-2-serial interface - done
I don't want to configure tool-chains. Is there something that simple on the market?
I rather pay 3-5€ per sensor than hassling around with a toolchain to use 1-2€-MCUs
best regards
Stefan
So this means that the wires from sensors to datalogger are 2-20 meters long.
That's the reason why I want to use sensors with build-in digital interface.
But maybe for these big distances (20meters) there are even not all temperature-sensors with digital interface
suitable.
What about Volts? eg LM35 and 3 wires to each sensor. I've done this and found you do need a low pass filter as the three wires pick up a bit of mains noise when large loads turn on and off nearby, but one resistor and one capacitor will fix that.
There are many solutions, analog, and digital (I2C, RS232, RS485, SPI etc). It is easy to ask how they work, but a harder question is to ask how they fail. For instance, analog fails because voltage spikes get onto the wires, and so you solve that with a filter. I'm not sure I2C and SPI handle voltage spikes. Flourescent tubes can be terrible for introducing hash and spikes onto exposed wires.
Analog eg LM35 with a local voltage follower eg CA3140 might be very old-skool but also may be more reliable.
hm - I have some MCP3208 laying around. LM35 has an output-voltage of 10mV/°C
at 2,048mV Ref-Voltage this would mean 10mV/°C / (2048mV / 4096) = 20 digits / °C?
Would you amplify the outputsignal of 2-300mV by a factor 10 or leave it as it is?
Where would you connect the voltage-follower? near to the sensor or near to the central unit?
I have some LM358 laying around. Would the LM358 suit as voltage-follower too?
best regards
Stefan
Well I do like to use Silabs 8051 chips as they are simple, fast, well equipped, and I can write most of this stuff as simple assembler using any one of dozens of assemblers. What's more I can load the code into it via the Propeller too so it makes it very easy to get into. Most of them have built-in ADC and temperature sensors and precision internal oscillator and uart of course. This is one I found in a simple SOIC-16 pack for less than $1 in one offs. I'm sure there are also AVRs that would also do something similar. I will look. But either way the assembly code is a piece of cake, the hardware absolutely minimal, and the flexibility is liberating.
thank you for your suggestions.
I'm not asking that you should do it for me (yet). I'm just asking how long would it take for you as an experienced 8051-coder to code a firmware that does:
Send it a small request-byte-sequence like "T=?" <LF><CR>" and the 8051 will answer with something like "T=20,4°C"<LF><CR> at 115200 baud?
I would prefer DIP-packages.
best regards
Stefan
I am using 30 (that's all I have atm.) DS18B20 on a single Prop pin.
You can hardly find a simpler/cheaper solution.
1-Wire with Peter's Tachyon and my additions for NW scanning (you find on the Tachyon thread).
If you read the 1-wire spec, the NW can be really huge (100's of meters).
You can also simply daisy chain them. Just 2 or 3 wires around the room.
I use them for my underground thermal storage and floor heating and ...
I use those:
just search ebay for DS18B20 you find lot's of preconfectionated sensors in stainless steel,
water tight sealings.
Markus
You could modify one of those, to do what you need.
SO16N is the nearest Silabs get to DIP
Keep in mind small MCUs are cheap and flexible, but their Temperature Sensors are usually uncalibrated, and even after single point calibrate, are only of moderate precision.
What calibration match do you need over what Temp range ?
http://forums.parallax.com/showthread.php/99043-For-Sale-Again!-WBA-TH1M-Sensirion-SHT11-Temperature-Humidity-Sensor-Module?p=695422&viewfull=1#post695422
http://www.aestheticacoustics.com/SHT11_01.htm
I don't do much advertising, but still make and sell the modules (same goes for my PowerTwig and M44D40+ modules, even though those threads are stagnant.). I currently have a good amount of SHT11 and SHT15 sensors, so if you were interested in taking that route, shoot me a PM to discuss what kind of a deal I could do for you with the modules as a 20 piece order.
One of the problems that you will have with I2C is not so much the line length as it is doable but addressing 20 units on the same line. A lot of the responses while fine for one or two sensors etc have been totally missing this point. I am using a HDC1000 humidity/temperature sensor in a new design and it has 2 sub-address pins so that you can have 4 devices on a bus, and by using the old trick of swapping SCL and SDA you can get another 4 on the bus. I suppose it's possible then just to have 3 separate I2C buses configured this way and they could be used but it's not as elegant as a multidrop bus with micros as sensors. BTW, I would allow for an external temperature sensor for the micro in case you need better results.
Then again, the 1-wire sensors work well and are proven.
Peter, that is true, however, the Sensirion sensor does not use a standard I2C protocol and part of that means that the device does not have an address. Sensirion calls their tweaked version of I2C "Digital SBus".The 20 sensors would have to be segregated by either unique clock lines or unique data lines. When I set up an 8 Sensirion logger I used one data line for all devices, but each had their own clock line. My setup consumed 9 IO pins. To resolve any concerns about the time difference between readings, you can broadcast the command for taking the reading and then send the "read values" command one at a time.
Sensirion's newer module, the SHT21, does use true I2C so it would have the limitation you mention since all SHT21 devices have the same address.
But even proper I2C devices can have a common data or clock and be handled this way, it's just that the Sensirion devices lack an address so they aren't really I2C at all, just clock and data like SPI except they borrow the I2C start and stop condition to synchronize transfers instead of a hardwired chip select.
Either way it is not easy to address 20 sensors even with proper I2C.
Those DS18B20 sensors are about 1.5€uro @10pcs
http://www.ebay.de/itm/1-2-5-10Stucke-DS18B20-fur-Thermometer-WasserdichtDigital-Temperatursensor-/141543320545?pt=Mess_Pr%C3%BCftechnik&var=&hash=item20f4a3abe1
I can easily scan 50 sensors 1 time each second.
Impressive, and nice looking sensor packages.
How closely matched do you find the sensors ?
Are those results for sensors as shown - ie all in a bundle and at the same nominal temperature ?
( or is it a real installation result, with varying temperatures)
The numbers shown her are for two sensors, not all of them.
You can see first one is touched, then the other.
The matching looks really good.
I did not make a scientific experiment with all the sensors in a stirred hot bath -
but just having them lying on the floor as in the picture they (at 12bit = 1/16th °C)
are off 1 or 2 tics from each other.
I wanted to add here, that this requires seperate power to the sensors, since when I run the conversion, which takes ~750ms @12bit,
of all sensors simultaneously for speed, then the parasitic power is not sufficient. (not sure if this is really true, or if a really active pullup would do it on the signal line ... RTFM).
Polling them one after the other on parasitic power (only 2 wires) did work.
So you see 1-Wire is not really true ;-(
For measuring a single sensor at a time it is possible to do this with parasitic power and only 2 wires.
The program needs to provide a strong pullup for the conversion time.
This has as consequence, that during this strong pull up time the data line is blocked and can not be
used to send commands to other sensors.
If there is a 3rd wire with power supplied it is possible to send the start conversion commands in rapid sequence to many sensors
and then read the answers after some wait time depending on the required resolution. (12bit = 750ms)
thank you all for your answers. I learned quite lot from it.
I ordered some 1wire and some I2C sensors for testing.
I tend to use 1wire-sensors.
Even if it will be in fact 2wires. I think it is still good.
With googling I found this tutorial that explaines 1wire
http://www.maximintegrated.com/en/products/1-wire/flash/overview/
I will watch these videos...
best regards
Stefan
Back in the day, the sensor of choice would be the AD590 or AD592 temperature transducer. The output is a current, 1 µA/K, so it can send its signal over one wire (plus a second wire for shared power), and its signal is immune to wiring resistance. It is easy to multiplex many sensors into one analog-to-digital converter. On the down side, it is not digital and can't be daisy chained. The individual AD592 costs around $3 these days unless you find them on a surplus site. On the up side, a setup build with these is possible to troubleshoot using nothing more than a multimeter.