Multiplexing constitutes a technique to optimize the control of sequential hardware. This technique uses less controllers to handle switching and improves the maneuverability. Since each sequence have equal operation, it's preferred for driving in LEDs, 7 segments displays and many more. An example will be shown with traffic lights.
Featured Image: Traffic Light. Respectfully borrowed from Wikipedia.
Don't forget to check out the guide to connect the PICkit to any microcontroller. If you desire to learn more about 8-bit PIC microcontrollers for beginners, click here to see the related posts.
Table of Contents
How Multiplexing came to be
Let's see it clear with an example. Suppose that you have a few traffic lights that you need to command. That is to say, you need to give the state information to operate to every light (red, yellow and green for instance). Perhaps giving one cable or one port per light is required; in such case controlling one traffic light seems pretty straightforward, right? But as more traffic lights are added, complexity is increased.
Traffic Lights before multiplexing
Let's picture one traffic light and let's think how it could be driven.
The image above represents 3 resistors and 3 LEDs; one per color. The quickest way to control these lights is by attaching each of them to a pin in a microcontroller. In addition, each pin controls individually each light; namely, pin R, Y and G. It sounds simple, right? It is, until more traffic lights are added.
How does it looks like with a group of 4 traffic lights?
As shown in the image above, the number of pins required by the microcontroller increases considerably. For every traffic light, the complexity to drive them increases. Since there is a limited number of pins, a simple solution has to be implemented. Fortunately, there is a far better way to deal with scalable circuitry.
Traffic Lights after multiplexing
Let's consider a sequence to handle the information within each traffic light.
- Load the state information of each individual light of the first traffic light.
- Turn on the first traffic light and let it shine of a couple of milliseconds.
- Turn off the traffic light light.
- Repeat the process of each traffic light.
But does multiplexing makes it slow? Not at all, this happens so quickly that you won't notice the difference. The
How does the Schematic looks like
Now let's take a look how it could constructed in a schematic. For this sequence to work, a ‘data bus' is shared by all lights; carrying only the information for each light of each traffic light at a given time. Moreover, they are represented by the letters R (red), Y (yellow) and G (green)
At the bottom of the schematic, there is an array of transistors. Named P1 to P4, they turn ON and OFF the traffic lights individually and sequentially. Since only one traffic light in turned ON at a given time, the data bus only carries the state information of the corresponding traffic light.
It makes it simple
In conclusion, multiplexing makes sequential hardware easier to control because it is scalable and modular. It's also efficient since it requires less physical pins to work thanks to the data bus. Moreover, it's control speed makes it suitable to control devices such as 7-segment displays.
In the next post, a code sample used in a PIC microcontroller will be shown.
techZorro's Index of Content
Keep Reading!
- 008 – Variable Frequency Drives: how this controller can transform induction motors foreverAC induction motors can be transformed into a highly controllable machine with Variable Frequency Drives or VFD. Click here to listen.
- 006 – Regenerative Braking, an awesome Feature found in Electric MotorsThis episode is related to this hidden feature of electric motors called regenerative braking. Click here to listen.
- 005 – 7 types of Electric Motors that you should know aboutThere are several types of electric motors that differs in efficiency, power, cost, torque output, etc. Click here to listen.
- 004 – AC Voltages, Frequencies and Plugs around the WorldLet's talk about electricity! Specifically about how the standards around the world. Click here to listen.
- 002 – RISC vs CISC, how a few Differences are crucial to ComputingToday in the market is found two kinds of processor architectures: RISC and CISC. Both have some advantages. Click here to listen.
[…] and for reducing the number of pins required in a PIC microcontroller. In a previous post called Multiplexing Principles, this benefits were explained in further detail. Moreover, this post will implement a multiplexing […]
[…] out two other tutorials about timers: Timer 1 and Multiplexing. The links will be linked here for you when there are […]