Firefox:
They (the electronics world) call it an Output!! but if you google Open Drain the explanation is that it can only Sink current or present a High Impedance so it cannot output anything.
The Output definition is very confusing.
I think the confusion comes with equating the term "High Impedance" with the term "Input". The problem comes from making the term "High Impedance" a metaphor for Input. Yes, an MCU input typically has a high impedance (relative to a typical output) (FYI: there are low impedance inputs, such as a 50 ohm RF input, but that rarely applies to an MCU -- in fact, I can't think of a case). But that doesn't mean that ONLY inputs can present a high impedance.
A common drain (or common collector) output is merely an output that only "pulls low". In other words, when low, it has a low impedance, and when high it has a high impedance. The reason is simply that the output is literally the drain (or collector) of a single transistor. When the transistor turns on, the output presents a low impedance to ground. When the transistor is off, the output is a very high impedance, also to ground. One way of looking at it is this: a transistor, when used as a switch, is like a variable resistor that has two values: very low, and very high. Because the resistor is always connected between ground and the output, that resistance is always to ground, no matter if it is in its high resistance state or its low resistance state.
Why do such a thing? Mainly to translate voltage levels. The transistor drain (or collector) is tied to a different voltage than the voltage the MCU is running at. This can be used to convert, for instance, what would otherwise be a 5V output, to a 3.3V output. This is done by running the MCU at 5V, but tying the drain (or collector) output to 3.3V through a resistor.
Let's say we use a 2.2k resistor. When the transistor turns off, the output will have a very high impedance to ground, and a 2.2k impedance to 3.3V. The 2.2k resistor is, essentially, in parallel with the very high impedance to ground (via the very low AC impedance of the power source), thus the total impedance will, for all practical purposes, be 2.2k. When the transistor turns on, the output impedance is very low to ground, thus the output will be 0V, or nearly 0V. Once again, because this very low impedance is in parallel with the 2.2k resistor. Nearly 0 ohms paralleled with 2.2k will be no more than nearly 0 ohms, because the total resistance of resistors in parallel is never larger than the lowest resistance value of the two.
Another application is to translate to a higher voltage. For this to work, the MAX drain to source (or collector to emitter) voltage must be as high or higher than the voltage being translated to (and probably should be at least 1.5 times the voltage being translated to, for immunity to spikes and surges and such). Here's an example of this: MCU voltage: 3.3V. Voltage we want to translate to: 5V. Open drain output tied to 5V through a 1k resistor.
Another example: Say you want to turn on and off a series string of LEDs using an MCU running at 3.3V. A regular output would drive from around 0 volts, to around 3.3V (when an output must sink or source appreciable current, typically there is some voltage lost in the driving transistor, thus an output driven low, might be more like 0.4V and an output driven high, might be more like 2.8V--depending, of course, on how much current is flowing through the drain-source junction (or collector-emitter junction)). If our string has 4 LEDs and each LED drops around 3.2V, that adds up to 12.8 volts! An output that can only go as high as 3.3V will never be able to turn on those LEDs. But, lets say you have an MCU with outputs that can be configured as open drain, and suppose that output transistor can handle up to, say 20V. We could, simply, tie the cathode side of that string of LEDs to the open drain output, and, through an appropriate resistor, tie the other end of the string to the positive end of a 16V supply. Now, when the output transistor turns on, it connects the cathode end of that string to ground, and it lights up. When the output "goes high" (i.e. the transistor turns off), the turned off transistor presents a hugely high impedance to the cathode end of the LEDs, thus no current flows through the LEDs and they go dark!
FYI: when I say "through an um-tee-um k resistor" what I mean is, one end of the resistor is connected to the open drain output, and the other end it tied to the voltage being translated to. The output is, then, of course, taken from the side of the resistor that connects to the open drain output.
FYI2: It's an "output" because, for one, nothing is inputted to the MCU, and two, it is either driving the load to ground, or allowing the load to float--in other words, the load, on the output, is manipulated.
FYI3: technically, you could get away with driving that LED string with an open-drain output with a MAX drain to source voltage lower than the voltage used to drive the LEDs. Why? Because, the LED forward voltage will protect the MCU output from an over-voltage condition. Say the minimum possible full current forward voltage for these LEDs is 3.0V (as stipulated in the Datasheet). The minimum total voltage would be 4 x 3.0 = 12.0V. If using a 16V supply to drive those LEDs, the highest (under load) voltage the MCU output will ever see is: 16V -12V = 4V. So, technically, you could get away with using an MCU with output transistors capable of handling up to 5V. BUT, be dang sure the power supply will always be a rock solid 16V and if one of the LEDs shorts out, you don't mind a catastrophic failure in the MCU. Bottom line, such practices can cut costs, but are risky!