Interfacing Seven Segment Display with Microcontroller

In this tutorial we will be learning on how to interface the seven segment display with microcontrollers. Seven segment display is very useful for numeric character displays from 0-9. These seven segment displays can be interfaced with microcontrollers to enable the display to show any numbers representing the number of counts or Analog Pin readings of the controller. In this tutorial we will be interfacing the Seven Segment Display Module with AVR controller ATtiny4313 using BCD to Seven segment decoder IC. The list of ICs along with Datasheet used in this project/tutorial is listed below:

AVR with Seven Segment Display

  1. ATtiny4313 microcontroller – Datasheet Make: Atmel
  2. HEF4511BP BCD to Seven segment Decoder – Datasheet Make: NXP
  3. TDCG1060m Seven Segment Display Module (Common Cathode) – Datasheet Make: Vishay

Before continuing to our tutorial lets first take a look at the Seven segment display types and BCD to seven segment display driver/decoder.

Seven Segment Display (TDCG1060m) Wikipedia Link

The seven-segment displays are of two types i.e.

  1. Common Cathode
  2. Common Anode

The seven segment display consists of basic Seven Pins with name as: a, b, c, d, e, f, and g. And depending upon the Common Cathode or Common Anode type there is common VCC Pin (for Common Anode type) and common GND Pin (for Common Cathode type) as shown in figure below:

Seven Segment Display-1

By controlling the ON/OFF of the a-g pins we can generate different decimal numerals from 0-9. The seven segment module which we have used in this tutorial is TDCG1060m of make Vishay. It comprises of four seven segment displays integrated ina single module as shown below. The color of the display is Green.

TDCG10mCommon Cathode Seven Segment Display

HEF4511BP BCD to Seven segment Decoder – Datasheet Make: NXP

The HEF4511BP is a BCD to Seven-segment decoder with LED driver embedded into it. It is digital IC with the schematic as given below.

Seven Segment Display-2BCD to Seven segment decoder

This IC takes the Input as BCD and generates the Seven Segment output. This can be directly interfaced with the TDCG1060m module as it has inbuilt LED driver as well. The respective Truth Table for the BCD to Seven Segment Decoder IC HEF4511BP is:

Truth Table BCD to Seven Segment DecoderBCD to Seven Segment OutputThe detailed schematic which we have used to implement this demo tutorial of interfacing Seven Segment display with ATtiny4313 using BCD to Seven Segment Decoder IC HEF4511B is listed below. This has been created using Eagle CAD and the downloadable Schematic and Netlist have been provided in the Link below:

Eagle CAD Schematic Download   – Right Click and use “Save Link As” to download the file

Schematic Netlist Download

Schematic Seven Segment

All you need is to hook up the components as per above schematic in your bread board and power it up. And at last you need to program the ATtiny4313 to run suitable codes to use all the four Seven Segment LEDs in the TDCF1060m module. We will run all the numeric character from 0 to 9 in each of the four Seven Segment display in the module one by one.

We have used Atmel AVR Studio 7.0 to run and compile the code. And have flashed the programming memory of the ATtiny4313 using USBasp programmer. These USBasp programmer are very cheap and is the most reliable one. Kindly find the C code for the test program below which to be run and compiled for flashing the ATtiny4313.

Tags:
2 Comments

Add a Comment

Your email address will not be published. Required fields are marked *