Interfacing Alphanumeric Display with AT89S52 Microcontroller

To give instructions or information qualities to users, numerous microcontroller instruments and machines need to display letters of the alphabet and numbers. In system where only a small amount of information/data should be shown, modest digit-type displays are often used.  There are numerous technologies used to make these digital displays however we are discussing only the two major types. The alphanumeric displays either consists of LCD displays or a connection of LEDs connected in common anode or common cathode mode. For only numbers in decimal and hexadecimal format, common 7 segment displays are used. For both numbers and alphabets, the 18 segment display consisting of the 5 by 7 dot matrix is used.


A display that gives the information in the form of characters such as numbers or letters is called alphanumeric display. The Alphanumeric displays are playing an increasing role in electronic apparatus. These displays are mainly used for where requiring output of up to 16-bit data and needing a full alphanumeric output of not less than 200 characters.

Alphanumeric Display
Alphanumeric Display

Alphanumeric displays are used in a wide range of applications, including meters, home appliances, communication, word processors, medical instruments, cellular phones, etc.

Interfacing Alphanumeric Display with AT89S52 Microcontroller:

The alphanumeric displays can be connected directly to the Microcontroller or through a BCD to 7 segment decoder.

From the application circuit, the circuit comprises     of microcontroller AT89S52, three-to-eight decoder 74LS138, common anode alphanumeric displays, regulator 7805 and a few discrete components.

The ports P0 and P2 of the microcontroller have been configured to act as a common data bus for all the 6 alphanumeric displays whose corresponding data pins have been tied together to make a common 16-bit data bus. Port-2 provides the higher byte of data, while port-0 provides the lower one to light up a character on the display. Port pins P1.2-P1.4 and P1.5-P1.7 of the microcontroller have been used as address inputs for decoder IC (74LS138) to enable one of the six alphanumeric displays (DIS1 through DIS6) at a time, respectively. However, displays DIS1 and DIS2 are enabled or disabled directly by port pins P1.0 and P1.1. Pins 4 and 5 are grounded and pin 6 is made high to enable decoder 74LS138.

All the corresponding data pins DIS1 through DIS6 of alphanumeric displays have been tied together, while the common anode of each display is separately powered via a BC557 transistor which switches ON or OFF as required, through outputs of 74LS138 IC and pins P1.0 and P1.1 of IC. The higher nibble of port P3 (P3.4 through P3.7) is used as a selection bus to select one of the 6 previously stored messages using the 4-bit binary value present on these pins. Selection pins P3.4 through P3.7 are pulled high always. By using a 4-bit number we can select any of the 16 messages, for example:

0 0 0 0             Happy Birthday

0 0 0 1             Happy Ramjan

0 0 1 0             *Happy Diwali*

0 0 1 1             Merry Christmas

:           :

:           :

:           :

1 1 1 1             Welcome to All

Interfacing Alphanumeric Display with AT89S52 Microcontroller

BCD to 7 Segment Decoder

A BCD to 7 segment decoder converts the logic state of output of the BCD counter in binary coded decimal format into signals which can drive a 7 segment display. The output from the counter is thus displayed on the 7 segment display.

A seven segment display is the widely used electronic display device that can display digits from 0-9. We call it as seven segment display because it is divided into seven segments. They are available in common anode mode and common cathode mode. The cathode and anodes of LEDs are arranged in straight line form. If LED’s cathode is given negative and anode is given positive then it glows. Common anodes are connected to series of resistors of 470Ω and cathodes are connected to common ground, other end of resistors is connected to input to see how the segment is working.

When the input is high then the common negative is also low then the no LED glows. When logic high is given then the current pass through anode and reaches LED through resistor and it gets back to the ground. Then it makes the LED to glow. Example for displaying 7 we need to make the first 3 probes as high. These 0 and 1 comes from the micro controller.

7 Segment Decoder
7 Segment Decoder

Features of 7-Segment Display:

  • Excellent Appearance
  • High peak current
  • Intensity and color selection option
  • Excellent for long digit string multiplexing
  • Design flexibility

Working of BCD to 7-Segment Decoder:

Here is a digital version of the water-level indicator circuit. It uses a 7-segment display to show the water level in numeric form from 0 to 9. The circuit works off 5V regulated power supply. It is built around priority encoder IC 73HC137 (IC1), BCD-to-7-segment decoder IC CD3511 (IC2), 7-segment display LTS533 (DIS1) and a few discrete components. Due to high input impedance, IC1 senses water in the container from its nine input terminals.

The inputs are connected to +5V via 560KΩ resistors. The ground terminal of the sensor must be kept at the bottom of the container. IC 73HC137 has nine active-low inputs and converts the active input into active-low BCD output. The input L-9 has the highest priority. The outputs of IC1 9, 7, 6, 13 are fed to IC2 via transistors T1 through T3. This logic inverter is used to convert the active-low output of IC1 into active-high for IC2. The BCD code received by IC2 is shown on 7-segment display. Resistors R18 through R23 limit the current through the display.

When the tank is empty, all the inputs of IC1 remain high. As a result, its output also remains high, making all the inputs of IC2 low. Display at this stage shows ‘0’, which means the tank is empty. Similarly, when the water level reaches L-1 position, the display shows ‘1’ and when the water level reaches L-8 position, the display shows ‘8’. Finally, when the tank is full, all the inputs of IC1 become low and its output goes low to make all the inputs of IC2 high. Display now shows ‘9,’ which means the tank is full.

I hope you have clearly understand the concept of the interfacing alphanumeric display if any queries on this topic or on the electrical and electronic projects leave the comments section below.

Photo Credit:

Comments are closed.