1

I want to use I2C 20x4 LCD with my Raspberry Pi. It works when powered from 5V line of GPIO, but works also when powered from 3.3V line.

I know that this display in fact is designed to work powered with 5V. It works with 3.3V only because I adjusted contrast to maximum value.

I know that using 5V is not save for GPIO signal pins as they are not designed to get 5V signals.

My question is: Is that safe to use 3.3V line to power that display? I guess GPIO pins are OK with that solution, but won't it damage 3.3V line of Raspberry ?

Do I really need to use I2C logic level converter/shifter?

Added: I connected my display (in 3.3V connection variant) as in here. This guide is for OLED I2C display that is designed to work on 3.3V, but my I2C display is designed to work with 5V. I don't want to use 5V because lots of people says its not safe, as 5V display is returning that voltage to signal pins of Raspberry's GPIO that shouldn't be treated with 5V. Most of people says that to use 5V display I should use logic level converter that will trim returning voltage to 3.3V. But as I discovered my display works with 3.3V there is nothing to trim. However using 3.3V line is confusing as I don't know if now 3.3V line is not in danger. My Raspberry is RPi4 ver B.

  • Ah, let me see. Almost all the 20x4 LCD modules nowadays use I2C interface and 5V power. The modules use the LCD display controller HD44780, which is designed for Vcc = 2V7 to 5V0. The I2C interface is PCF8574 IO expander, which is also designed Vcc 2V5 to 6V0. In other words it is PERFECTLY SAFE to power the modules using Vcc = 3V3, and use Rpi 3V3 GPIO to control. One minor problem is that the black lit resistor is designed for 5V. So you need to adjust contrast/brightness to maximum, or replace the back lit serial resistor (usually easy). References; / to continue, ... – tlfong01 Mar 2 at 12:22
  • References: (1) Amazon SunFounder I2C 20x4 LCD Module (5V Power Supply) amazon.com/SunFounder-Serial-Module-Arduino-Mega2560/dp/…, (2) PCF8574 Remote 8-Bit I/O Expander for I2C Bus (2.5V to 6V Vcc) - NXP ti.com/lit/ds/symlink/pcf8574.pdf, / to continue, ... – tlfong01 Mar 2 at 12:22
  • (3) HD44780U Dot Matrix Liquid Crystal Display Controller/Driver (2.7V to 5.5V) - Hitachi sparkfun.com/datasheets/LCD/HD44780.pdf. Cheers. – tlfong01 Mar 2 at 12:23
2

Although your question does not make it clear how the display is connected I guess I²C. Like most devices on Amazon there is no meaningful documentation.

It is quite safe to connect to a 5V powered I²C device provided it has no pullups to 5V. The Pi has on-board I²C pullups to 3.3V.

I²C outputs are open-drain and you can safely connect devices to the Pi (regardless of their nominal operating voltage) provided they do not have pullups to 5V.
Open-drain can ONLY pull the voltage to Gnd - the only supply comes from the pullup resistors.

This enables the bus to be bi-directional. (Early computer systems using RTL logic had similar techniques for their data bus.)

The Pi output voltage levels may be marginal for some 5V devices although I have used the Pi with many 5V devices using I²C without level shifters.

You CAN use Level Shifters with I²C - although in this case BOTH sides should have pullups (the pullups on the Level Shifters are high value intended to bias the MOSFETs)

| improve this answer | |
  • 1
    Yes, I understand that if there is no pullups to 5V the GPIO logic pins are safe, but my question is about 3.3V pin: Is that connection safe for 3.3V power line? If I connect 5V display to 3.3V pin won't damage 3.3V converter inside Raspberry? BTW. I added missing information to my post. – A J Feb 29 at 12:05
  • 1
    @AJ I don't see how you would expect connecting an unpowered device to the Pi 3.3V power pin could possibly damage anything (provided it doesn't draw excessive current - which given the nature of the device seems improbable). It probably won't work. NOTE the 3.3V and 5V power pins are NOT GPIO – Milliways Feb 29 at 22:49
  • 1
    "because lots of people says its not safe" lots of people talk a lot of unmitigated rubbish about things they don't understand - of which electricity seems to be the most common. – Milliways Feb 29 at 22:53
  • So you suggest that logic level converters are unnecessary? Its just hard to believe for me that all these guides about connecting HD44780 to RPi are wrong. Most of these guides include diagrams containing logic level shifters/converters. They explain that's to prevent damage of GPIO pins: SDL and SCA which are designed for 3.3V while HD44780 backpacks SDL and SCL pins are using 5V. Now I already fitted level shifter and It works. I used diagram from here: raspberrypirobotics.com/control-a-hd44780-lcd-display-via-i2c Do you think is wrong ? – A J Mar 2 at 13:24
  • @AJ about 50% of the articles written about the Pi are wrong. They are written by hobbyists NOT experienced programmers or engineers. This includes the link you used which has obsolete software settings instead of Device Tree. – Milliways Mar 2 at 22:26

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.