I buy new lcd 1602 but it dont work

Hi, I bought an lcd 1602 display in a store where the seller connected it to his board (connected via a bus), he connected it according to the following scheme:

#include <Wire.h>
#include <LiquidCrystal.h>
 
LiquidCrystal lcd(0);
 
void setup() {
  lcd.begin(16, 2);
  lcd.print("hello, world!");
}
 
void loop() {

  lcd.setCursor(0, 1);
  lcd.print(millis()/1000);
 
  lcd.setBacklight(HIGH);
  delay(500);
  lcd.setBacklight(LOW);
  delay(500);
}

gnd-gnd vcc-5V SDA- A4 SCL-5A and displayed text through this code
the display worked when I came and connected the same circuit with this the display did not respond with the code

#include <Wire.h> // библиотека для управления устройствами по I2C 
#include <LiquidCrystal_I2C.h> // подключаем библиотеку для QAPASS 1602

LiquidCrystal_I2C LCD(0x27,16,2); // присваиваем имя LCD для дисплея

void setup() {
   LCD.init(); // инициализация LCD дисплея
   LCD.backlight(); // включение подсветки дисплея
   
   LCD.setCursor(1, 0);     // ставим курсор на 1 символ первой строки
   LCD.print("I LOVE");     // печатаем сообщение на первой строке
  
   LCD.setCursor(8, 1);        // ставим курсор на 1 символ второй строки
   LCD.print("ARDUINO");  // печатаем сообщение на второй строке
}

void loop() {
   LCD.noDisplay(); // выключаем и включаем надпись на дисплее
   delay(1000);
   LCD.display();
   delay(1000);
}

its backlight did not turn on, while the board was serviceable and everything worked on the other display. maybe someone knows what the reason is?

Your topic has been moved to the Displays category of the forum

More details please

  • What sort of interface does the dispaly use to connect to the Uno R3 ?
  • How did you test it in the store ?
  • What does "not work" mean ?
  • What sketch are you running ?

If you have supplied all the information, and the LCD was connected and works on another Arduino, but does not work when connected on your Arduino, then you have a bad Arduino.

Run some basic sketches on your Arduino, including this pin check sketch that will tie all your DIO pins HIGH, showing a "1" in the Serial Monitor, and when you short a ground pin to any DIO pin, it will show as 0 in the Serial Monitor:

//**********************************************************************
// 1. Connect a jumper wire to GND
// 2. Upload the sketch
// 3. Touch the jumper wire to a pin 2 through 12 and A0 through A5
// 4. The output will show the pin(s) you are touching
//
// This shows pin D3 sensing ground through jumper...
// 12 11 10 D9 D8 D7 D6 D5 D4 D3 D2 A0 A1 A2 A3 A4 A5
//  1  1  1  1  1  1  1  1  1  0  1  1  1  1  1  1  1
//**********************************************************************

int pin[] = {13, 12, 11, 10, 9, 8,  7, 6, 5, 4, 3, 2, 14, 15, 16, 17, 18, 19};
int size = sizeof(pin) / sizeof(pin[0]);

void setup() {
  Serial.begin(115200);
  Serial.println("Pin State Reader");

  for (int i = 0; i < size; i++) {
    pinMode(pin[i], INPUT_PULLUP);
  }
}

void loop() {
  int size = sizeof(pin) / sizeof(pin[0]);
  Serial.println(F(" 13 12 11 10 D9 D8 | D7 D6 D5 D4 D3 D2 | A0 A1 A2 A3 A4 A5"));
  for (int i = 0; i < size; i++) {
    int state = digitalRead(pin[i]);
    if (i == 6 || i == 12)
      Serial.print(" |  ");
    else
      Serial.print("  ");
    Serial.print(state);
  }
  Serial.println();
  delay(1000);  // to allow jumper to be moved
}

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