Tuesday, November 24, 2015

HOW TO CONNECT A SERIAL LCD WITH AN ARDUINO NANO

HOW TO CONNECT A SERIAL LCD WITH AN ARDUINO NANO
I demonstrated how to connect the serial LCD to an Arduino UNO 
In this we have to describe how to connect the serial LCD to Arduino Nano
Step 1: REQUIREMENT’S

 LCD

  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 


 Arduino Nano

 Arduino Nano


  1. The Arduino Nano pinout diagram indicates clearly that the pin A4 and A5 is for SDA and SCL respectively.
  2. The Arduino Nano is placed on the breadboard.
  3. The black jumper cable is connected to GND pin on the LCD to the BND pin on the Nano
  4. The red jumper cable is connected to VCC pin on the LCD to the VCC pin on the nano.
  5. The green jumper cable is Connected to the SDA pin on the LCD to the A4 pin on the NANO
  6. The yellow jumper cable is Connected to the SCL pin on the LCD to the A5 pin on the NANO
  7. Load the Arduino IDE and upload the sketch

Step 3: The Sketch


//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(){ }

Step 4 : Feedback
After assembling the whole the LCD works according to the Arduino Nano.
Revert me the feedback of this…….

No comments:

Post a Comment