April 30, 2021

7 Segment Display Interface With Arduino

Seven segment displays come in different sizes. Their pin configuration also varies. So after purchasing any Common Cathode (CC) or Common Anode (CA) type display one must find the pin configuration. Usually, the datasheet could be found using the printed model number on the 7-Segment display. Depending upon the type (CC or CA) drivers are available to drive a display. Otherwise, they require an 8bit data line and 1bit control line per display. Drivers also help to drive the current for segments as sometimes for bigger displays the requirement of the current might be more than the controller could supply.

In a 7 Segment Display, the segments are named as a,b,c,...,e,f, and Dot Point. The segments are positioned as below.

   

To interface 7-Seg display with Arduino, we need

  • Arduino UNO / NANO
  • 7-Seg Display Common Anode type
  • 330 Ohms Resistor
  • 40x1 Male Berg Strip
  • Dot Vero or Bread Board
  • Connecting Wires
  • Jumper Wires - Male Female Type
  • Soldering Kit (Not required for Bread Board)

Connection Diagram:
  • D2 is connected to A
  • D3 is connected to B
  • D4 is connected to C
  • D5 is connected to D
  • D6 is connected to E
  • D7 is connected to F
  • D8 is connected to G
  • D9 is connected to Common Pin
Once the connection is complete copy the below code to Arduino IDE and upload it to your Arduino.

The code is for displaying 0-9. After uploading you should see the counting started. Please check the video for results.

Troubleshoot:
  • If you find that all the segments are not glowing at 8 that means there are some wires that are not connected properly.
  • If you see that display is showing abnormal values please check the connection diagram between Arduino and the Display.

Source Code:

Video:
 

No comments:

Post a Comment