Skip to Content
Using LEDs, LCDs and GLCDs in Microcontroller Projects
book

Using LEDs, LCDs and GLCDs in Microcontroller Projects

by Dogan Ibrahim
November 2012
Intermediate to advanced
496 pages
12h 2m
English
Wiley
Content preview from Using LEDs, LCDs and GLCDs in Microcontroller Projects

9.7 PROJECT 9.7 – Connecting more than one LED to a Port Pin

9.7.1 Project Description

There are some applications where we may want to connect many LEDs to a microcontroller, but where only one LED is required to be ON at any time. One such application is the design of a Roulette board, which requires 37 LEDs, and only one LED is ON at any time. In principle, we can use a high-end microcontroller with many I/O pins for such applications. But, as we shall see in this project, for low-cost applications it is preferable to use a cheaper low-end microcontroller and share the I/O pins. This approach requires less wiring and less number of current limiting resistors, resulting in a much lower cost.

As shown in Figure 9.37, connecting two LEDs to an I/O port is very easy. One LED is connected in current sourcing mode, while the other LED is connected in current sinking mode. When the port pin is at logic LOW, LEDA is turned ON, when it is at logic HIGH, LEDB is turned ON.

Figure 9.37 Connecting 2 LEDs to a port pin

img

It is possible to connect more than two LEDs to a port pin, where only one LED is ON at any time. Here, we connect two LEDs between each pair of I/O pins, where the LEDs are connected in opposite directions. Thus, with 3 I/O pins, we can have up to 6 LEDs, with 4 I/O pins we can have up to 12 LEDs, and so on. The maximum number of LEDs that can be connected can be calculated ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Practical AVR Microcontrollers: Games, Gadgets, and Home Automation with the Microcontroller Used in Arduino

Practical AVR Microcontrollers: Games, Gadgets, and Home Automation with the Microcontroller Used in Arduino

Alan Trevennor

Publisher Resources

ISBN: 9781118361030Purchase book