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 moving(scrolling) text on 16×2 lcd with arduino uno

July 12, 2019 By EG Projects

Moving or scrolling a text on 16×2 lcd or any size of character lcd is not a hard task. It only requires knowledge of how the character lcd works? What are its configuration commands? Internal registers and structure of character lcd controller. I advice you to please first take some tutorials on getting stated with character lcd’s. This will help you to understand the circuit diagram and arduino code below.

16×2 Lcd Pin Out and Working

Commands and Data send to 16×2 lcd

16×2 lcd in 4-bit and 8-bit mode – Difference

Techniques to move or scroll text on 16×2 lcd with arduino uno

All the character lcd’s have HD44780 controller in them. HD44780 lcd controller is responsible to receive intrusions from external microcontroller and display characters on lcd. Since all the character lcds have HD44780 controller in them so the techniques which i am going to discuss below can work on all character lcd’s.  

There are two methods to move(scroll) text on any character lcd(8×1,8×2,8×4,16×1,16×2,16×4,20×1,20×2,20×4). 

  • Manually using coding techniques.
  • Using standard lcd commands.

First method – Manually scroll text on lcd with coding technique

Moving scrolling text on NXN lcd using code manipulation required you to be very genius in programming and especially dealing with arrays. Arrays of all data types. This project consists of only just few lines with a single character array(To be moved scrolled on screen).   ​

How coding technique works?

In coding technique i pick character from array, print it on first location of lcd, then move it to second location and then print second character on first location then move first character on third location second character on second location and third character is printed on the first location. Applying his technique on characters makes characters to look like moving. Hope it makes sense to you people.

Scrolling text on 16×2 lcd screen using arduino uno – Circuit diagram

16×2 lcd is interfaced with arduino uno in 4-bit mode(don’t know take the above recommended tutorials). Circuit diagram of the project is given below.
Scrolling text on lcd with arduino uno

Scrolling text on 16×2 lcd with arduino uno

Moving(Scrolling) Text on lcd with arduino uno

Moving(Scrolling) Text on lcd with arduino uno

How and what is displayed on 16×2 lcd with arduino uno

First line of the lcd displays “Moving Text!!!“. On second line you will see moving string. String originates from left and terminates on right and after termination it again comes out from left. 

Their are two logic’s in the code that needs to be understood. First the character is displayed on left and then it moves a head to right and on each step every character moves a head right. Like, My first character is ‘U‘ it first displayed on lcd’s second line matrix no 14 and then it moves a head to right to matrix 13. On 14 matrix second character originates then they both are moved at 12 (‘U‘) and 11 (second) matrix and the matrix 14 is occupied by the 3rd Alphabet.

​The whole cycle completes like this and the string moves(Actually their is no movement but you programmed it to do so). Second Logic is how the characters are moved out from the last address from right.The last address to right is 1(start of the second line of lcd). Actually i drop the elements of the string one by one and it seems to be that the string is going out.  

This code manipulation method is messy and requires lo of contains to be taken in to consideration before writing code logic. Final code for arduino becomes too lengthy is we utilize this method in our project. Also flickering could be an issue if their is break or delay in code statements.   
Moving text code/files 

Second method – Using Standard Lcd commands

Scrolling text using standard lcd commands is easy. You can scroll text left and right. I am going to scroll it to right. To scroll to right standard command is 0x18(Hexadecimal) or 00011000(Binary). To scroll to left command is 0x1C(Hexadecimal) or 00011100(Binary). I am scrolling my website name “www.microcontroller-project.com“.

Lcd(16×2) is interfaced in 4-bit mode with arduino uno. Same circuit as given above. 16×2 lcd hd44780 lcd controller standard set of commands are below. 

16x2 lcd hd44780 controller command set

16×2 lcd hd44780 controller command set

In setup loop i initialized the lcd. In loop function i placed cursor at first index of lcd(Coulomb-1, Row-1). Then i start displaying text on lcd. When 14 characters were displayed, I started scrolling the text. Scrolling command is placed in if(i>=14) condition statement. So when 14 characters are on lcd text starts scrolling on 16×2 lcd.

Auto scrolling text command is also present in arduino LiquidCrystal library. leftToRight() and rightToLeft() are functions present in arduino Liquid crysral library whicha utomatially can move the text is either directions. You can also import them for scrolling. But if you want to do scrolling by your self. Include the code given below in your project. Predefined Auto Scrolling command in LiquidCrystal library is same, they also works on 0x18, 0x1C commands. Actually these commands are lcd predefined commands in data sheet of HD44780 and lcd supports them. So writing them by your self or using arduino predefined library means same.  

Download the project files. Folder contains the project code and .ino file of arduino uno project. Simulation of the project is also in the project folder. Simulation is made in Proteaus 8.0. Give us your feed back on the project.

Watch the project video Here….

Scrolling text on lcd project folder

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

  • Arduino’s L293D motor driver shield guide
  • NXP launches its first Wi-Fi 6E Tri-Band system-on-chip
  • Nexperia launches industry’s first 80 V RETs for high-voltage bus circuits
  • TDK releases low-profile medical sensors
  • Getting started with Raspberry Pi
...

RSS EDABOARD.com Discussions

  • Power controll on 230V with zero switching and PWM?
  • hysteresis variation mc sim
  • Creepage distance from primary to secondary of offline SMPS
  • HSPICE Simulation refuses to match the Spectre Simulation
  • Same geometry but slightly different results

RSS Electro-Tech-Online.com Discussions

  • How do I find the value of an exploded ceramic capacitor?
  • Any advice on identifying the HV wires on an old flyback.
  • How are you managing with the Covid-19 pandemic?
  • zener diode problem
  • Where has the fun gone?
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