I have what is probably a very fundamental question about voltage.
I am using ESP8266 devices which are capable of producing 3.3V 12mA on the output pins. These pins can also sink up to 20mA.
The boards also have a 5V pin that can be used as a current source.
I can switch a single LED using the 3.3V pins as either a source, or a sink, using a 120 Ohm (or larger) series resistor.
If, however, I need to switch two LEDs in series using a single GPIO pin, I was wondering if I can safely source from the 5V and sink to a 3.3V pin.
If this represents the 5V source, 2 LEDs (with Vf of 2.4V each) a 20 Ohm resistor connected to the pin:
5V-------|>|----|>|---- [ R 20 ]-----GPIO
When I pull the pin LOW, I am thinking the LEDs will drop the voltage by 4.8V and the 20 Ohm resistor will allow 10mA to flow.
When I pull the pin HIGH the potential difference will be just 1.7V and will be insufficient to light the LEDs.
Q1: Is my logic correct that the circuit will only apply 0.2V to the pin when it is LOW, and therefore be within the 3.3V limit?
Q2: Will harm be done to the GPIO when it is pulled HIGH. I think no current will flow.
I have read that there is debate about the ESP8266 GPIO pins being 5V tolerant, but I want to ignore that for now because if the principle is true, then the logic may also allow, say, a 12V power source (with a common ground) to perhaps be switchable without using a MOSFET so long as the 20mA limit is not exceeded.
I am also aware of voltage shifters, but I believe they only handle logic level current and would not handle 10mA for the two LEDs
Thanks in advance.