0

I have uploaded a program to NodeMCU , to print "hello, world" on JHD162A 16x2 LCD module. But the text doesn't appear on the lcd display. Instead just black blocks appear on the first row on the LCD. I assume it's a hardware related issue since the software worked in simulation. I powered the NodeMCU and the LCD using 5V DC from 7805 voltage regulator IC. The 12v input to the IC is provided using a 230V AC to 12V DC adapter with 2A max current out. I have placed a 680 ohms resistor to the anode of the lcd back led, also a 1K resistor between the Vss and Vee of the LCD to set contrast. I am using D0, D1, D2, D3 pins of the NodeMCU to the D7, D6, D5, D4 data pins of the LCD. The RW is connected to the gnd pin of NodeMCU. The RS and E pins are connected to the D8 and D7 of NodeMCU.

#include<LiquidCrystal.h>

const int RS= D8, EN = D7, d4 = D3, d5= D2, d6 = D1, d7 = D0; 

LiquidCrystal lcd(RS, EN, d4, d5, d6, d7);

void setup()  
{
lcd.begin(16, 2);
lcd.print("hello, world!");
}

 void loop() 
{
lcd.setCursor(0, 1);
lcd.print(millis() / 1000); 
}
  • Avoid using D8 (GPIO15), D4 (GPIO2) and D3 (GPIO0) as they have special boot-controlling uses. – Majenko Mar 12 at 15:54
  • @Majenko That worked ! Thank you so much. – maheshmt Mar 13 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.