This circuit integrates an ESP32 microcontroller with a 16x2 I2C LCD screen. The ESP32 is responsible for controlling the display on the LCD, which shows messages in a loop with specified delays. The communication between the ESP32 and the LCD is established via the I2C protocol, utilizing the SCL and SDA lines for clock and data respectively.
/*
* This Arduino Sketch interfaces an ESP32 with an I2C LCD 16x2 screen.
* The ESP32 displays two messages on the LCD screen in a loop with delays.
* Connections:
* - ESP32 GND to LCD GND
* - ESP32 Vin to LCD VCC (5V)
* - ESP32 D22 to LCD SCL
* - ESP32 D21 to LCD SDA
*/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
Serial.begin(115200);
lcd.init();
lcd.backlight();
lcd.print("Welcome");
delay(2000);
lcd.init();
lcd.backlight();
lcd.print("WOMEN SEC/AUTOBOT");
delay(2000);
}
void loop() {
delay(1000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("READ CAMERA/AUTOBOT");
delay(2000);
}
File Name: sketch.ino
Description: The code initializes the I2C LCD screen and prints a welcome message followed by "WOMEN SEC/AUTOBOT". In the loop, it periodically clears the screen and prints "READ CAMERA/AUTOBOT". The serial communication is started at a baud rate of 115200 for debugging purposes.