best way to switch multiple leds

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
GravityRZ
Normal user
Posts: 206
Joined: 23 Dec 2019, 21:24

best way to switch multiple leds

#1 Post by GravityRZ » 22 Feb 2021, 21:28

i want to switch multiple leds on/off seperately

this is mostly done by hooking up a led with a 220ohm resistor in series between a GPIO port and the ground.
When GPIO is 1 current will flow from GPIO to GND (Max current=12mA)
When you hook up multiple leds te total current need to be supplied by the ESP8266 chip which possibly gets warm.

would it not be a better way to hook up the led and resistor between +3.3V and GPIO.
This is way the current will flow from +3.3V through the GPIO when it is switched to 0
Also this would not limit the current to 12mA per led but would limit the total current to that of the voltage regulator

i would say the total current in the second situation is coming from the 3.3v voltage regulator instead of the ESP8266 chip

any thought on this?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: best way to switch multiple leds

#2 Post by TD-er » 22 Feb 2021, 22:42

That's exactly what's described in datasheets as the amount of current that can be sourced (ESP delivers power for the LED) or what a chip may "sink" (just redirect current to GND)

Sink current of an ESP8266 is about 20 mA, source current is about 12 mA (per pin)
See: https://bbs.espressif.com/viewtopic.php?t=139

GravityRZ
Normal user
Posts: 206
Joined: 23 Dec 2019, 21:24

Re: best way to switch multiple leds

#3 Post by GravityRZ » 23 Feb 2021, 20:19

thanks.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 39 guests