4 x 7 Segment LED Breakout Board

Views:14360Difficulty: 1 Status: Development
4x7segment_led_w_arduino_main

Display 4 digits using only 3 MCU wires with the 4 x 7 Segment LED and shift register breakout board.

Need numbers in your next project? Maybe you're building an electronic score board, or an Arduino-based clock. The 4 x 7 Segment LED breakout board allows you to display four digits using only 3 wires on your microcontroller. You can buy one here. The displays come in blue and red. Controlling four 7-Segment LEDs requires individual control of 4 x 7 = 28 distinct LEDS. We achieve this by daisy chaining 4 74HC595 Shift registers together, with each shift register in control of one digit as in the breakout board for the single 7 Segment LED . We use this LED module in our DIY LED clock tutorial .

4 x 7 Segment LEDs and Arduino

4x7segment_led_w_arduino
Easy to drive with an Arduino just use the sample code below.

The 4 x 7 Segment LED Block in action

Checkout the LED block in action. The code running on the module is explained and shared below. Count to one thousand and then do it again and again and again...

Step-by-Step Instructions

Step0Apply Solder to all Pads

Solder_resistor_arrays
First use a flux pen on all the pads you are going to solder. Then apply solder to every pad on the side of the PCB labelled LucidTronix. Make sure you have no solder bridges connecting two pads.

Step1Add Shift Registers in the Correct Orientation

First Heat up the pads for the chip with the hot air gun. Wait until the solder changes color, and gets a little more shiny. Then grab the 74HC595 chip with tweezers and ensure the circle indentation is lined up with the silkscreened 1 on the PCB. While still applying the hot air lay the chip down on its pads. The surface tension of the solder should look it into place.
Lay_chips_apply_hot_air

Step2Solder Again

Solder_again
We've found it's a good idea to do a second round of soldering after getting the chip in place with the hot air gun. Spread some flux on the pins and quickly touch them with the iron. This ensures a solid connection between the pins and the pads.

Arduino code for 7-segment LEDs controlled by 74HC595 shift registers

This code will count to one thousand over and over again. We display numbers on the 7-segment displays easily by storing the LED configuration for the different numbers in the array of bytes called dec_digits:
byte dec_digits[] = {0b11000000,0b11111001,0b10100100,0b10110000,0b10011001,0b10010010,0b10000011,0b11111000,0b10000000,0b10011000 };
Then we have 4 nested for loops for the ones, tens, hundreds, and thousands columns. Each for loop goes to ten which is how many decimal digits we have... Hmmm.. we also have ten fingers, coincidence? No way! Then to display the numbers on the shift registers we use the Arduino shiftOut function.
          shiftOut(dataPin, clockPin, MSBFIRST, dec_digits[onesColumn]);          shiftOut(dataPin, clockPin, MSBFIRST, dec_digits[tensColumn]);          shiftOut(dataPin, clockPin, MSBFIRST, dec_digits[hundredsColumn]);           shiftOut(dataPin, clockPin, MSBFIRST, dec_digits[thousandsColumn]);
Notice that we send the ones column out first as this is the shift register furthest from the Arduino. We also must make sure to take the shit register's latch pin low before we send out any data and then set it to high again to put the shift registers in output mode so we can see the updated numbers.
Download File

Parts

Title Description # Cost Link Picture
PCB 4x7 Segment LED Breakout Printed circuit board for our 4 x 7 segment LED shift register breakout board. 1 $6.0 Link 4x7segement_led_pcb
LED Display 7 Segment numeric LED Display REDValue:7 Red LEDs 4 $0.95 Link 7segmentredled-01-l
Shift Register IC SHIFT REGISTER 8BIT 16-SOP Tri-State Serial to ParallelValue:74HC 4 $0.65 Link Screen_shot_2012-12-28_at_7.32.29_pm
Capacitor CAP CER 0.1UF 50V Y5V 0805Value:0.1µF 4 $0.1 Link 0805(6_0mm_thickness)
Resistor Array RES ARRAY 300 OHM 4 RES 1206Value:300 8 $0.02 Link Vishay_-_cra06s-8

    Comments:

Permalink: http://lucidtronix.com/tutorials/50

Tutorials

The 74HC595 shift register controls a 10 LED Bar Graph....
Connect shift registers together to get more output and input pins from your microcontroller....
Build your own clock with the MCP79410 chip and 4 7-Segment LED modules....
Display numbers in big bright red LEDs use only 3 micro-controller pins and the 74HC595 shift registe...
32 buttons for a fully-functioning hand-held USB keyboard....
A QWERTY keyboard you build yourself....
Two LED matrices give 70 LEDs to light up a necklace with messages....
Make an interactive light show using a proximity sensor, and a bunsh of shift registers and LEDs....