Problem with LCD LCM1602C V2.1

looked all over google, and found no solution.

LCD is part of the Arduino starterkit.
The LCD is lighted up but no text whatsoever… I think all the connections and pins are correct.
I even changed to the example below “hello world” code and still no text.
I switched the resistor to a 10K, still no change.

I noticed a weird thing: when I take off the 5V connection from the breadboard, the LCD stays on. ??!

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print(“hello, world!”);
}

void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
}

So is it a faulty LCD?

Well, are you sure the wiring is correct?
Obviously its not normal for the LCD to stay ON when you remove its power source, so my guess is you have a wrong wiring !!!

Look carefully at the blue and red lines on your breadboard. The gap in each of the lines means that the corresponding row of pins also has a gap.

Due to that gap your LCD is not being powered by the red wire at the upper left corner of your breadboard. It is instead being powered via the signals coming in on the data lines -- not a good scenario.

Don

floresta:
Look carefully at the blue and red lines on your breadboard. The gap in each of the lines means that the corresponding row of pins also has a gap.

Due to that gap your LCD is not being powered by the red wire at the upper left corner of your breadboard. It is instead being powered via the signals coming in on the data lines -- not a good scenario.

Don

Thanks,

What do you propose the solution should be?
I tried taking off the blue line if that is what you meant, nothing happened. Still no text.

You have to put in four short horizontal jumpers, two on the top and two on the bottom, near the number '30' that is printed on your board. The jumpers will be parallel to the red and blue lines and will bridge the four gaps.

Don

xArduinoUno:
I tried taking off the blue line if that is what you meant, nothing happened. Still no text.

I cannot fathom what you mean by "taking off the blue line".

floresta:
You have to put in four short horizontal jumpers, two on the top and two on the bottom, near the number ‘30’ that is printed on your board. The jumpers will be parallel to the red and blue lines and will bridge the four gaps.

Don

I have done that. The screen is now brighter, but I still have no text and instead either flashing white boxes or just what looks like Chinese characters or nothing displaying. It is really random!

Let's see a new photo. Pull out a little further so we can follow the wires and see the display.

Don

floresta:
Let’s see a new photo. Pull out a little further so we can follow the wires and see the display.

Don

Thank you, I got it working by wiring it through the main smaller breadboard somehow!!
Im running through a few problems though:

  1. The LCD sometimes just stops displaying proper text and displays random gibberish and question marks etc…
    plugging off the power or re-uploading the code seems to fix it, but it happens randomly. So it is not very reliable. I even tried another LCD.

this is my code:

#include <LiquidCrystal.h>

#define aref_voltage 3.3

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int tempPin = 1;
int tempReading;
int ledPin = 13;
int fan = 11;
int tempMin = 21;
int tempMax = 24;
int fanSpeed;
int fanLCD;
int photocellPin = 0;
int photocellReading;

void setup()
{
Serial.begin(9600);
analogReference(EXTERNAL);
pinMode(ledPin, OUTPUT);
pinMode(fan, OUTPUT);
pinMode(9, OUTPUT);
lcd.begin(16, 2);
lcd.clear();
}

void loop()
{

photocellReading = analogRead(photocellPin);
Serial.print("Analog reading = ");
Serial.println(photocellReading);
lcd.setCursor(0, 0);

//getting the voltage reading from the temperature sensor
tempReading = analogRead(tempPin);

// converting that reading to voltage, which is based off the reference voltage
float voltage = tempReading * aref_voltage;
voltage /= 1024.0;

// now print out the temperature
float temperatureC = (voltage - 0.5) * 100 ; //converting from 10 mv per degree wit 500 mV offset
Serial.print(temperatureC); Serial.println(" degrees C"); //to degrees ((volatge - 500mV) times 100)

// now convert to Fahrenheight
float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0;
Serial.print(temperatureF); Serial.println(" degrees F");
if((temperatureC < tempMin) && (photocellReading > 300)) {
fanSpeed = 0;
digitalWrite(fan, LOW);
digitalWrite(ledPin, LOW);
lcd.clear();
lcd.print("TEMP: ");
lcd.print(temperatureC); // display the temperature
lcd.write(0b11011111);
lcd.write("C ");
lcd.setCursor(0, 1); // move cursor to next line
lcd.print("FANS: OFF ");

}

if ((temperatureC >=tempMin) && (temperatureC <= tempMax) && (photocellReading > 300))
{
fanSpeed = map(temperatureC, tempMin, tempMax, 100, 255);
analogWrite(fan, fanSpeed);
digitalWrite(ledPin, HIGH);
fanLCD = map(temperatureC, tempMin, tempMax, 0, 100);
lcd.clear();
lcd.print("TEMP: ");
lcd.print(temperatureC); // display the temperature
lcd.write(0b11011111);
lcd.write("C ");
lcd.setCursor(0, 1); // move cursor to next line
lcd.print(“FANS: “);
lcd.print(fanLCD); // display the fan speed
lcd.print(”%”);

}

if((temperatureC > tempMax) && (photocellReading > 300))
{
digitalWrite(fan, HIGH);
analogWrite(9, 200);
delay(1500); // wait for a delayms 1000ms
analogWrite(9, 0); // 0 turns it off
delay(1500);
lcd.clear();
lcd.print("TEMP: ");
lcd.print(temperatureC); // display the temperature
lcd.write(0b11011111);
lcd.write("C ");
lcd.setCursor(0, 1); // move cursor to next line
lcd.print("FANS: MAX ");
}
if (photocellReading <= 300)
{
digitalWrite(fan, LOW);
digitalWrite(ledPin, LOW);
lcd.clear();
lcd.print("TEMP: ");
lcd.print(temperatureC); // display the temperature
lcd.write(0b11011111);
lcd.write("C ");
lcd.setCursor(0, 1); // move cursor to next line
lcd.print(“POWER SAVING”);

}
delay(1000);
}

Adding the delay at the end makes Problem 1 less frequent.

Problem 2, nothing to do with the LCD!

  1. Im using a cooler master 12V PC fan and powering it with 8x 1.5V AA batteries.
    problem is, the code worked on it before with the KSD882 NPN Transistor, but stopped working now and I think I might have fried the transistor.
    I tried other transistors but the same thing happens, the moment I power it, it just starts running full speed no matter what.
    Im wiring according to this, http://aksoapy29.comoj.com/Pages/Tutorials/Arduino%20DC%20Motor%20Controller/diagram.png

First of all go back and edit your previous posts to put the code in a ‘code box’. Highlight the part of each post that is code and then click the ‘code’ icon. These icons tend to move around but it is the one that looks like a scroll with < and > symbols in front.

As far as your display problem is concerned…

  • You should try to avoid using lcd.clear in your loop.
  • The words or symbols that never change should be written once, in setup
  • The values or words that do change do not have to be cleared, they can just be overwritten.
    (You may have to add spaces if you are overwriting a long phrase or number with a shorter one)

Start a new thread for your new problem.
Use the ‘link’ icon to make your link ‘clickable’. The link icon looks like a chain link with something round and green in front of it. (If they didn’t have so many smileys they could have made the icons large enough to decipher.)

Don