Using Multiple Shift Registers for Multiple 7 SEGMENT Display With Arduino

by Random Creations in Circuits > Arduino

4826 Views, 8 Favorites, 0 Comments

Using Multiple Shift Registers for Multiple 7 SEGMENT Display With Arduino

Screenshot (71).png

In this instructable, I’ll share that how can we use more than one shift register with Arduino using only three pins. And also how we will use multiple Seven segment displays. We can use this setup to make a digital clock or any other project in which we require digital displays.

As for me, I tried this circuit in Tinkercad which provides an online Circuit simulation and tinkering tools with tons of different components.

I’ll use this setup for my future project of Digital Clock with a custom 7-segment Led display.

Supplies

Screenshot (77).png

Alright, here are few things that we will be in need of to make this circuit.

Into Hardware

Screenshot (78).png
Screenshot (79).png
Screenshot (80).png

Let's discuss a few things like display and shift register. I’ll not cover everything about them but just an introduction.

Seven Segment Display

The display we are using here is the Common Cathode Seven Segment display which literally means that it has seven segments. Segment A, B, C, D, E, F, G, and one dot which is shown as DP.

By saying Common Cathode display we mean that all led’s Cathode is common which means that their single Common Ground pin or cathode pin of LEDs will be connected to the Ground pin of our Microcontroller or power supply.

It’s different from the Common Anode type because in that we use each led’s cathode pin independently while their anode is common and is connected to the positive of our Power supply.

And that’s the important difference to remember otherwise our circuit can malfunction. i.e, the segment displays or digits will be distorted.


Enough with Display now move onto Shift Register.

Shift Register

 Shift Register is the type of digital circuit that contains a Cascade of Flip Flops whereas the output of the first flip-flop is connected to the input of the next one and they all are connected to a single Clock Signal that causes the data stored in the shift register to move or shift from one location to other.

The shift register that we are using is 74HC595 and its pinout is shown in the following pictures with their description.


Okay That’s all for the shift register now let’s discuss the working mechanism.

Daisy Chain & Working Mechanism

Daisy Chain is the mechanism in which multiple devices or peripherals are connected in a loop or network of nodes in series. Similar to the garland.

Such mechanism is the root of how peripherals in our computer-like HDD, Cd ROMs are connected and this is the more flexible way.

Our shift Register 74HC595 is also Daisy-Chainable, if we look at pinout we come to know that pin number 9 is mentioned as Not Connected and that pin is Serial out Pin. This means that it is shifting out the serial data so we can add another shift register next to it to make’em part of Daisy Chain.

Circuit and Connections

Screenshot (72).png
Screenshot (73).png
Screenshot (74).png

The circuit is very simple, All pins mentioned as outputs of shift registers are connected to all seven segments and Dot pin of our displays.

The three pins of the first shift register are connected to Arduino digital pins. While the Input data pin of other shift registers is connected to Pin number 9 of the previous one. And other two pins, Clock and Latch pin are common for all.

 

Software

Screenshot (81).png
Screenshot (82).png

The software part is simple and easy. At first, we initialized the data, clock, and latch pin and gave them a specific output pin. Then we defined an array in that we used the code that is equivalent to a digit on display and of course it is in zeros and ones.

Let’s dissect it, For Example, the code number (B00000110)  is for digit ONE  and it has a total of eight zeros and ones after alphabet B. The first Zero is for DP or the dot led. If it is one then our led will be turned on meaning the dot of our display will be on otherwise off. The next seven digits are for Seven segments right now the two digits after the last zero are one meaning segments B and C will be on making Digit One. So how this will work for others too.

Back to code,

In void Setup, nothing new just the usual Arduino thing, we declared all pins as output.

In the void loop, We wrote our code which is on loop. Here we first turned our Latch Pin Low so that our Shift Register can know that new data is coming. Then in the next line, we used the Arduino's built-in Shift Out function, THE MSBFIRST here means Most Significant Bit First, and then by calling array we defined the number which we want to display at the output. And turned the Latch Pin High for the First Digit.

The same goes for other digits just change the number which is meant to be displayed at the output.

And This was all for the circuit and software. I hope you will have learned something good and informative from this article.

It's Done

Screenshot (71).png
Screenshot (74).png