LiquidCrystal LCD not working? [Wrong wiring]

Good day,

i am new to arduino and got me a Arduino Uno with some starter projects. Now i want to make my "own" project from the things i got and wanted to start with showing a temperature on the LiquidCrystal LCD. My sketch is as follow:

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

const int sensorPin = A0;

void setup(){
Serial.begin(9600); //öffnet die serielle Schnittstelle mit dem PC um die Daten anzuzeigen
lcd.begin(16, 2);
pinMode(6, INPUT);
lcd.print("TEST");
lcd.setCursor(0, 1);
lcd.print("TEST2");

}

void loop(){ //Startet den LOOP
int sensorVal = analogRead(sensorPin); //Erstellung eines Integers, welcher Analogwert ausliest
Serial.print("Sensor: "); //Legt den Namen für den Serial Monitor fest
Serial.print(sensorVal); //Legt welcher Wert angezeigt werden soll
float voltage = (sensorVal/1024.0*5.0);
Serial.print(", Volt: ");
Serial.print(voltage);
Serial.print(", °C: ");
float temperature = (voltage - 0.5)*100;
Serial.println(temperature);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(temperature);
lcd.setCursor(0, 1);
lcd.print(voltage);
delay(1000);
}

Unfortunately i do not see anything on display. Am i missing something? The LCD LEDs are turned on..

Welcome to the forum

You started a topic in the Uncategorised category of the forum when its description explicitly tells you not to

Your topic has been moved to a relevant category. Please be careful in future when deciding where to start new topics

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.

1 Like

thanks for your response and the informations. I have followed your steps. Please find the code in the following:

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

const int sensorPin = A0;

void setup() {
  Serial.begin(9600);  
  lcd.begin(16, 2);
  pinMode(6, INPUT);
  lcd.print("TEST");
  lcd.setCursor(0, 1);
  lcd.print("TEST2");
}

void loop() {                             
  int sensorVal = analogRead(sensorPin);  
  Serial.print("Sensor: ");               
  Serial.print(sensorVal);                
  float voltage = (sensorVal / 1024.0 * 5.0);
  Serial.print(", Volt: ");
  Serial.print(voltage);
  Serial.print(", °C: ");
  float temperature = (voltage - 0.5) * 100;
  Serial.println(temperature);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print(temperature);
  lcd.setCursor(0, 1);
  lcd.print(voltage);
  delay(1000);
}

What do you see on the LCD ?

Has the LCD got a contrast pot on the back ?

I can see that the LCD is turned on, as the background LED's are lightened, but I do not see anything on it. I have connected a contrast pot to it. when I change it nothing happens.

Hi, @zauberwald
Welcome to the forum.

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Can you post some images of your project?
So we can see your component layout.

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

Have you soldered the pcb header pins to the display, or only pushed them in?

Hello zauberwald

Post a picture of the hardware used.

It works in a simulation:

1 Like

My hardware looks as follows:

Here's your circuit as I deciphered it from your picture, minus the switch and the temperature sensor. Your sketch was used unaltered. Once I adjusted the 10K contrast pot, the LCD worked as expected. So your sketch is fine, and if I have indeed matched your wiring, that's correct as well.

I'd check the series resistor you have in the backlight anode circuit. I can't make out what value it is from the picture. I just hooked mine up direct and relied on the on-board series resistor. I'd also double check that trim pot. I don't see any connection from it to where you have the wire connected to Vo plugged into.

1 Like

  • What is the value of your LCD backlight resistor ?
3 Likes

Hello zauberwald

Check Vss connection:

grafik

2 Likes

That looked odd to me too but I think it's just perspective playing tricks. If you count pins from the other end where things line up better, it appears to be correct.

Yeah, that joint is iffy looking on a second look.

I would recommend getting an I2C module, once you plugg it to ur LCD, you will only need 4 pins, that will help you avoid getting lost with too many pins.

  • My obsessive/compulsive old man rule is to never use (large) header pins in the holes next to the center ravine.
  • I try to keep them pristine :woozy_face:

:older_man:

My swiss pins and I agree with you.

1 Like
  • Well that’s a different story, I like those machine pins very very mutch.

:+1: