# Thoroughly confused about open drain

I've been reading a tutorial on open drain and I'm thoroughly confused.

First, the terminology makes little sense. How can a resistor pull up or pull down current when its job is to resist current? When I look at a schematic of an open collector, the resistor appears to prevent a dead short to ground.

Second, when the MCU outputs a signal through its pins, it turns on or off the transistor at the base which is interpreted externally as an input signal, but it's unclear how the MCU interprets a signal as an input. It seems as if the signal enters the pin and immediately flows right out to ground. What is responsible for intercepting and interpreting the signal before it burrows its way into ground?

Finally, the tutorial claims the voltage being pulled up or down can be higher than the 5V or 3.3V voltage rating for the MCU, which is hard to grasp. Shouldn't 30V as mentioned in the tutorial destroy the MCU? I've also read somewhere else that one-wire and I2C open collector busses can have devices operating at different logical levels. The tutorial claims the voltage can be "anything" and showed a 12V relay connected to the MCU. Does "anything" include the high voltage generated from the relay's coil when it's turned off? Their schematic doesn't have a flyback diode.

https://www.electronics-tutorials.ws/transistor/open-collector-outputs.html

• – CL.
Commented Sep 8, 2023 at 8:27

You are mixing context here. And it is unclear if you are confused with open-collector or just resistor being called a pull-up, but they both together make a system so they can't be thought in isolaton.

Your MCU or other chip can have an IO pin in open-collector mode. That's why I2C bus with chips are limited to 3.3V or 5V.

You can have a circuit with say a discrete transistor and some load like a relay, and the relay can be operated at 24V.

Nevermind what the load is, a pull-up resistor on I2C bus or a relay on a transistor, if the transistor is "off", no current flows in the load, and therefore, there is no voltage difference over the load, so that's why both ends of a pull-up resitor can be at 5V or both ends of the relay can be at 24V.

The point is that when transistor is "on", it will connect the load at collector to ground, and thus current flows via load and then there is 5V over the resistor or 24V over the relay. But when the transistor is turned "off" no more current flows and the load pulls the voltage of the collector that is "open" to supply voltage.

How can a resistor pull up or pull down current when its job is to resist current?

The switching transistor has either a very high or very low resistance compared to the pullup.

The whole concept is only useful when you have more than one output. This way the signal can only be high if and only if all switching transistors are turned off.

Careful: Example circuits may omit otherwise required parts for clarity. That is why the relay has no freewheel diode.

High voltage open drain circuits are rare - I²C is the most common use case, which typically does not need external transistors on modern MCUs.