albundy
Posts: 31
Joined: Tue Jul 17, 2012 4:56 pm

DS18B20 5V external power with 3V3 dataline

Sat Jan 19, 2013 8:29 pm

Powering the DS18B20 with 3V3 while using long lines doesn't seem to work well. The VDD pin of the DS18B20 drops below 3V.

Is it possible to power the DS18B20 VDD pin with 5V and use the pull up resistor of 4K7 connected to 3V3 and the dataline in order to keep the GPIO pin of the raspi at 3V3 max?
I believe the DS18B20 dataline uses some sort of open collector transistor or open drain mosfet to drive the dataline.

Using 5V as external power for the DS18B20 makes it possible to use longer lines while staying below 3V3 because of the open collector/drain dataline to protect the GPIO pin against overvoltage.

albundy
Posts: 31
Joined: Tue Jul 17, 2012 4:56 pm

Re: DS18B20 5V external power with 3V3 dataline

Mon Jan 21, 2013 3:45 pm

I asked the same question to the manufacturer. They replied:

Yes, you can make VDD = 5V and Vpullup = 3.3V. The Data line (DQ)
is open-drain so it can only go as high as the Vpullup voltage.

So it seems to be safe to connect the VDD of the DS18B20 to +5V and still keep the dataline at max 3V3 for the raspi.
This way it must be possble to use longer cables to connect the DS18B20.

User avatar
dentex
Posts: 180
Joined: Sun May 20, 2012 7:58 am
Location: Italy
Contact: Website

Re: DS18B20 5V external power with 3V3 dataline

Sat Jul 09, 2016 12:44 pm

Hello!
I asked a similar (basically the same) question in another post and received the same answer... so I may be happy with that.
But just out of curiosity, did you ever use the sensor like this? I'm away from my stuff and I can't try myself until tomorrow :mrgreen:
One of my projects with the Raspberry Pi:
--------------------------------------------------------
(Raspberry) Pi Aquarium Controller: https://github.com/dentex/piac
...and its dashboard: https://freeboard.io/board/O17ACD

User avatar
yv1hx
Posts: 372
Joined: Sat Jul 21, 2012 10:09 pm
Location: Zulia, Venezuela
Contact: Website

Re: DS18B20 5V external power with 3V3 dataline

Sun Jul 10, 2016 5:08 pm

Hi,

I used to have my DS18B20 operating with my RasPi continuously about a year and half gathering the ambient temp in the room while was installed my RasPi, with any glitches.

My line between the RasPi ant the temp sensor was about 30 ~ 40 cms, twisted wire, BTW be sure to use good quality twisted wire when connecting long runs of sensor cables.

Good Luck! :mrgreen:
Marco-Luis
Telecom Specialist (Now Available for Hire!)

http://www.meteoven.org
http://yv1hx.ddns.net
http://twitter.com/yv1hx

User avatar
dentex
Posts: 180
Joined: Sun May 20, 2012 7:58 am
Location: Italy
Contact: Website

Re: DS18B20 5V external power with 3V3 dataline

Fri Sep 09, 2016 5:54 pm

yv1hx wrote:Hi,

I used to have my DS18B20 operating with my RasPi continuously about a year and half gathering the ambient temp in the room while was installed my RasPi, with any glitches.

My line between the RasPi ant the temp sensor was about 30 ~ 40 cms, twisted wire, BTW be sure to use good quality twisted wire when connecting long runs of sensor cables.

Good Luck! :mrgreen:
Thanks for your answer.
Sorry for the long silence.
I forgot to "watch" the thread. ;)
I'm actually attempting to connect all the things for my latest project, lately, and I read again this thread.
One of my projects with the Raspberry Pi:
--------------------------------------------------------
(Raspberry) Pi Aquarium Controller: https://github.com/dentex/piac
...and its dashboard: https://freeboard.io/board/O17ACD

User avatar
yv1hx
Posts: 372
Joined: Sat Jul 21, 2012 10:09 pm
Location: Zulia, Venezuela
Contact: Website

Re: DS18B20 5V external power with 3V3 dataline

Fri Sep 09, 2016 6:35 pm

dentex wrote:
yv1hx wrote:Hi,

I used to have my DS18B20 operating with my RasPi continuously about a year and half gathering the ambient temp in the room while was installed my RasPi, with any glitches.

My line between the RasPi ant the temp sensor was about 30 ~ 40 cms, twisted wire, BTW be sure to use good quality twisted wire when connecting long runs of sensor cables.

Good Luck! :mrgreen:
Thanks for your answer.
Sorry for the long silence.
I forgot to "watch" the thread. ;)
I'm actually attempting to connect all the things for my latest project, lately, and I read again this thread.
No problema!

Good luck, please keep us posted..
Marco-Luis
Telecom Specialist (Now Available for Hire!)

http://www.meteoven.org
http://yv1hx.ddns.net
http://twitter.com/yv1hx

User avatar
dentex
Posts: 180
Joined: Sun May 20, 2012 7:58 am
Location: Italy
Contact: Website

Re: DS18B20 5V external power with 3V3 dataline

Fri Sep 09, 2016 8:11 pm

yv1hx wrote: No problema!

Good luck, please keep us posted..
Thanks mate! Much appreciated.

At this point, sorry if I dare ask... but I was trying to understand once and for all the relationship between 3v3 and 5v on the RPi...
and I came to the problem of having, i.e., an I2C-LCD screen powered with 5V and an i2C RTC clock powered with 3v3...

I asked something in: viewtopic.php?p=1035415#p1035415
...if you ever want to take a look.

Thanks again.
One of my projects with the Raspberry Pi:
--------------------------------------------------------
(Raspberry) Pi Aquarium Controller: https://github.com/dentex/piac
...and its dashboard: https://freeboard.io/board/O17ACD

Return to “Automation, sensing and robotics”