LED wired to GPIO in an unconventional way

 This is my answer to SE EE question LED wired to GPIO in an unconventional way?

My answer

You can drive a LED (more precisely, a network of LED and resistor in series) in three possible ways:

  1. From the side of the anode (the cathode is grounded). Then high input voltage will light up the LED. The current will exit the upper transistor of the output and go through the LED to ground. 
  2. From the side of the cathode (the anode is connected to Vcc). Then low input voltage will light up the LED. The current will exit Vcc, pass through the LED and enter the bottom transistor of the output.
  3. From both sides (both anode and cathode are connected to outputs like a bridge circuit). Then only when there is high input voltage at the anode and low input voltage at the cathode, the LED will light up. The current will exit the upper transistor of the one output, go through the LED to and enter the bottom transistor of the other output. Simply speaking, the current will flow between the two outputs. This configuration was widely used in the so-called "dynamic LED indication".

Comments