hi there. I'm trying to display some message on the LCD_I2C module through my nodeMCU module.
I am able to blink the backlight of the lcd screen but when I try to display some text it shows nothing. i tried adjusting the contrast but the same problem persists. Can anyone help me with what the cause must be ??
#include <LiquidCrystal_I2C.h>
#include <Streaming.h>
LiquidCrystal_I2C lcd(0x3F, 16, 2);
void setup() {
lcd.begin(16,2);
lcd.init();
lcd.backlight();
}
void loop() {
lcd << "hello" << endl;
}
First of all if you are using your nodeMCU module in place of an Arduino (rather than in addition to it) you will need to download the appropriate ESP8266 libraries.
You will also need an LCD library that can deal with both your particular I2C module (which you have not identified) and the ESP8266 processor. I suggest that you try the 'HD44780' library.
Also, at least at the beginning, you want to deal with displaying messages in setup(). Leave loop() empty between the { and } brackets until you get things working.
[edit] If you are powering your LCD from the 3v3 pin on the nodeMCU board, and if it is not a 3.3v device, then you may need to supply a negative voltage at LCD pin 3 in order to see anything.
Don
The hd44780 library works with esp8266 based arduino boards.
However, the esp8266/nodeMCU modules are 3v and the vast majority of LCDs with i2c backpacks are 5v.
You should use a voltage level converter in order to convert the voltage levels of the i2c signals.
Depending on the backpack you have it can potentially damage the esp8266 module.
voltage level converters are small and fairly inexpensive.
It can be confusing to get the correct one, as there are several different designs and they work differently.
Some are for converting 5v to 3v signals and supply a 3v power source.
Some are specifically for i2c.
You have to look carefully at the design to make sure it will work.
For this application you really don't want or need the type with the 3v power source output.
Depending on your backpack, it is potentially possible to cheat and play some games with external pullups
to make it work. This requires wiring the pullups in a particular way that is technically incorrect but can allow the devices to communicate.
My advice is not to continue to try to get this working until the voltage level issues are dealt with.
--- bill
bperrybap:
The hd44780 library works with esp8266 based arduino boards.
However, the esp8266/nodeMCU modules are 3v and the vast majority of LCDs with i2c backpacks are 5v.
You should use a voltage level converter in order to convert the voltage levels of the i2c signals.
Depending on the backpack you have it can potentially damage the esp8266 module.
voltage level converters are small and fairly inexpensive.
It can be confusing to get the correct one, as there are several different designs and they work differently.
Some are for converting 5v to 3v signals and supply a 3v power source.
Some are specifically for i2c.
You have to look carefully at the design to make sure it will work.
For this application you really don't want or need the type with the 3v power source output.
Depending on your backpack, it is potentially possible to cheat and play some games with external pullups
to make it work. This requires wiring the pullups in a particular way that is technically incorrect but can allow the devices to communicate.
My advice is not to continue to try to get this working until the voltage level issues are dealt with.
--- bill
Yep. Your advice helped. power was the issue. thanks.