Challenge

Project 1 - Interfacing a 16*2 LCD with Arduino using I2C protocol

                                       Interfacing a 16*2 LCD with Arduino using I2C protocol

 AIM::   In this project implementing the Code for “Interfacing a 16*2 LCD with two Arduino’s (one for Master and one for Slave) using Inter-Integrated Circuit (I2C) communication protocol” by sending the message to LCD using I2C communication protocol and display the message on LCD screen.

INTRODUCTION:::

This is a 16x2 LCD display screen with I2C interface. It is able to display 16x2 characters on 2 lines, white characters on blue background.

Usually, Arduino LCD display projects will run out of pin resources easily, especially with arduino uno. And it is also very complicated with the wire soldering and connection. This I2C 16x2 Arduino LCD Screen is using an I2C communication interface. It means it only needs 4 pins for the LCD display: VCC, GND, SDA, SCL. It will save at least 4 digital/analog pins on Arduino. All connectors are standard . You can connect with the Jumping wires directly.

To avoid the confliction of I2C address with other I2C devices, such ultrasonic sensors, IMU, accelerometers, and gyroscope, the I2C address of the module is configurable from 0x20-0x27. And its contrast can be adjusted manually.

Another alternative option is i2c 20*4 lcd if more characters are required.

Several functions of Arduino's Wire Library are used to accomplish this. Arduino 1, the Master, is programmed to request, and then read, 6 bytes of data sent from the uniquely addressed Slave Arduino. Once that message is received, it can then be viewed in the Arduino Software (IDE) serial monitor window.

  • A serial clock pin (SCL) that the Arduino Master board pulses at a regular interval
  • A serial data pin (SDA) over which data is sent between the two devices.

a single bit of information - that will form in sequence the address of a specific device and a a command or data - is transferred from the board to the I2C device over the SDA line.

When this information is sent - bit after bit -, the called upon device executes the request and transmits it's data back - if required - to the board over the same line using the clock signal still generated by the Master on SCL as timing.

it is possible for your Arduino board to communicate (in turn) with many devices, or other boards, while using just two pins of your microcontroller.

#include

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
lcd.begin(16, 2);
}

void loop()
{
lcd.setCursor(1,0);
lcd.print("EMBEDDED WORLD");
lcd.setCursor(2,1);
lcd.print("EV APPLICATION");
delay(4000);
lcd.clear();
delay(5000);
}

Output: Using master and slave with UNO is connected to master and slave is connected to lcd 

for Output we can observe master uno  controlling the master the controlling result will display on slave lcd 

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.