LCD 16×2 not Lighting Up for Automatic watering system

Help Needed: LCD Display Not Lighting Up in Arduino Automatic Watering System

Hey Arduino Community!

I'm currently working on a project to create an automatic watering system using an Arduino Uno R3 board, a 16x2 LCD display, a water pump, and a soil moisture sensor. However, I've hit a roadblock and could really use some assistance.

The issue I'm facing is that my LCD display isn't lighting up at all. I've double-checked all the connections, made sure the code is correct. Here's a rundown of my setup:

Arduino Uno R3 board
16x2 LCD display
Water pump
Soil moisture sensor

I've followed tutorials and guides closely, but I can't seem to figure out what's causing the problem.

If anyone has experienced a similar issue or has any suggestions on how to troubleshoot this problem, I would greatly appreciate your help. This is the code i am using:

#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
Serial.begin(9600);
lcd.init();
lcd.backlight();
lcd.clear();
pinMode(2, OUTPUT);
digitalWrite(2, HIGH);
delay(1000);
lcd.setCursor(0, 0);
lcd.print("IRRIGATION");
lcd.setCursor(0, 1);
lcd.print("SYSTEM IS ON ");
lcd.print("");
delay(3000);
lcd.clear();
}

void loop() {
int value = analogRead(A0);
Serial.println(value);
if (value > 950) {
digitalWrite(2, LOW);
lcd.setCursor(0, 0);
lcd.print("Water Pump is ON ");
} else {
digitalWrite(2, HIGH);
lcd.setCursor(0, 0);
lcd.print("Water Pump is OFF");
}

if (value < 300) {
lcd.setCursor(0, 1);
lcd.print("Moisture : HIGH");
} else if (value > 300 && value < 950) {
lcd.setCursor(0, 1);
lcd.print("Moisture : MID ");
} else if (value > 950) {
lcd.setCursor(0, 1);
lcd.print("Moisture : LOW ");
}
}

Hello lucky_not345

Welcome to the world's best Arduino forum ever.

I´ve made cross check.
The sketch is running.
You have to check the wiring.

HTH

Have a nice day and enjoy coding in C++.

1 Like

I moved your topic to an appropriate forum category @lucky_not345.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

Hi, @lucky_not345

Load the example code that comes with the library, see if that works.

Thanks.. Tom... :grinning: :coffee: :+1: :australia:

TPX

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.