Lcd Project With Led on or OFF With Arduino
by Rachna Aggarwal in Circuits > Arduino
2188 Views, 1 Favorites, 0 Comments
Lcd Project With Led on or OFF With Arduino

In this project , we will add LCD with controlling led with push button project. To learn how to connect LCD with Arduino click on this link.
Components Required
- Arduino - https://amzn.to/32jAMUA
- 16 X 2 LCD Display - https://amzn.to/35VXFQl
- Potentiometer 10Kohms - https://amzn.to/2ZuPNRN
- 220 ohms resistor - https://amzn.to/2ZuPNRN
- Jumper wires - https://amzn.to/3iqdBxM
- push button - https://amzn.to/3kFPn33
- led - https://amzn.to/3iUmIad
Circuit Schematic

Arduino Code
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int data =0;
void setup() {
pinMode(13, OUTPUT);
pinMode(8, OUTPUT);
pinMode(A0, INPUT);
digitalWrite(8,LOW);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// set the cursor to column 0, line 0
lcd.setCursor(0, 0);
// Print a message to the LCD.
lcd.print("Home Automation");
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print("Tubelight: ");
}
void loop() {
data= digitalRead(A0);
if(data == HIGH) {
digitalWrite(13,HIGH);
lcd.setCursor(13,1);
// comment this command to see the difference without it
lcd.print(" ");
lcd.setCursor(11,1);
lcd.print("ON");
}
else{
digitalWrite(13,LOW);
lcd.setCursor(11,1);
lcd.print("OFF");
} }