Tutorial 7: Counting Down with a 7 Segment LED
English Chinese (Simplified) Czech French German Hindi Italian Japanese Korean Russian Spanish

In this tutorial we will show you how to use the UNO R3 PLUS to drive a 7 segment LED display.  We will show you how to wire up the LED display, and show a simple count down example from 9 to 0.

 

I – Stuffs that you will need:

You will need a UNO R3 Plus board, a mini USB to standard USB cable, a PC as well as a breadboard, 7 segment LED, resistors and jumper cables for assembling the circuit.

UNO R3 Plus                 Mini USB to Standard USB       Windows PC

Breadboard         7 Segment LED Display    7x330ohm Resistors

Jumper cables   2N3904 NPN transistor

 

 

II – Background Information:

 

We will be using a two digit 7-segment LED for this tutorial, but we will only be exercising the right digit.  This LED is a command anode device.  We will apply a 5V to pin 13.  To light up the LED segment, we will need to pull the cathode (or the negative) side to ground via a 330 ohm resistor.   To turn off the LED segment, we will pull the cathode side to 5V via a 330 ohm resistor.  We will use the UNO R3 Plus digital output pins to drive these LED segments, we will need 7 pins to drive 7 segment.

 

 

III – Wiring the Breadboard:

 

Let’s wire up the bread board. We will map the digital pin as following:

  • Digital pin 2:  segment a
  • Digital pin 3:  segment b
  • Digital pin 4: segment c
  • Digital pin 5:  segment d
  • Digital pin 6:  segment e
  • Digital pin 7:  segment f
  • Digital pin 8:  segment g

 

 

IV – Writing the Sketch:

Start a new project and copy and paste the below sketches into the Arduino environment. This sketch setups digital pin 2 to 8 as output, and setup a lookup table that would display a value of 0 to 9.  Once the sketch is loaded on the board, you will see the number decrement from 0 to 9 continuously.

 

CLICK TO DOWNLOAD ALL TUTORIAL CODES:  ARD101_Tutorial_Code

Things we have covered in this tutorial:

  • Using 7-segment LED display

 

 

Tutorial 8: Powering the UNO R3 PLUS Using Batteries

 

Download  ARD-101 Tutorial Codes