# Drive a 4 bits 7 segments from ESP8266

After complex math and right wiring on my ESP8266, I finally light up my 4x7 segments display, one segment at a time. All the 4 selectors are connected to the 4 GND pins, so all four are lit up.

Do I need a MC or transistors to better select which display is lit up? Or is it possible with only the ESP8266 (I doubt)?

EDIT

Here is the schematic of the 4x7 segments display (source: https://osoyoo.com/wp-content/uploads/2017/08/cathnode.jpg)

And the NodeMCU ESP8266 (source: https://i2.wp.com/randomnerdtutorials.com/wp-content/uploads/2019/05/ESP8266-NodeMCU-kit-12-E-pinout-gpio-pin.png?ssl=1)

• It might work dimly, current-fan out would suggest using transistors or FETs. Have you looked around online? I'm sure you can find an example, for an Arduino if not an ESP... Sep 11 '20 at 14:23
• What does your schematic look like? You shouldn’t need to invoke j to wire up an LED display to an MCU. Sep 11 '20 at 14:26
• Apparently, the maximum sink current of an I/O pin is 20 mA: GPIO Maximum current Imax. How much current does the display take when all seven segments are lit? If it is more than 20 mA then you will need to use transistors for the selectors. Sep 11 '20 at 15:28
• @AndrewMorton I'm only displaying 4 segments at a time. The specs of of the display says direct current between 10mA and 20mA, so I might need to add a resistor. I didn't add any (except for the sink) and the leds are pretty bright... Sep 11 '20 at 15:45
• @SpehroPefhany I have added a schematic Sep 11 '20 at 15:45

I ended up buying a shift register because I will not be able to use 12 pins + 1 for a DHT11 (temperature and humidity sensor).

The led display is possible on the NodeMCU, but, if all the pins are connect at boot, there is an issue.

digitalWrite(pin, LOW);


does the trick for the sink.

You can drive it with 12 GPIO, add 150 ohms series resistance to each segment/dp output and drive each cathode with a 2N7000 MOSFET or a BJT + base resistor.

Ideally refresh the display with an interrupt at 1 kHz or so from 4 bytes of dedicated RAM.

Write whatever segments you want to appear on to the RAM at your leisure.

You can test it with a simple loop before getting the interrupt routine working.

• Ok so this means I cannot use the NodeMCU alone? I have BJT like 2N2222 so I will try Sep 12 '20 at 5:33