There are a few options to control multiple displays:
- employing multiple controllers;
- using a 7-segment driver chip like the 7447;
- using a multi-display controller such as the MAXIM MAX7219;
- sequencing through the displays, which is what we have done in our example, as it requires no added hardware.
When we were using a single-digit display, we connected the common anode pin to our Vdd supply, but with two digits we have to drive them independently if we want them to display different digits!
A natural reaction would be to try to use two Arduino I/O pins, each driving a digit of the display. The problem with this scenario is that it is not possible to drive the common anode or cathode pin using Arduino I/O pins, as they cannot source or sink enough current to light all seven segments.
The solution is then to use bipolar junction transistors (NPN for common cathode and PNP for common anode displays) in order to sink or drive the required current. The controlling interface outputs the value for a specific display by enabling only its common pin transistor, and the digit driven by that common pin becomes active.
To give the impression that both displays are active at the same time and avoid flickering we cycle through the digits in quick succession and keep each of them lit for 5ms. We will see how that was implemented when we go over the sketch next week.
Here is the schematic for the 2-digit 7-segment display circuit (click for larger image):
* This is a multi-part post. Here are links to all parts:
Part 1: Intro, bill of materials and simple sketch
Part 2: The 2-digit 7-segment display circuit; this post
Part 3: Sketch broken down in sections, explained
Part 4: Added two buttons, and modified sketch
Part 5: Code for buttons, explained