TM1638 - 8x 7-segment LED modules with 8x buttons

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
ptarjan
Posts: 3
Joined: Fri Aug 16, 2019 12:38 pm

Re: TM1638 - 8x 7-segment LED modules with 8x buttons

Post by ptarjan » Fri Aug 16, 2019 1:07 pm

3V3 to VCC
G to GND
D8 (15) to STB
D7 (13) to CLK
D6 (12) to DIO

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: TM1638 - 8x 7-segment LED modules with 8x buttons

Post by Roberthh » Fri Aug 16, 2019 2:16 pm

The TM1638 module seems to require 5V, and will draw quite a lot of current when the LED's lite up. The 3.3V regulator of the Wemos will not drive that. So better connect to 5V. Since all other connections to the TM1638 are ESP8266 output to TM1638 input, there should not be a fatal problem with the input ranges. If the output level of the ESP8266 is too low, you have to use a level shifter.

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

Re: TM1638 - 8x 7-segment LED modules with 8x buttons

Post by mcauser » Fri Aug 16, 2019 2:40 pm

Sounds like you might be using one of the ESP8266 boot mode pins.
D3 (GPIO0) 10k pull-up
D4 (GPIO2) 10k pull-up
D8 (GPIO15) 10k pull-down
If your external device pulls any of these in a different direction, could cause the ESP8266 to boot into a weird mode.

ptarjan
Posts: 3
Joined: Fri Aug 16, 2019 12:38 pm

Re: TM1638 - 8x 7-segment LED modules with 8x buttons

Post by ptarjan » Fri Aug 16, 2019 3:22 pm

@Roberthh, @mcauser: Thank you for the pointers.

I suspected that the 3v3 may not be enough, but I didn't dare try the 5V (different logic level and all that). If communication is indeed one-way as you suggest, that shouldn't be a problem. I've tried it, nothing is smoking yet, so that's cool :D

It didn't solve the original problem, though. Switching from GPIO15 to GPIO16 did work, though, so I guess the tm1638 really messes with something. (I know, I know, GPIO16 also has a special function, but I'm not going to need sleep modes, and since I have a rotary encoder + button connected too, I 'm running low on free pins.)

Thanks again for your help!

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: TM1638 - 8x 7-segment LED modules with 8x buttons

Post by Roberthh » Fri Aug 16, 2019 3:48 pm

You can use GPIO0 as output, as long as it is pulled up at boot time. I know this lack of pins situation of the ESP8266 pretty well. I used for instance the analog input to read a switch state.

Salva_OA
Posts: 3
Joined: Mon Oct 04, 2021 2:19 pm

Re: TM1638 - 8x 7-segment LED modules with 8x buttons

Post by Salva_OA » Mon Oct 04, 2021 3:31 pm

Thanks a lot for sharing the files.

In order to use them on a Micro:bit board, editing the code in Mu; What pins do you recommend using and what lines should I change?.

Post Reply