How to Connect a Serial LCD With an Arduino Nano


62,128

35

6

In a earlier instructable I demonstrated how to connect the serial LCD to an Arduino UNO

https://www.instructables.com/you?show=PUBLISHED

Yesterday I wanted to use two Arduinos for an RF project and realized that I don't know how to use the serial LCD with the Arduino Nano. So with a bit of research I was able to connect it and decided to share it with you.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Here Is What You Need for This Project

  1. An Arduino Nano or a Nano compatible
  2. A solderless breadboard
  3. An LCD with an I2C
  4. Four jumper wires

Step 2: Connect the LCD and the NANO

I found a pinout diagram for the Arduino NANO which clearly indicates that the SDA and the SCL pins on the NANO are the A4 and the A5 pins.

Place the NANO on the solderless breadboard

Connect the black jumper cable from the GND pin on the LCD to the BND pin on the NANO

Connect the red jumper cable from the VCC pin on the LCD to the VCC pin on the NANO

Connect the green jumper cable from the SDA pin on the LCD to the A4 pin on the NANO

Connect the yellow jumper cable from the SCL pin on the LCD to the A5 pin on the NANO

Next step load the Arduino IDE and upload the sketch

Step 3: The Sketch

I already explained the sketch in details in the previous instructable

https://www.instructables.com/id/How-to-connect-a-s...

I just changed the output on the LCD to Happy Halloween

I will include the sketch with this instructable.

//load libraries
#include <Wire.h> #include <LCD.h> #include <LiquidCrystal_I2C.h>

//Define variables

#define I2C_ADDR 0x27 //Define I2C Address where the PCF8574A is #define BACKLIGHT_PIN 3 #define En_pin 2 #define Rw_pin 1 #define Rs_pin 0 #define D4_pin 4 #define D5_pin 5 #define D6_pin 6 #define D7_pin 7

//Initialise the LCD LiquidCrystal_I2C lcd(I2C_ADDR, En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

void setup() { //Define the LCD as 16 column by 2 rows lcd.begin (16,2); //Switch on the backlight lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE); lcd.setBacklight(HIGH); //goto first column (column 0) and first line (Line 0) lcd.setCursor(5,0); //Print at cursor Location lcd.print("HAPPY"); //goto first column (column 0) and second line (line 1) lcd.setCursor(3,1); lcd.print("Halloween"); } void loop(){ }

1 Person Made This Project!

Recommendations

  • Made with Math Contest

    Made with Math Contest
  • Multi-Discipline Contest

    Multi-Discipline Contest
  • Robotics Contest

    Robotics Contest

6 Discussions

0
None
Aleksandre1988

6 months ago

Hello guys. One question. Can I use instead DigitalPin 2 > DigitalPin 8 ??? Because I need DIgitalPin 2 for AttachInterrupt Coin Acceptor ... Thank you in advance

1 reply
0
None
eliesalameAleksandre1988

Reply 6 months ago

I am not using any digital pins in this project, which line in the code are you referring to ?

0
None
MechEngineerMike

1 year ago

I cant figure out how to favorite with the new site interface so leaving a comment to remember it. Great work making this easy to follow!

0
None
AntoniaA9

1 year ago

My LCD does not display the characters and I did exactly as above. Any idea why this could happen?

0
None
aaviles5

3 years ago

you didnt include the lcd.h library for us to download