ESP8266 4x7 segment display

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
nguyenhuy3588
Posts: 2
Joined: Fri Jan 01, 2021 2:12 am

ESP8266 4x7 segment display

Post by nguyenhuy3588 » Fri Jan 01, 2021 2:30 am

Hi all, i'm wondering without specific driver like TM1637, can i control each digit on 4x7 segment display just by gpio?

Currently, my 4x7 segment is cathode one and i don't have enough gpio on ESP8266 so i just test 2 digits (D1, D2) on the 4x7.

I have wired up all segment (a->g) and D1, D2 (through 1k resistors) to available gpio pins. When i set high value (1) to a->f and low value (0) on D1, D2, both D1, D2 appear as 0. Is there any way to isolate the digits? for example D1 is 0 but D2 is 9, seem like with this setup, if i set one, both digit appear to be the same.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: ESP8266 4x7 segment display

Post by pythoncoder » Fri Jan 01, 2021 5:52 am

The general solution is multiplexing, where you show each digit in turn for a brief period. If this is done sufficiently fast, the eye sees them as permanently illuminated. However for four digits this requires 11 GPIO pins. The ESP8266 has just 11 I/O pins, but some have specific requirements and two are used for your USB connection. So without some external electronics I don't think this can be done.

You can buy devices with more I/O or displays which require fewer I/O pins.
Peter Hinch
Index to my micropython libraries.

nguyenhuy3588
Posts: 2
Joined: Fri Jan 01, 2021 2:12 am

Re: ESP8266 4x7 segment display

Post by nguyenhuy3588 » Fri Jan 01, 2021 7:19 am

Thanks for the keyword, i think i got the point here.

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: ESP8266 4x7 segment display

Post by mcauser » Thu Jan 07, 2021 4:45 am

The TM1637 driver is just for common anode displays.

MAX7219 can be used to drive both common cathode (normal) and common anode (reverse).
Here's how you can wire it in either direction.

If you just want more IOs, have a look into using an IO expander: MCP23008, MCP23017, PCF8574, PCF8575
Other LED drivers worth looking into: HT16K33, SX1509, TM1638, TM1640
There's MicroPython drivers for all of these, listed here.

Post Reply