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); 
  • 1
    \$\begingroup\$ The black rectangles on the first row of the display is a common symptom of having skipped the necessary LCD controller initialization before attempting to display characters. Make sure you have the proper initialization in place. \$\endgroup\$ – Michael Karas Mar 12 '19 at 14:08
  • \$\begingroup\$ I did initialize the lcd. Some the guys with me had the same issue with different softwares. We used the arduino isp with nodemcu board installed. But they did get their LCDs working when used with I2C module. \$\endgroup\$ – maheshmt Mar 12 '19 at 14:28

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.