Introduction: Multiplexing Four 7-segment Displays Using Shift Registers Arduino

Hallo Every one

I designed a simple way to multiplex four 7-Segment displays using Shift Registers and an Arduino

Let us multiplex the 7 segment display

Step 1: Step-1 : Let's Design

Take four 7-segment displays and solder them on a PCB in a side by side manner.

A cathode or anode display can be used. This design is for an anode display.

Combine the 7 pins (pin-a to pin-g) and the dot pin of all the four displays.

Take four BC548 NPN transistors

connect each transistor emitter to each anode of 7 segment display

Combine all collector pins together it is for power supply +5v

then we have connect base of transistors and a,b,c,d,e,f,g,dot pins to shift-registers

go to next step

Step 2: Connecting to ShiftRegisters

Take two 74HC595 shift Registers

connect them to form 16 bit shift register by connecting serial pin of first shift register to data pin of second shift register

Combine latch pins to form single , like wise combine clock pins to form single one

Connect enable (active low)pin to ground pin on both register

connect master reset pin(active Low)pin to Vcc in on both registers

this connection form a 16 bit shift register

now connect the a,b,c,d,e,f,g,dot pins of LED to Q0,Q1,Q2,Q3,Q4,Q5,Q6,Q7 pins of first shift register

Now connect Base of transistors ,First LED Transistor Base Pin to second shift register Q0 pin , second Base of transistor to Q1, third to Q2, fourth to Q3

Now the set up is completed Next coding

Step 3: Coding

To display numbers on 7segment we have pass +5v or connect to 0v to on each segment

we have 7 segments a,b,c,d,e,f,g according to diagram

to display 0,9 numbers some segments make them to on , some off

Table

Number Byte_to_display_7sgment(a-g) Decimal_number
0 0b0000001 1

1 0b1001111 79

2 0b0110110 18

3 0b0000110 6

4 0b1001100 76

5 0b0100100 36

6 0b0100000 32

7 0b0001111 15

8 0b0000000 0

9 0b0001100 12

above is byte and decimal code to display the numbers in 7segments

we have shift this byte to first shift register ,because we connect the first shift register parallel pins to LED's a,b,c,d,e,f,g,dot pins

Next

we connected the LED on circuit (transistor Bases) to second shift register

for make first led on we have to shift

00000001 into second shift-register

00000010 for Second LED on

00000100 for third one

00001000 for fourth one

In this design we connect first and second shift-registers each other

so we first shift the position byte first and the value next the potion byte will move to the second shift register by using serial out pin of first one then we can shift the value bytes

Examples:

for display 5 on third LED we have shift the byte

00000100 then 0100100

Next :arduino Coding

Step 4: Arduino Coding

Connect the Latch , Clock ,Data pins to 8,10,9 pins of arduino (or any other one your wish )

I was written a code , that was take the 4 digit number from serial input and display onto the 4 LED

See the files for the Code

Note: I just designed it not tested , because presently i don't have arduino and LED

code written based on Imagination

Comments

author
martinhui (author)2017-03-04

may I check with you that your code is written for common anode display? how to change to common cathode display, I have done a similar code but only work for common anode, now I brought common cathode cannot work

author
v-nath (author)martinhui2017-03-05

invert the bits , then connect the common cathodes pins to ground ,

the shift registers can't deliver that power for 7 SEGMENTS use 7 transistor in between the data pins of leds (a,b,c,d,e,f,g,dot) and shift registers better to use ULN2803 , and invert the 4 controlled transistor (base pins as it is, connect the emmiter pins to ground and collector pins to common cathode )

author
madhavdivya (author)v-nath2017-03-12

Hi V-nath: HI, I got just ONE questions for you ?

What if the voltage is 24 v DC to drive the LED's?

Mine is a jumbo sized display of 3 digits in Common Anode Configuration.

I have put seven transistors (2N2222's), between the cathodes (seg. A to G) and GND. Every base of these transistors go to Q0 to Q7 of the first 74H595 through a 1k resistor.

Another set of 2 transistors is arranged between the +24v dc and Common Anode of each digit. The first transistor is NPN and the second is PNP, so that when the Q0 of the second 74H595 goes high, the anode of that particular segment goes high.

Is my understanding correct and technically feasible for my jumbo display ?

I appreciate your inputs.............madhavdivya@gmail.com

author
KiranM38 (author)2016-06-15

Thanks for this !