Published On Sep 9, 2022
We can use fewer GPIO pins controlling 7-segment LEDs using this simple trick! 👉JLCPCB Only $2 for PCB Prototype any colour https://jlcpcb.com/cyt
More information (including all links, sketches & PDFs in my GitHub):
https://github.com/RalphBacon/249-7-s...
I'm using dual 7-segment LED displays in another project, but I figured I could have designed that using fewer GPIO pins than I did. So I tried out my theory here.
Now, first things first. You would NOT usually drive the individual LED segments from an Arduino; it's too many GPIO pins. You would use some extra hardware to do that. But for this demo, we'll do it the easy way!
However, to multiplex between the digits (watch the video to understand what that means) you would normally need one pin per digit.
Not so here. I use a single GPIO pin and a tiny dual Si4599 MOSFET chip that allows me to alternate between the digits just by bring the GPIO pin high and low. Easy peasy, lemon squeezy. I just love this little chip. A pity it's so hard to find these days (in 2022). But the AO4606 is a great (and cheap) substitute (see my GitHub for details).
Yes, you could try using the Arduino's GPIO pin directly to source/sink the current but that would involve one Common Cathode and one Common Anode 7-degment digit. All a bit complex, to be honest. Not to mention that you can only source (or sink) ~20mA (40mA absolute max) per pin, so watch out!
If you can't find the dual MOSFET you can either:
* use two discrete MOSFETs, one N-channel, one P-channel
* use two NPN BJT transistors just to see how it all works (you'll need to use an extra CC pin on the Arduino for this)
* use one NPN and one PNP BJT transistor (sorry, no circuit diagram for this)
* use two GPIO pins on the Arduino to directly sink the current on the 7-segment digits (one pin per digit)
Remember to use a current limiting resistor in all cases, about 220Ω will be fine.
You MUST 😁 see more information (including all links, sketches & PDFs in my GitHub):
https://github.com/RalphBacon/249-7-s...
► List of all my videos
(Special thanks to Michael Kurt Vogel for compiling this)
http://bit.ly/YouTubeVideoList-RalphB...
► If you like this video please give it a thumbs up, share it and if you're not already subscribed please consider doing so and joining me on my Arduinite (and other μControllers) journey
My channel, GitHub and blog are here:
------------------------------------------------------------------
• / ralphbacon
• https://ralphbacon.blog
• https://github.com/RalphBacon
• https://buymeacoffee.com/ralphbacon
------------------------------------------------------------------
My ABOUT page with email address: / ralphbacon