I am experiencing an issue with my LCD display. The top row is completely white (filled with blocks) and does not display any text, while the bottom row remains blank. Here are the details of my setup:
Hardware:
Microcontroller: Arduino Uno
LCD Model: 16x2
Temperature Sensor: DHT11
Wiring: I am using the following pin connections:
LCD RS: Pin 12
LCD E: Pin 11
LCD D4: Pin 5
LCD D5: Pin 4
LCD D6: Pin 3
LCD D7: Pin 2
DHT11 Data Pin: Pin 6
Fan Control Pin: Pin 7
Here is the code I am using:
#include <dht.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // (RS, E, D4, D5, D6, D7)
// Button Pin
const int fanPin = 7;
const int tempPin = 6;
dht DHT;
void setup() {
lcd.begin(16, 2);
pinMode(fanPin, OUTPUT);
pinMode(tempPin, INPUT);
Serial.begin(9600);
}
void loop() {
DHT.read11(tempPin);
digitalWrite(fanPin, HIGH);
// Clear the LCD at the beginning of the loop
lcd.clear();
lcd.setCursor(0, 0); // Set cursor to the second line
lcd.print("Proj 3 - ");
lcd.print(round((DHT.temperature * 1.8) + 32));
lcd.print(" F"); // Add unit for clarity
// Print to Serial Monitor for debugging
Serial.println(round((DHT.temperature * 1.8) + 32));
delay(1000); // Wait for 1 second before the next reading
}
Troubleshooting Steps Taken:
Checked all wiring and connections multiple times.
Adjusted the contrast potentiometer.
Tested with a simple LCD example code (only displaying text).
Verified that the temperature sensor is functioning.
Tried a different LCD (if available).
Reinstalled the LiquidCrystal and dht libraries.
Power cycled the setup multiple times.
Observations:
The top row is completely white and does not display any text.
The bottom row remains blank.
The LCD was working previously with the same code.
Questions:
What could be causing the top row to display all white?
Are there any additional troubleshooting steps I can take to resolve this issue?
The controller for the LCD has a different address than you one you are trying to use. I have several of those LCD and many time I get the same result as you describe. Changing the program to use the second possible address results in perfect operation and display.
Note, there is also a sample program that comes with the IDE that will scan your display and tell you the correct address.
What address do you mean? Do you mean the LCD address? Because if so, I checked under my LCD and it said 1602, which means 16x2. I am pretty sure. If not, please help me find which address you're talking about!
I2C? I am thinking @noxid1 would have found it difficult to connect it to 6 Arduino pins if there was already a backpack soldered to the LCD. But let's see when photos are posted.
What do you get in most starter kits? An Uno, a breadboard, a 1602 LCD without a backpack, a DHT11...
My fan is a 2-pin 12V, and yes, it is connected. Then, on the Serial Monitor, I see the displayed temperature in my household between 70 to 72. Will this help?
I can't show a photo, but the rectangles where words and numbers can be displayed are white. When I turn the potentiometer, it dims, but it still doesn't display text.
If the display once worked with the soldering and code you have, the perhaps some of the header pins has lost connection. Are the headers pins plugged into a breadboard?
Why can't you show a picture of your soldering and how things are connected.
It's possible if everything was once working correctly and now it is not, then its possible that something (voltage spike, static, bad juju) damaged the hd44780 controller on the display and its broken.
What does this mean? Did you try a different display or not?
Or a fan connected directly to an Arduino pin with nothing to limit the current or protect from the negative voltage that would be generated when the fan is switched off...
My fan's GND is connected to the power source's GND, and the voltage is connected to the relay output. The power source voltage is connected to the relay output, then the relay GND is connected to the Arduino 5V, and the signal is connected to Arduino pin 7.
Have you tried without the fan and dht temperature sensor, and just run a simple lcd "HelloWorld" library example?
If simple code won't run and you wiring is correct as you insist, then either the controller on the lcd module is broken, or somewhere between the pin holes on the module and the connection to an Arduino pin there is a disconnect. Most frequently it is from the solder connections at the lcd, or the bread board connection where pins from the lcd are pressed in. Dupont connector wires are often defective and you can try change those.