Arduino Seven Segment Display Tutorial




How many TV shows and movies have some mysterious device counting down to zero those displays are 7 segment displays.With the 7 segment displays you can display any number or some alphabets that your heart desires.

At first controlling a 7 segment display seems quite complex but it quickly becomes clear.

What follows is a quick guide to control a 7 segment display with a arduino board
Arduino Seven Segment Display




If you want to jump ahead to any other part here’s your chance:

Step 1 – What Is A Seven Segment Display?
Step 2 – Parts & Tools
Step 3 – Testing
Step 4 – Built The Circuit
Step 5 – Project 1- One Digit Count Down Timer
Step 6 – Multiplexing
Step 7 – Project 2 – Two Digit Count Down Timer

This instructable is a entry in the arduino contest so if you like it please vote.

Step 1: What Is A Seven Segment Display?

A seven-segment display (SSD), or seven-segment indicator, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot-matrix displays. Seven-segment displays are widely used in digital clocks, electronic meters, and other electronic devices for displaying numerical information.A seven segment display, as its name indicates, is composed of seven elements. Individually on or off, they can be combined to produce simplified representations of the arabic numerals.The seven segments are arranged as a rectangle of two vertical segments on each side with one horizontal segment on the top, middle, and bottom. Additionally, the seventh segment bisects the rectangle horizontally. There are also fourteen-segment displays and sixteen-segment displays (for full alphanumerics

Step 2: Parts & Tools

Parts:
~ 2 x Seven Segment Display (Common Cathode)- Red,Blue
~ 1 x 330 ohm resistor – Sparkfun.com
~ Arduino Uno(Or equivalent) – Sparkfun.com
~ Breadboard – Sparkfun.com
~ Some jumper wires – Sparkfun.com

Tools:
~ The arduino programming Environment – Arduino.cc
~ USB Cable A-B – Sparkfun.com
~ Soldering Iron – Sparkfun.com
~ Solder Wire – Leaded or Lead Free

The total cost should be about 8.10 $ assuming that you have a arduino,breadboard and all the tools

Step 3: Testing The Display

Before we connect the seven segment display to our arduino its a good idea to give it a test.

Consult the datasheet of your display for the PIN-OUT and other specs

Wire up your display for testing
~Plug the display into your breadboard
~Connect the two common cathodes together and attach a resistor to them
~Connect the common cathode resistor to the -5v
~Test each segment by connecting its pin to +5v
~Experiment and try to make different numbers by lighting one or more segments at the same time

Step 4: Built The Circuit

Now lets move on to controlling the seven segment display with the arduino.

Arduino Seven Segment Display circuit
The circuit is pretty straight forward connect the common cathode’s to gnd with a 330 ohm current limiting resistor. Connect the seven segment displays pin number 7(A) to arduino pin2 , 6(B) to arduino pin3 , 4 (C) to arduino pin 4 , 2 (D) to arduino pin5 , 1 (E) to arduino pin6 , 9 (F) to arduino pin7 , 10 (G) to arduino pin8 , 5 (DP) to arduino pin9.For the 2nd project first make the multiplexing circuit below and then follow these connections pattern.Segment A to pin 7, Segment B to pin 8, Segment C to pin 4, Segment D to pin 3, Segment E to pin 2, Segment F to  pin 6, Segment G to pin 5, Gnd1 via resistor to pin 11, Gnd2 via resistor to pin 9.

I have also included the fritzing digram(The worst you can get as I am not good at making circuit diagrams)  for the multiplexed circuit and the simple circuit and pinout of the seven segment display .

Step 5: Project 1- One Digit Count Down Timer

The first project we are going to do is one digit count down timer.This project will count down from nine to zero.This project does not use any multiplexing but the project 2 includes multiplexing.The circuit digram can be found on step four.
To get started and get playing with this just follow the following these simple steps.
~ Copy or download the code below and paste it in an empty arduino sketch
~ Compile the sketch and upload it to your board. If any problem occurs feel free to ask
~ And now enjoy your count down timer.
~ I have included two files the first one is a compact verson of the  code and the second one is the longer more longer one but is really easy to understand.

Major Components in Project

~ 2 x Seven Segment Display (Common Cathode)- Red,Blue
~ 1 x 330 ohm resistor – Sparkfun.com
~ Arduino Uno(Or equivalent) – Sparkfun.com
~ Breadboard – Sparkfun.com
~ Some jumper wires – Sparkfun.com

 

For more detail: Arduino Seven Segment Display Tutorial




This Post / Project can also be found using search terms:

  • arduino 7 segment
  • Arduino 7 Segment Display Tutorial
  • seven segment countdown timer arduino
  • arduino seven segment display code
Clip to Evernote

Comments (2)

Leave a Comment

(Spamcheck Enabled)

Read previous post:
LittleGoal - World Cup Match Notifier using Arduino
LittleGoal: World Cup Match Notifier using Arduino

[ This Instructable was made at the Taipei Hackerspace littleBits Instructables Build Night. ] Can't watch the World Cup football...

Close
Scroll to top