lcd i2c module with arduino

Hello guys
today lets interface i2c lcd to arduino.

It is vary easy to use i2c lcd module with arduino.
you just need to connect only 4 wire in stand of tons of wire from lcd to arduino.

here is circuit diagram
I2C LCD PIN          ARDUINO PIN

vcc ---                                5v
GND ---                             GND
SDA   ---                            A4
SCL ---                              A5

and it is done

now what you need just download i2c lcd library and insert library to arduino

download library from hare 


here is the code for printing anything on display .......

--------------------------------------------------------------------------------------------------------------------
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>




LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup()
{
  
  // initialize the LCD
  lcd.begin();

  lcd.backlight();
  lcd.print("This is ER BROS"); // write here what you want to print
  
  
  
}

void loop()
{
  // nothing here for this program
}
-----------------------------------------------------------------------------------------------------------------

code for i2c address ..............

-----------------------------------------------------------------------------------------------------------------
/* find your i2c address
 *  
 *  for more videos about electronics prijects, tutorials  and many more
 *  ER BROS
 *  https://www.youtube.com/channel/UCY6KA8oFk1s36fyPiFEmedQ
 *  
 * blogs 
 * 
 * https://erbros1.blogspot.com/
 */


#include <Wire.h>

void setup() {
  Serial.begin (115200);
while (!Serial)
    {
    }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
  pinMode(13,OUTPUT); 
  digitalWrite(13,HIGH);
  Wire.begin();
  for (byte i = 1; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1); 
      } 
  } 
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");


void loop() {
}
---------------------------------------------------------------------------------------------------------------------




Comments

Popular posts from this blog

OLED display interface with Arduino

Binary Clock

timer switch