Chat freely about anything...

User avatar
By mflmartin
#36951 Hello,

I am thinking of a project where I would need to light up 20 leds depending on data adquired from an external api with an ESP8266-01.
How could I manage to control 20 leds individually ? ( I can not use a LED lcd or so, as, in my project, each led will be far away from the others and in "odd" positions).

Thanks :).
User avatar
By lethe
#36952 With an ESP-01 you only option is to use I2C I/O expanders such as the MCP23017 or PCF8575 (or PCA9685 if you need PWM dimming).

With ESP modules that have more GPIOs, there are more options like:
- charlieplexing basically comes for free, you can drive 20 LEDs using 5 GPIOs, but addressing the LEDs is a bit complicated. See https://en.wikipedia.org/wiki/Charlieplexing
- using 74HC595 shift registers. These are really cheap, easy to interface and can be driven at high speed using the SPI port.
User avatar
By mflmartin
#36955
Barnabybear wrote:Hi, if you can use WS2812 LEDs it's easy.
https://www.adafruit.com/category/168
https://github.com/adafruit/Adafruit_NeoPixel


Thanks,

As a matter of fact I ordered a bunch of independent Neo pixels a while ago, just to test things out. I am getting them tomorrow. But, with independent ones, would I be able to do this? Note that they are not chained one to another. For what I want to do (put leds in different places in a very big frame... maybe it's not an option no? (I am a complete newbie in electronics, so maybe I missed something).