Pages: [1]   Go Down
Author Topic: DS18B20 Temperature Sensor - 5v supply, 3.3v data?  (Read 395 times)
0 Members and 1 Guest are viewing this topic.
Derbyshire, UK
Offline Offline
Newbie
*
Karma: 1
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I want to read multiple DS1820 sensors using a Due. I have circuitry and sketch working happily on a Mega: but I wanted to check that it would be safe for my Due.

Clearly, the data pullup needs to be to 3.3v rather than 5v. But there are several suggestions that the Vdd for the Onewire network could be at 5v without problems because it has an "open drain" (beyond my expertise). Indeed, reading the Dallas paper on power requirements (http://pdfserv.maximintegrated.com/en/an/AN4255.pdf, it looks as if 5v would be far better for multiple sensors on reasonably long cabling if it is safe for the Due.

So, I tested my setup on my Mega, with 5v supply (well, 4.8 to be more accurate) on the Vdd pin and a 4k7 pullup to 3v3 on the data line.

The program runs fine on the Mega with a 3.3v pullup. But when I put a scope on it, the picture is less happy: the Onewire Data signal mostly oscillates between 0v and 3.3v but perhaps one peak in four goes up to 4.7v (screenshot at http://winster.org/DS1820mixedvoltages.png ). Same for several different DS18b20's.

With no DS1820 connected, the Onewire pin on the Mega sits happily at 3.3v so it doesn't look like any internal pullup issue: it does look as if there is some feedback of the 5v via the Onwire Data line.

Can anyone offer insights and recommendations?
Logged

Derbyshire, UK
Offline Offline
Newbie
*
Karma: 1
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Update on the unexpected 5v pulses on the Onewire Data line:

Using a Mega (Data on Pin 10 connected via 4k7 pullup to 3.3v) , with Onewire Vdd reduced to 3.3v, the Mega reads the DS1820 OK, but the scope STILL shows spikes of 5v. This can't be coming from the OneWire (which isn't getting a sniff of any 5v), so it must be some sort of intermittent pullup within the Mega - which makes me more confident to try the same configuration on the Due - where any internal pullup would be to 3.3v.

There is also a confirming quote attributed to DS1820 manufacturer Dallas  on this Raspberry Pi thread (http://93.93.128.176/forums/viewtopic.php?t=30359&p=266106):
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.

But I'd still like to understand why I see those 5v pulses, if anyone can help.
Logged

Pages: [1]   Go Up
Jump to: