LCD Display is just blue with no text [wrong wiring]

I have never used an lcd on Arduino before. I used Chat GPT to help write code to use as a stopwatch with a magnetic reed switch to tell how long it has been since I have last opened the oven. When Power on the Arduino, the [display] just shows bright blue with no text. (Amazon.com: HiLetgo 2pcs DC3.3V HD44780 1602 16x2 Character LCD Display Adapter Module Blue Backlight for Arduino UNO R3 MEGA2560 Nano Due Raspberry Pi : Industrial & Scientific) I have used a multimeter to check every connection between the Arduino and the display. I don’t have a 10k potentiometer so I am using different normal resisters to control the contrast.

The display was using too much power so I have connected a 5v power supply to the 5v out and GND

VSS: GND
VDD: 5V
V0 : Resister: Ground (I have tried multiple different resistance levels)
RS: Arduino Pin 7
RW: GND
E: Arduino Pin 8
D0-D3 : Left Unconnected
D4 : Arduino Pin 9
D5: Arduino Pin 10
D6: Arduino Pin 11
D7 : Arduino Pin 12
A: 5V
K : GND

ChatGPT's code;`

#include <LiquidCrystal.h>  // Include the LiquidCrystal library for LCD

#define OvenSwitch 2  // Define the pin for the oven switch

long ovenMillis = 0;  // Variable to store the time when the oven switch was last pressed
long elapsedMillis = 0;  // Variable to store the elapsed time since the oven switch was last pressed

// Initialize the LiquidCrystal object with the pin numbers where the LCD is connected
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

void setup() {
  lcd.begin(16, 2);  // Set up the LCD's number of columns and rows
  lcd.clear();  // Clear the LCD display
  
  pinMode(OvenSwitch, INPUT_PULLUP);  // Set the oven switch pin as an input with an internal pull-up resistor
  
  lcd.setCursor(0, 0);  // Set the cursor to the first column, first row
  lcd.print("Oven Last Opened");  // Print the message on the first row of the LCD
  
  ovenMillis = millis();  // Initialize ovenMillis to the current time in milliseconds
}

void loop() {
  if (digitalRead(OvenSwitch) == HIGH) {  // Check if the oven switch is pressed
    ovenMillis = millis();  // Reset ovenMillis to the current time in milliseconds
  }
  
  elapsedMillis = millis() - ovenMillis;  // Calculate the elapsed time since the oven switch was last pressed

  // Convert elapsed time into hours, minutes, and seconds
  unsigned long displaySeconds = (elapsedMillis / 1000) % 60;  // Calculate the seconds part
  unsigned long displayMinutes = (elapsedMillis / 60000) % 60;  // Calculate the minutes part
  unsigned long displayHours = (elapsedMillis / 3600000);  // Calculate the hours part

  lcd.setCursor(0, 1);  // Set the cursor to the first column, second row
  lcd.print("Time: ");  // Print "Time: " on the LCD
  lcd.print(displayHours);  // Print the hours part on the LCD
  lcd.print(":");  // Print the colon separator on the LCD
  lcd.print(displayMinutes);  // Print the minutes part on the LCD
  lcd.print(":");  // Print the colon separator on the LCD
  lcd.print(displaySeconds);  // Print the seconds part on the LCD
  lcd.print("  ");  // Print spaces to clear any extra characters on the LCD

  delay(400);  // Small delay to update the display every 400ms
}

`
Thank you for your help!

not just resistor. you need potentiometer(1k - 150k) or at least resistor voltage divider.

1 Like
  unsigned long displayMinutes = (elapsedMillis / 60000UL) % 60;  // Calculate the minutes part
  unsigned long displayHours = (elapsedMillis / 3600000UL);  // Calculate the hours part

Your word thing does not do it. An annotated schematic would be much better. I cannot tell from you picture what is connected to what. A pot will work much better.

1 Like

Thank you, I have a pot on order!

1 Like

You need the pot to adjust the backlight.
EDIT: The variable resistor is for adjusting the contrast, the backlight is software controlled and is either ON or OFF.

1 Like


Here is the sketch. Sorry it is still a bit confusing

willmilo,

I am doing a similar project and I found that using a I2C board to communicate with the LCD made life much easier.
The I2C board has a potentiometer built into it and you only need 4 wires.

Sal

3 Likes

Sorry I cannot follow that wiring diagram.

based on the first picture it seems that RW is not connected to anything.
Check your wiring and connect it to GND.

Did it work after the correction (as already pointed out by LarryD)?

  • Op was shown in post #5 about RW, no feedback. :woozy_face:

What!
So a POT and a Variable resistor is two different components.

How is the Backlight software controlled?
When it is hardwired to POS and NEG?

No, but getting the pot did allow me to adjust the contrast but there is still no text

Sorry, but the RW wire did not fix the issue

Is the VDD pin 5V?
Can you measure it to confirm.

  1. Please update the pictures so we can check the wiring. We must be able to identify EACH cable (on both sides).
    Also show a good picture so we can see all solderings of your NANO. Check yourself - it seems you are using a lot of solder, may be you have bridged some pins?!?

  2. Furthermore, don't use a chat-gpt generated code at the beginning.
    Use the hello world example which comes with the library.
    Adopt the pin definitions according to your wiring (better: redo the wiring according to the sketch). But make it consistent to the new pictures.
    if it doesn't work, also post that (adopted) sketch.

  3. Is it correct that you are using an Arduino Nano Every?

Someone asked me to clarify the use of the word POT. As to backlight, I offer this.

void setup()
{
  lcd.init();                      // initialize the lcd 
  lcd.backlight();
  Serial.begin(9600);
}

Update: Correction

That only works with a display that has an I2C backpack.

AH. Since I have never seen a reason to tie up all those extra pins, I have always used the backpack.
Should I go back and edit my previous erroneous comments?