I can't get a HR0075 16X2 Character LCD with I2C Interface to work with NodeMCU

Hello guys I bought a 1602 screen to connect to my NodeMCU. The screen needs 5v input to work and has a built-in I2C interface. At first I tried to power it from the VIN pin of the Node but it didn't even turn on. Later I bought a breadboard 5V output PSU so I got power from there and the screen turned on(measured 4,79V on the psu output) but I couldn't detect it with the I2C Scanner sketch and also I couldn't make anything to show up in the screen using the LiquidCrystal_I2C library. The eshop that I bought it says that the I2C address is the 0x27 and it can't be changed. I tried to connect it both to D3-D4 and D1-D2 I need some help troubleshooting. Did I do anything wrong?Is the I2C or the screen faulty or the voltage is not enough?

Image of the screen

You need to add a level shifter.

The PCF8574 has a HIGH threshold of 0,7 x Vcc = 0,7 x 5 = 3,5V. And a ESP8266 (NodeMCU) is a 3,3V device.

@septillion thank you for your reply. I now power the LCD from an externat breadboard PSU that gives about 4.8 volts and the screen turns on but only the backlight and the first row of the screen with black boxes.

kvais:
The eshop that I bought it says that the I2C address is the 0x27 and it can't be changed.

Does the "eshop" also sell dildos by any chance? :astonished: :astonished:

See the three jumpers on the board labelled "A0 A1 A2". Now what do you suppose they do?

Are you using the HD44780 library from the Library Manager? You should be. :grinning:

You seem to know how to use the forum. Please post your code here as code.

kvais:
@septillion thank you for your reply. I now power the LCD from an externat breadboard PSU that gives about 4.8 volts and the screen turns on but only the backlight and the first row of the screen with black boxes.

Yeah, so? That's what that display does when you connect power but don't send data... And the backpack doesn't see the commands from the ESP so does not send data to the screen.

@Paul__B Nope it’s doesn’t sell dildos. Now for the jumpers I know that you can use them to change the address.

From the seller’s site:

I2C Address: 0x27 ( address can’t be changed !!!).

Backlight (Black character on Yellow background)

Supply voltage: 5V

Size: 82x35x18 mm

Come with IIC interface, which can be connected by DuPont Line

\

The code is this

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup()
{
	// initialize the LCD
	lcd.begin();

	// Turn on the blacklight and print a message.
	lcd.backlight();
	lcd.print("Hello, world!");
}

void loop()
{
	// Do nothing here...

septillion:
Yeah, so? That's what that display does when you connect power but don't send data... And the backpack doesn't see the commands from the ESP so does not send data to the screen.

I am new to electronics. Where do I need to add the level shifter?

In the I2C lines :slight_smile:

Do you have any link to know what to buy?

For example 10PCS Logic Level Shifter Bi Directional two Four way two way logic level transformation module|arduino photoresistor|arduino buttonarduino duemilanove starter kit - AliExpress

Thank you!And how do I connect it?

Google broken? :wink:

kvais:
@Paul__B Nope it’s doesn’t sell dildos. Now for the jumpers I know that you can use them to change the address.

So you clearly know that the seller’s description is completely meaningless! :astonished: Fair enough. :grinning:

Frankly, I doubt that the levels are in any way the problem. You are using a “LiquidCrystal_I2C” library which is quite useless. Install Bill Perry’s HD44780 library in the IDE, study the documentation and work through the examples provided. It will automatically determine which I2C backpack that is, and operate the display. :sunglasses:


Ah! A little addendum:

Driving this with a NodeMCU you do need to remove the I2C pull-ups from the “backpack” and provide your own pull-ups - 4.7k - to 3.3 V to protect the ESP8266.

Paul__B:
So you clearly know that the seller’s description is completely meaningless! :astonished: Fair enough. :grinning:

Frankly, I doubt that the levels are in any way the problem. You are using a “LiquidCrystal_I2C” library which is quite useless. Install Bill Perry’s HD44780 library in the IDE, study the documentation and work through the examples provided. It will automatically determine which I2C backpack that is, and operate the display. :sunglasses:


Ah! A little addendum:

Driving this with a NodeMCU you do need to remove the I2C pull-ups from the “backpack” and provide your own pull-ups - 4.7k - to 3.3 V to protect the ESP8266.

But the I2C address is not detected by the Node

kvais:
But the I2C address is not detected by the Node

Not at all sure what you mean here. :astonished:

kvais:
but I couldn't detect it with the I2C Scanner sketch

:wink:

septillion:
For example 10PCS Logic Level Shifter Bi Directional Four way two way logic level transformation module|arduino photoresistor|arduino buttonarduino duemilanove starter kit - AliExpress

That type of shifter has more channels than are needed for an i2c bus.
I prefer the smaller 8 pin level shifters.
like this: https://www.ebay.com/itm/5-x-2-CH-I2C-IIC-Logic-Level-Converter-Module-Bi-Directional-5V-3V-for-Arduino/112141445790

They are smaller and, IMO, easier to use.
You simply hook the 5v to the VIN and DO NOT hook 3v from the Master to the 3v pin.
The 3v pin on the level shifter module is an output not an input.
It is intended to power 3v devices when going from 5v masters to 3v slaves.
In this case there is a 3v master talking to a 5v slave(s).

So to wire up with a NodeMCU

  • wire gnd to both gnd pins.
  • wire 5v to VIN
  • wire the 3v i2c signals to the 3v side
  • wire the 5v i2c signals to the 5v side
    (be consistent with signals, i.e if SDA is on A on 3v side put SDA on A on 5v side)
  • do not wire anything to the 3v pin on the level shifter
    If you have more i2c slaves, hook the 3v ones to the 3v side, and the 5v ones do the 5v side.

— bill