"I have 8 LEDs, each measuring 5mm, with specifications of 1.8-2.2v and 20mA. I want to control them using an ESP8266 NodeMCU board with I2C communication.
I purchased a PCF8574 I/O expander and connected it to the 3.3V output from the ESP8266 NodeMCU.
I connected one leg of each LED to the PCF8574 and the other leg to the GND.
However, the brightness of the LEDs is very low, and I can't even see them properly. When I connect the LEDs directly to the NodeMCU with 3.3V and GND, the brightness is significantly higher."
is there another solution to controll 8 led diodes from SCL SDA
someone suggested to connect led to 5v with resistor and use BC547B as NPN transistor , is this a good way or there is better solution
there are so many LED driver ICs - why not just select one IC which is made to drive LEDs?
Just to name a view - available as maker friendly breakout boards to play with:
HT16K33, I2C, up to 128 LEDs in a matrix/display SX1509, I2C, 16 LEDs, pwm, blink, breath, keypad ... MAX7219, SPI like, up to 64 LEDs in a matrix/display TM1637, proprietary on two lines, up to 48 LEDs in a matrix/display, keypad,
There are many calculators online where you give in a few parameters and they say what series resistor you need for a specific led.
example: LED Series Resistor Calculator | DigiKey Electronics.
Important is that you don't exceed the current rating of the Arduino pi. You may need some information from the data sheet of the LED.
Yes.
It turns out that is about 150Ω. That gives you the full 20mA, but these days, with modern more efficient LEDs, that is normally too much current, and will be quite bright. So you can easily half the current or more. I normally use 470Ω or 510Ω. But it is not too critical.