- Thu Mar 23, 2017 12:17 pm
#64142
Yes, quite so. It's been a long time since I posted that query here but the explanation is quite simple. Unlike the Arduino, the D1 (and other ESP8266 boards) will SINK current (to ground) rather than SOURCE current to flow through an LED (for example) to ground.
So you have to supply the current from a 5v source (say), via the device you are powering, and then let the ESP8266 switch the other side of the device to ground.
I don't like that arrangement because there must be a (very small) resistance between the pin and ground so that side of the device might not be truly grounded - a few millivolts potential difference might exist between the device "GND" and the real GND.
But, despite my reservations it works OK if you can remember what the D1 is doing. Try it with another LED connected to one of the pins (look underneath the board to get the real GPIO pin number) and then connect the anode (long lead) to +5v via a 180 ohm resistor. It works as it should.
I occasionally mention this in my YouTube videos as it's easy to forget (
https://www.youtube.com/c/RalphBacon)