Pinout.xyz icon indicating copy to clipboard operation
Pinout.xyz copied to clipboard

One Wire includes 4.7kΩ resistor requirement

Open perkinslr opened this issue 4 years ago • 2 comments

The Pi has an internal 1.8kΩ pull-up resistor available on any of the GPIO pins. While the Dallas One Wire protocol calls for about a 5kΩ pull-up resistor, it also allows up to 5.5v drive. The Pi at 3.3v will recharge the signal line at 1.8mA instead of 1.2mA, but still well within tollerances for the One Wire protocol in any sane setup.

There's an article available on using the 50kΩ internal resistors on Arduinos that goes into the specs of the protocol, which are fairly loose. The more devices, the higher the capacitance of the one wire system, the lower the resistance needs to be on the pull-up resistor. (50kΩ is low enough to drive about a dozen typical temperature sensors at 1m or less of 20 awg copper cable).

Anyway, the claim that you need exactly a 4.7kΩ resistor has been running around websites with one-wire information for years. It would be nice if one of the most prominent places people go to find information mentioned you don't need it.

perkinslr avatar Jan 31 '21 03:01 perkinslr

I have to admit- I've connected one-wire sensors in the distant past directly to the Pi's GPIO pins without any additional resistors- I'm not sure where this information originated.

It's basically just parasitic power, right? I've seen sensors which call for a 3.3v supply power themselves from the i2c bus intermittently (albeit not very usably) so I'd expect the intentional effect would have quite a range of tolerance.

I'll have a go at re-wording.

Gadgetoid avatar Oct 26 '21 21:10 Gadgetoid

AFAIK the 1.8kΩ pull-up resistors on the Pi are only available on the i2c (GPIO 2/3) pins, and not all pins?

Typical pull-up is 50kΩ to 65kΩ which is documented here - https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#general-purpose-io-gpio

Gadgetoid avatar Oct 26 '21 22:10 Gadgetoid