Arduino Projects    |   Raspberry Pi  |     Electronic Circuits    |    AVR    |    PIC    |    8051    |    Electronic Projects   |   Free TI Design & Simulation Tools 

How to make an alphabetic keypad using 8051 microcontroller (AT89C51)


Developed By: 
Himanshu Choudhary

An alphabetic keypad is similar to a numeric keypad, but it provides the complete set of alphabetical letters instead of numbers 0-9. This article presents a way to interface a keypad with 8051 microcontroller (AT89C51) to display alphabetical characters on an LCD module. Such kind of systems is commonly used in mobile phones to write an SMS and other texts. It can have further applications in displaying instant messages on other display systems such as LED matrices or other multi-segment displays.

How to make an alphabetic keypad using 8051 microcontroller (AT89C51)


A 4x3 matrix keypad and a 16x2 LCD has been used here. Keypad and LCD are very commonly used input & output devices, respectively.
The connections in the circuit are as following: port P2 of microcontroller AT89C51 is used as data input port which is connected to data pins (7-14) of LCD. P3^0, P3^1 and P3^2 pins of microcontroller are connected to control pins RS, RW and EN of LCD. Port P0 is used to take input from keypad. Also refer to Keypad interfacing with AT89C51.


The alphabetic pattern or letter mapping used in this system is depicted in the following figure:






Every key is assigned with a variable to count the number of times it has been pressed. The count is set to zero initially and increases by one when the same key is pressed again.



On first count, the first alphabet of the key from its letter map is displayed on LCD. For example, if Key1 is pressed when its count is 0, then ‘a’ appears on the LCD screen. After this operation, the count increases to 1.






The second letter of the alphabetic pattern is shown on the display module when the same key is pressed again. This time the count increases again to 2 and second alphabet is displayed at same position. Thus, we get ‘b’ on display if Key1 is used twice.





When the same key is pressed third time, its count value changes to 3. This time the third alphabet of the letter pattern gets displayed on screen replacing the previous alphabet. For the considered case, ‘c’ appears on the LCD screen when Key1 is pressed thrice in a row.







The count is reset to zero after it reaches to a value of 3. After this execution, the position on LCD is shifted to right to allow the second letter to be printed there.




Therefore, pressing the same key four times consecutively, the first alphabet from its letter map reappears in succession to the last letter. Here, ‘a’ gets displayed on LCD after ‘c’ when Key1 is used four times.






In other words, if a key is pressed more than thrice in a row, the count resets to zero and it’ll behave as a new alphabetic key. Thus the same modes of operations continue on repeated access of the keypad buttons.






Key0 of this keypad is set for to provide a blank space ‘ ’ while Key* provides the functionality of backward movement while writing a text on LCD. Key# of the keypad is configured for forward movement.




The 16x2 LCD can display only 16 characters in a line. Therefore, after 16th letter appears on screen, the cursor position is moved and 17th letter gets displayed on the first position of 2nd line of LCD. Similarly, 23rd letter appears back on the first line and so on.






Circuit Diagram



This Code is only visible to Registered users. Please Login/Register


This Code is only visible to Registered users. Please Login/Register


Presets | Variable Resistors
A preset is a three legged electronic component which can be made to offer varying resistance in a circuit. The resistance is varied by adjusting the rotary control over it. The adjustment can be done by using a small screw driver or...
AT89C51 Microcontroller, Atmel 89C51 Controller Image
AT89C51 Microcontroller

AT89C51 is an 8-bit microcontroller and belongs to Atmel's 8051 family. ATMEL 89C51 has 4KB of Flash programmable and erasable read only memory (...

16 x 2 LCD | 16x2 Character LCD Module


LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments...

Free Circuit Design & Simulation Tool by TI

Free Powerful Circuit Design & Simulation Tool by Texas Instruments

TINA-TI is a powerful circuit design and simulation tool. TINA-TI is ideal for designing, testing, and troubleshooting a broad variety of basic and advanced circuits, including complex architectures, without any node or number of device limitations.

Download It Here


Tina TI

TINA is an easy-to-use, powerful circuit simulation tool based on a SPICE engine. TINA-TI is a fully functional version of TINA, loaded with a library of TI macromodels plus passive and active models.

TINA-TI's new version 9 has changes from Version 7.0 in the following areas:

  • Schematic Symbol Editor (useable with the Macro Wizard) is included, so you can create your own symbols for imported SPICE macromodels.
  • Macros do not have to be from TI - you can import anyone's SPICE model now!
  • Does not require active or non-linear components for analysis (so you can now run a circuit using just passives).
  • TINA-TI includes Initial Condition and Nodeset components
  • TINA-TI includes Linear and nonlinear controlled sources (VCVS, CCVS, VCCS, CCCS), and the Controlled Source Wizard.
  • TINA-TI now allows WAV files to be used as stimulus (signal sources). You can play calculated waveforms on PC's multimedia system, and export calculated waveforms as a *.wav file.
  • TINA-TI has Multi-core processor support; this along with other optimizations makes simulations run 2-20 times faster.
  • Schematic file import/export in XML format
  • Block Wizard included for making block diagrams
  • TINA-TI has more SPICE models and example circuits included.
  • Circuits developed in TINA-TI 9 will work with TINA Industrial version 9.
  • TINA-TI Version 7.0 is forward compatible with Version 9, and version 9 supports saving schematics in version 7.0 format.
  • Available in English, Traditional and Simplified Chinese, Japanese, and Russian versions.

Download The Tool Here Free

You are here