Go Down

Topic: DS18B20 temperature sensor power (Read 1 time) previous topic - next topic

baptistou

Hello,

I am using several DS18B20 temperature sensors from Dallas. They are quite handy as they are calibrated internally and the communication is digital, through a 1 wire bus.
They can be powered either by a +5V on their power pin (external power mode), or they can steal the power from the DQ (comms) pin (parasite power mode). In parasite power mode, the +VDD pin must be attached to DQ pin.
I use the Dallas temperature library.

As I have several DS18B20 on the same digital line (10 in total), I would like to power them in normal mode. I've put 5V on the VDD pin, however when launching the program (examples from the Dallas temperature library), the log informs me that the power mode is "parasite mode".

Most of the time I can get the temperature values OK, but sometimes I have misses, and I suspect this comes from the fact that 10 sensors are working in parasite mode on the same digital line.

How can I have the DS18B20 to work in "external power mode"?

If anyone has a clue, I'd be happy to hear of it!

Cheers

Baptistou

terryking228

Hi,
The external power mode is often used.

See the info and examples on this page: https://arduino-info.wikispaces.com/Brick-Temperature-DS18B20

Do you have 5V on Vdd and a pullup resistor of perhaps 2700 ohms to Dq? 

See the info on that page about longer cables and many DS18B20's..
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

baptistou

Hi Terry,

Yes I've read all that, and I have 5V on the Vdd pin and a pullup of 4.7k between Vdd & Dq.

Has anyone had experience with the examples given Dallas library where at setup in the log it says "Parasite power is OFF (example sketch "Dallas_Temperature -> Multiple")?

Cheers

el_supremo

The way that the library detects parasite power is to issue a "Read Power Supply" command to the onewire bus, to which parasite powered sensors will respond by pulling the bus low and non-parasite sensors will leave the bus as it is. So if any one, or more, of the 10 sensors pull the bus low, the library assumes that ALL the sensors are parasite powered. But in your case none of the sensors should be pulling the bus low, so there's a wiring or other problem with the way that the 10 sensors are connected.
Try what @terryking228 suggested with the 2.7k pullup. But if it doesn't work I would then try a 2.2k or even a 1.5k pullup resistor. If that doesn't work, check your wiring very carefully to make sure that none of the sensors' Vcc are somehow connected to ground instead of the +supply. As I mentioned above, if even one of them is grounded, the software assumes that they all are.

Pete

Don't send me technical questions via Private Message.

terryking228

Quote
The way that the library detects parasite power is to issue a "Read Power Supply" command to the onewire bus, to which parasite powered sensors will respond by pulling the bus low and non-parasite sensors will leave the bus as it is. So if any one, or more, of the 10 sensors pull the bus low, the library assumes that ALL the sensors are parasite powered. But in your case none of the sensors should be pulling the bus low, so there's a wiring or other problem with the way that the 10 sensors are connected.
I didn't know/remember that. I'll add it to troubleshooting notes on ArduinoInfo.Info

Thanks..
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Go Up