lots of DS18B20 temperature sensors

Status
Not open for further replies.

Baptistou

Member
Hello,

I'm working on a project where I'll use numerous DS18B20 temperature sensors. About 100 of them in series on one single Teensy board.
Those are using the OneWire protocol which is quite handy for project integration. They can be powered either by their data wire (phantom power), or a dedicated power line.
As I'll have a lot of them I'll be using the dedicated power line.

I wonder if someone would have advice though on which Teensy I should use.

The DS18B20 can be powered either at 3.3V or 5V, but as I'll have many of them in series over long wires (up to 10m), would it be preferrable to use 5V instead of 3.3V ? If so, then I guess the Teensy 3.2 would be recommended, as it's the only one which is 5V tolerant ?
If 3.3V is OK, then any Teensy would be suitable, such as Teensy LC or Teensy 4.0 ?

Any advice / feedback will be welcome.
 
With any microcontroller, 100 of these sensors connected to a single data line with 10 meters of wire is a recipe for terrible problems. It really doesn't matter which Teensy model you use. None of them will really help.

You'll probably run into 2 types of problems.

#1: Too much capacitance will slow the signal's rise time. Using a 1K resistor instead of the normal 4.7K will help, but only by a factor of 5 (or 4.7). Most of the capacitance comes from the wire you use.

#2: Long wires tend to pick up noise from radio signals and other electromagnetic interference. Really bad noise can corrupt the signal. But even moderate noise which doesn't cause data loss (which you can often detect by CRC errors) can stress the microcontroller pin and shorten the chip's lifespan. Using shielded wire helps, but (usually) increases the wire's capacitance. There are circuit techniques you can use to also try to protect from noise induced on the wire, and those also may impose some limits on how quickly you can drive the line.

There are a number of things you can do to mitigate these problems to some degree. But the bottom line is these sensors and the microcontroller pins simply are not designed for connecting 10 meters of wire and 100 devices. There are chips designed for this, like RS485 transceivers, but those are designed for serial protocols, not this 1-wire protocol, so usually a small microcontroller is needed at each device. If you look at industrial controls and building automation systems, they're almost always built using those sorts of transceiver chips, because it is the reliable way to do this sort of thing.
 
Hi Paul, thanks for those elements.

I'm working on a solar self-takeoff sailplane (see picture below), and one of the concern is the temperature of the wings. Usually, wings of sailplanes are white, but here with the solar cells on top, dark, the wings will heat under sun. I want to keep control over their temperature (so that the wingspar keeps its mechanical strength), therefore I molded about 100 DS18B20 everywhere in the wings when we built them. There are actually 4 arrays of 25 sensors : 2 per wing.
When we cured the wings in an oven I've been able to monitor all 100 temperatures with a single arduino Mega board, and only 2 digital IOs (one per wing). The board is 5V though, and I guess that 5V systems will be less affected by ambiant noise than 3.3V systems (am I right ?). The wires were also slightly shorter than what they will be in the glider's fuselage.

Thinking again of it, and with all the elements you mention (microcontroller lifetime...), I'm thinking that I may put a "Teensy relay" in the wings : a Teensy LC (or Teensy 3.2) in each wing with with IOs for each sensor lines, to keep only 25 sensors per line & wire length < 6m, outputting data as RS232 to my main Teensy 4.1 system in the fuselage.

Thanks again for your useful advice !

IMG_1940 petit.jpg
 
As one data point I've used 20 DS18B20's on a single bus happily from a RaspPi, but the bus was only about
5m long, and every sensor had its own decoupling capacitor, parasite power mode was not used, and 4k7 pullup
resistors at both ends of the bus.

I'd strongly advise against parasite power mode for anything like this.
 
Status
Not open for further replies.
Back
Top