multiple DS18B20 sensors

gtslabs

Member
Using a 28x1

I want to read a bank of 8 DS18B20 's. I see they pull 4 ma each.
If I ganged all the Vss together I would be pulling 32 ma I assume.

Can I tie this directly to the Vdd +5v and have it not affect the Picaxe 20ma requirement?
I would leave it on all the time.

The alternative would be to assign an output pin to each sensor and turn them on and off sequentially. But then I would not have any more output pins left.

I am using this as a model:
http://www.anotherurl.com/therm/schematic.htm

Thanks
Steve
 

hippy

Technical Support
Staff member
Using a 28x1 I want to read a bank of 8 DS18B20 's. I see they pull 4 ma each. If I ganged all the Vss together I would be pulling 32 ma I assume.
Frankly I cannot see how you would make your system work if you did not have all Vss's (GND/0V) ganged together

Can I tie this directly to the Vdd +5v and have it not affect the Picaxe 20ma requirement?
Yes, current drawn from Vdd does not come from or pass through the PICAXE and your regulator should be able to cope with the 32mA.

That's how I'd do it. All DS18B20 Vdd to +5V, all Vss to 0V and separate I/O lines from the PICAXE to each DS18B20.
 

lbenson

Senior Member
To do something similar I recently used a 74HC595 output expander. This allowed me to use 3 output pins on a 18X to individually supply power to 8 sensors, four of which were DS18B20s. I tied all the DS18B20 data lines together and used a single pull-up resister and a single input pin. This worked fine for me, but I await the critique of more experienced forum members about possible problems. I only read the sensors once every 20 minutes, so I didn't want them to be always on.
 

inglewoodpete

Senior Member
Although I haven't tried it, Ibenson's idea has merit. You may want to consider the 74HC138 (1-of-8 demultiplexor) instead of the 595. It should be commonly available. The 138 can only activate 1 output pin at a time (what you want) and also saves on the serial-out routine required for the 595.
 

MORA99

Senior Member
I did the same thing recently with a 74hc4051, also a 1-8 multiplexor one port at a time.
Each ds will need its own pullup.
Its controlled with 3 output pins, each representing 1,2,4 in binary
 

lbenson

Senior Member
>Each ds will need its own pullup

Mora99--were you using separate input pins, one for each ds? I ganged the data lines together and used a single pullup on a single input line. I don't have the experience or theory to say that this would necessarily work, but I tried it and it did for my tests. Is there reason to suppose that problems might occur in the long run? In particular I wondered whether the "parasitic" powering feature of the ds might cause problems (not that I have looked into that feature, so I am lazily trying here to rely on the experience of others).
 

MORA99

Senior Member
I used the multiplexor to select the data line, the sensors were always powered (Because I make all sensors do converting at the same time and then read them).

So 3 output pins to control which port, 1 input pin to read the sensor, and permanent power to the sensors.
 
Top