Engineers Garage

  • Projects and Tutorials
    • Circuit Design
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Components
  • Articles
    • EG Blogs
    • Insight
    • Invention Stories
    • How to
    • What Is
    • News
      • EE Design News
      • DIY Reviews
      • Guest Post
      • Sponsored Content
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • Video
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering

Displaying name on 16×2 Character lcd using 8051(89c51,89c52) microcontroller

August 5, 2019 By EG Projects

This is a simple project on how to display/print your name on 16×2 lcd using 8051(89c51) microcontroller. Character lcd’s comes in many packages 16×2 , 8×1 ,16×1 ,8×2. All the lcd’s performs actually the same function, display data that we send to them. Displaying data on 16×2 lcd is not an easy task, its also not that much hard. You should first be familiarize with the 16×2 lcd pin out and working, its internal structure, registers and lcd controller.
​

I recommend you to take this tutorial. It contains all the information about 16×2 lcd. Its pin out and the functions that are associated with each pin. Lcd’s most important pins rs(register select) rw(read write) and en(enable) are also discussed. Commands used to initialized the lcd and many other’s are given in it. Generation of character on a 5×8 matrix is also highlighted.

  • 16×2 lcd pinout and working.

Display your name on lcd – Project circuit diagram

  • Connect port 2 of 8051 microcontroller with 8 data pins of 16×2 lcd. Connect DB0 pin of 16×2 lcd to pin-0 of port 2 then DB1 to pin-1 and so on.
  • Connect rs(register select) pin of 16×2 lcd to port 3 pin 5.
  • Connect rw(read write) pin of 16×2 lcd with port 3 pin 6.
  • Connect en(enable) pin of lcd to pin 7 of port 3.
  • Apply 5 volts to pin 40(vcc) and 31(EA) of 8051(89c51) microcontroller.  
  • Use pin 9 of microcontroller as reset pin. Attach button to it when ever you want to reset your program press the button.
  • Ground pin 20.
  • Use crystal of 11.0592 MHz with two 33 pF capacitors in parallel to pins 18 and 19 of 8051 microcontroller.


​Circuit diagram of the project is given below.

16x2 lcd with 8051 microcontroller - Displaying name on lcd

16×2 lcd with 8051 microcontroller – Displaying name on lcd

Displaying name on lcd – Project code

The code of the project is very easy to understand. I am using keil uvision 4 ide for writing and compiling code and generating hex file for 8051 microcontroller. First i included the header file reg51.h in code. This header file is necessary, if you are using keil software for your 8051 microcontroller code and generation of hex file. The header file contains necessary configurations of 8051 microcontroller. Then three individual bits of port 3 are declared. These bits are declared to be used with 16×2 lcd to toggle its rs, rw and en pins when needed. Then a simple delay loop is created for giving necessary delays where needed in our program code. Then a command function is created, it is performing the function of selecting command register of 16×2 lcd and carry out the task associated with each command. Then lcddata() function is selecting data register of 16×2 lcd and prints data on lcd that we input to it. lcd() function in main is initialing lcd in 16×2 mode with cursor blinking and display on. Rest of all the things in main function are characters that we want to print on our lcd. 

Displaying name on lcd – Project Output

The output on the 16×2 lcd is “!!!WE LOVE!!!” on first line of lcd and “PAKISTAN” on second line of lcd. You can also change the code according to your need. If you want to print your name just place your name in lcddata() function instead of “!!!WE LOVE !!! PAKISTAN“.

​Related Projects

  • Dis playing moving text on 16×2 lcd with 8051 microcontroller
  • Generating custom characters on 16×2 lcd with 89c51 microcontroller
Download the project code written in keil u visison 4 ide and please give us your feed back on the project.
Download Code/Files

Related Articles Read More >

A Bluetooth-controlled datalogger robot
touch bell push
How to design a touchless bell push using Arduino
SMS-enabled scrolling message board using Arduino
Interfacing stepper motor with 8051(89c51,89c52 ) microcontroller

Featured Tutorials

  • Screenshot of Raspbian OS on Raspberry Pi RPi Python Programming 03: Raspberry Pi as Linux System
  • Raspberry Pi Models RPI Python Programming 02: Raspberry Pi Models
  • Raspberry Pi 4 RPi Python Programming 01: Introduction to Raspberry Pi 4
  • RPi Python Programming 05: Introduction to Python
  • RPi Python programming 04 RPi Python programming 04: Setting up Raspberry Pi Linux computer
  • Python Basics RPi Python Programming 06: Python basics

Stay Up To Date

Newsletter Signup

EE Training Center Classrooms

“ee

“ee

“ee

“ee

Recent Articles

  • New Vishay Semiconductors increase efficiency of high-frequency applications
  • TI launches industry’s top wireless battery-management solution
  • AVX releases new series of embedded, highly sensitive Wi-Fi antennas
  • Nuvoton offers a secure storage MCU for multi-segments
  • Refrigerator Compressor Design Achieves High Energy Efficiency Ratings Using a Digital Signal Controller (DSC)
...

RSS EDABOARD.com Discussions

  • Rippe current rating of aluminium electrolytic capacitor is very low.
  • Why do some op amps have a higher GBW than what the unity gain-bandwidth is?
  • Stacked Diodes ?
  • dsPIC33f ADC reading voltage help
  • What the best way to store data of size ( 90,000 * 32) bit (taken from a text file) using VHDL?

RSS Electro-Tech-Online.com Discussions

  • Engine Temperature using an AD590 on the Oil Pressure Wire to the engine
  • Automotive 6 Volt Generator Transistor Voltage Regulator
  • Jon's Imaginarium - Microchip FilterLab Program and Graph Paper Printer Program by Dr. Philippe Marquis
  • Touch circuit sound, led. 555 timer
  • Dust extractor remote switch
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2021 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Circuit Design
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Components
  • Articles
    • EG Blogs
    • Insight
    • Invention Stories
    • How to
    • What Is
    • News
      • EE Design News
      • DIY Reviews
      • Guest Post
      • Sponsored Content
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • Video
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering