Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey 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
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Displaying moving(Scrolling) text on lcd using 8051(89c51,89c52) microcontroller

By EG Projects March 22, 2024

This project is about How to display moving-scrolling text/string on lcd using 8051(89c51 , 89c52) microcontroller. Moving or scrolling text on lcd is not very hard it is only the game of programming the more expert you are in programming the more you can do fun. 

It is same like we display moving text on our java applications or the text that you see on news channel at the bottom moving from left to right. In this project I used a 16×2 lcd with 8051(89c51,89c52) microcontroller. 16×2 lcd is used in 8-bit mode. If you don’t know 8-bit mode than just click the link and you will have a good tutorial.
Difference between 8-bit and 4-bit lcd mode
.

​Their are two ways to Scroll-move Text on lcd

  1. Use Your Programming expertise to do so.
  2. Using Standard Commands of lcd.

Scrolling lcd display first method

First i am going to scroll text using my c++ expertise with out using standard 16×2 lcd commands. Text that I am moving on the screen is my name “Usman Ali Butt”. First i place the cursor at Row 2 Coulomb 14 and display my first alphabet ‘u’ at that place. Then i move my cursor one step back at location 13 and displays two alphabets ‘us’.  ‘u’ at 13 and ‘s’ at 14.Then again move the cursor one step back and now three characters are displayed ‘usm’. ‘u’ at 12 ‘s’ at 13 and ‘m’ at 14 location. The whole string is displayed on the lcd in this manner and it feels like string is moving. Actually you programmed it to do so.

Coming to the code. First include the necessary library reg51.h that is to be included in every project where you are using 8051(89c51,89c52,89s51,89s52 etc) series microcontrollers in your project. Then Port-3 pins 5 and 6 are used as rs(register set) and en(enable) pins for lcd control . If you dont know what they are you can have a good tutorial here. 

  • Lcd Pinout, Registers and Working Description.

Then I defined the string which i want to scroll on the lcd in the form of character array c[15].  Then some commands are defined they are actually moving the cursor one step back after each cycle. 

The rest of the code is delay() function to give necessary delay where needed. lcdint() Function to initialize lcd. lcdcmd() is sending commands to lcd. Display() function is sending data to lcd for display. Dont know Commands and Data Send to Lcd. Here is a good tutorial.

  • Difference Between commands and data send to lcd.

Port-1 is used to send data and commands to the lcd. Port-1 is connected to Data pins of lcd.         

Scrolling text with 89c51- Circuit Diagram

Scrolling text with 89c51- Circuit Diagram
Check Out the Project Video
Standard Lcd Commands Code

Second Method
The more easy way is to scroll the text using standard lcd commands. The code is same like the above method. The only change is in the main function & now the text which i am going to scroll is my web site name “microcontroller-project.com”.

In the main function only the command 0x18 is performing the function of scrolling-moving. It scrolls the printed letter to wards one step left. In the main function while loop prints each letter once and then calls the 0x18 command which moves whole of the text to wards left.From whole of the text i mean the letters which are printed previously and printed in the current instruction. 

Note: I am continuously scrolling the text on lcd.  

Moving Text on 16x2 lcd- Circuit Diagram

Moving Text on 16×2 lcd- Circuit Diagram
Check Out The project Video and compare it with the video of the above Method Code

 Moving Text With Standard Lcd Commands Code

Filed Under: 8051 Microcontroller, Electronic Projects

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Multiple DC/DC converters and a single input source
  • Xiaomi Mijia 1C Robot problem of going backwards while working
  • Will this TL084C based current clamp circuit work?
  • ADS optimization cockpit window does not open
  • Voltage mode pushpull is a nonsense SMPS?

RSS Electro-Tech-Online.com Discussions

  • Parts required for a personal project
  • Curved lines in PCB design
  • Wideband matching an electrically short bowtie antenna; 50 ohm, 434 MHz
  • using a RTC in SF basic
  • PIC KIT 3 not able to program dsPIC

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection
  • Convection-cooled power controller integrates EtherCat connectivity

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 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

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey 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
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe