Menu

Scrolling Text in LCD using Arduino

You might have seen the Scrolling Text Display at the door of the shops, cafe, restaurant, etc. in the market. You might wonder that you can these kind of stuff with little Arduino.

Today, we are going to learn how to make a scrolling text (Left, Right) in Liquid Crystal Display (LCD) using Arduino. Here is the list of the items you need before beginning the project.

  • Arduino Board (Uno, Duemilanove, Zero, etc. any one)
  • LCD Display
  • 10k Potentiometer
  • breadboard
  • wires and header pins

 

Now, before interfacing the LCD with Arduino, you need to solder the 14 or 16 pins header strips into your LCD display. Then you have the connector pins in your LCD to connect with any thing else. Here we are going to connect LCD with Arduino. You can connect the pins as follows.

  • LCD RS pin to digital pin 12
  • LCD Enable pin to digital pin 11
  • LCD D4 pin to digital pin 5
  • LCD D5 pin to digital pin 4
  • LCD D6 pin to digital pin 3
  • LCD D7 pin to digital pin 2

Then connect the 10k potentiometer to +5V and GND with its output to VO pin (pin 3) of LCD. Please take a reference from the image below for proper connection.

pukar_tech_scrolling_text_arduino

 

Also see the simple circuitry diagram for the connection.

 

 

pukar_tech_scrolling_text_arduino_2

 

Now load the below code to your Arduino.


// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
delay(1000);
}

void loop() {
// scroll 13 positions (string length) to the left
// to move it offscreen left:
for (int positionCounter = 0; positionCounter < 13; positionCounter++) {
// scroll one position left:
lcd.scrollDisplayLeft();
// wait a bit:
delay(150);
}

// scroll 29 positions (string length + display length) to the right
// to move it offscreen right:
for (int positionCounter = 0; positionCounter < 29; positionCounter++) {
// scroll one position right:
lcd.scrollDisplayRight();
// wait a bit:
delay(150);
}

// scroll 16 positions (display length + string length) to the left
// to move it back to center:
for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
// scroll one position left:
lcd.scrollDisplayLeft();
// wait a bit:
delay(150);
}

// delay at the end of the full loop:
delay(1000);

}

 

Leave a Reply

Your email address will not be published. Required fields are marked *