Go Down

Topic: Trying to understand pull-up resistors (Read 2 times) previous topic - next topic


I am melting my brain trying to understand a very simple pull-up resistor configuration. I think I'm making this harder than it is.

Here's how I'm trying to think through this. Some or all of this may be wrong.

First off, my understanding of how at least part of this system works, is that sensor pin 2 is switched on and off internally by the sensor. The rest of my "understanding" is based on that, so if that's wrong, then it's all wrong.

* The pull up resistor ensures that when sensor pin 2 is switched off (disconnected) from arduino pin 3, arduino pin 3 still sees a small, consistent amount of current (from +5v) to keep it from floating. The resistor is called a pull-up resistor because the resistance it provides increases the voltage between the +5v output and arduino pin 3.

* When sensor pin 2 is switched on (connected) to arduino pin 3, arduino pin 3 sees a higher amount of current and a lower voltage (from sensor pin 2), because of the lack of resistance (as compared to running through the 4.7k ohm resistor).

Is that much correct?

FWIW, I think I have found the following documents to be helpful, but I'm certainly still not sure of myself.


Thanks so much for any help.


Your totally wrong here the DS18B20 is one wire the resistor is used to hold the line high when the chip is not sending data.

The ardunio send out a call for the DS18B20 and it send back that its on the line after is sees that the Line is high it sends data. Then when the line is high the ardnuio can send to the DS18B20 what it wants if it needs to set the chip or just let the chip tell how hot or cold it it is.


Hi Vdavidoff,
Here a link of the DS18B20 datasheet.

Open it and search for 'resistor'. They explain in an easy way (at least for me) how the pullup resistor works for this specific sensor.
It is important to know that the pullup resistor has also a leading role in electronic concepts like totem-pole and three-state. Regards


Think of it this way -

A transistor is just a switch. A silicon switch instead of a mechanical switch, but a switch all the same.

When the switch is turned on the input and output are connected together and it the input is conected to +V the output will be at +V also. If the input is connected to Ground then the output will be at ground also.

Now = turn the switch off. What state is the output? Don't Know, it is FLOATING. So we add a pullup or pull down resistor so when it is not active we are making our input go to a known state.

So - if our switch is connected to ground (low side switching, common for simple transistor switches) we use a pull-up resistor so when the switch is open the input to our device is at +V. If our switch input is at +V then our resistor will be tied to ground for a pull down resistor.

The resistor is there so when our input device is in its inactive , or off state, our input will be at known state. Things just work more rliably that way.


The way the OneWire bus works is that the data line is a wired-AND gate.  Only if every device lets the line go HIGH, will it be HIGH.

Any device that pulls the line LOW will mean its LOW everywhere.  Only if no devices pull it low will it go HIGH, and that is due to the pull-up resistor.

For this to work devices never _actively_ pull the line HIGH, only the resistor does that, and it can only do it if nothing actively pulls it low because its weaker than active pull-downs (which will be something around 30 to 300 ohms or so).

The OneWire protocol is quite complicated and clever to use this wired-AND to be able to communicate with many devices and identify them all uniquely, all from one signal wire.
[ I won't respond to messages, use the forum please ]

Go Up