3.3v Arduino, I2c backpack to 5v LCD

Has anybody else played with using a 3.3v Arduino (or ESP8266) using the I2C backpack interface to a normal 5v 1602 LCD display for example? The I2C is bidirectional but uses open collector drive with pullup resistors so if I have the pull-up tied to the 3.3v, then it should work although the levels for 0 and 1 on the backpack parts are not very well spec'd - I would assume that 3v or more would be seen as a high. Anybody else played with that? (Most of the LCD units out there want 5v).

Thanks!

Just checked the specs on the HD44780 and the PCF8574, both datasheets say they can run on 2.6 Volts up to 5. Probably the only thing craving a full 5 Volts might be the backlight. I'd say give it a go, certainly nothing to lose but some time.

You will probably have to provide a negative supply for the backlight circuit since VO (pin 3) must typically be about 4.7 volts below VCC. This may not be a trivial exercise since you are dealing with an I2C adapter as well.

Don

Don,
I think he is talking about still running the PCF8574 backpack and LCD at 5v but using pullups on SCL and SDA to 3v instead of 5v.
Done this way, the pins connected to the LCD would still be 5v so the LCD wouldn't know the difference.

However, the Phillips/NXP PCF8574 spec says VIH is .7VDD so if it is powered at a full 5v then 3.3v would be out of spec but might still work.

I've cheated like that on some projects and I do know that 3.3v directly connected to the HD44780 interface pins or KS0108 interfaces did work even though it was slightly out of spec.
However, in this situation all that matters is the SCL & SDA pins as the LCD would still be running at 5v.

I've not tried it with a PCF8574 on the SCL and SDA pins.

It shouldn't be difficult to try and, done correctly, there is no risk of damaging anything.

Since some PCF8574 backpacks include their own pullups to supply voltage, it is critical that any of those would have to be removed.

--- bill

Yes, bperrybap (Bill) has what I want to do correct which should keep everybody from seeing over voltage conditions. Interesting comment about some of the backpacks having their own pull-ups - I was not aware of that so that is a potential issue. I will spend some time looking at the PCF8574 datasheet (my wife thinks I'm nuts - she likes to sit down and read a good book while I like to study a data sheet for some chip or another :o )

A quick search on that chip did turn up an app note on "level shifting in i2c designs" (basically using the same level shifter diagram that Sparkfun sells on a little board). AN10441.pdf

Adafruit also has an app note on level shifting on the I2C (or other) that is basically the same method. https://cdn-shop.adafruit.com/datasheets/an97055.pdf

On the other side, if I drop the 5.0 v to the LCD to 4.7v, then 0.7 * 4.7 = 3.3v I guess it comes down to hooking it up and try it. Have some LCD displays, but need to get a couple of the backpacks - time to order more parts I guess (it doesn't matter how big your junk box is, a key part is ALWAYS missing !! )

Also came across this article in the Arduino Playground that addresses the subject. The conclusion is a very definite "maybe" and "it depends" as to it will work without the level shifters or not.

You can buy i2c level shifters on ebay for less than $1 USD.
(I just recently bought some.)
So if you are getting ready to order a few LCD backpacks (also less than $1 USD on ebay), then you might want to also order a few level shifters as well.
(search for "i2c level converter")

Pay close attention as there are different designs. Some convert the 5v to create the 3v for the low side.
Others match between the voltages and need both voltages.

I bought 2 different types, in packs of 5 for under $1.50 for each pack of 5.

--- bill

Ok,
So I got curious to see if this would work.
I hooked up a Teensy LC which is 3v only and ran the LCDs with backpacks at 5v and used external 10k pullups to 3v.
(The backpacks used don’t have pullups on them)
And it works ok.
I even ran the i2c clock at 400kHz which is well above the PCF8574 max clock of 100kHz for the part.

Attached are some photos of my setup using my hd44780 library and test sketches which do many tests including i2c bus pin tests to check for and report whether external pullups are being used, read/write to LCD display ram, and times byte accesses to the display.

bperrybap:
Since some PCF8574 backpacks include their own pullups to supply voltage, it is critical that any of those would have to be removed.

--- bill

Can you elaborate on identifying these? I've been using through-hole 4.7k Ohm pullups on SDA/SCL, and looking at my backpacks I notice they've got 3 such SMD resistors. Likelihood those are pullups?

INTP:
Can you elaborate on identifying these? I've been using through-hole 4.7k Ohm pullups on SDA/SCL, and looking at my backpacks I notice they've got 3 such SMD resistors. Likelihood those are pullups?

There are many different designs so it is not really possible to describe much other than generally if you look closely at the board and follow the traces it is fairly obvious.

Don't forget that some backpacks have pullups on the address pins to force the address lines to be high.

--- bill

Thanks for the info Bill - I would definitely use level shifters for something I was going to put in production or other commercial use, but for this application (display for my hummingbird feeder heater during winter), as long as it works most of the time, it will be just fine.

gpsmikey:
Thanks for the info Bill - I would definitely use level shifters for something I was going to put in production or other commercial use, but for this application (display for my hummingbird feeder heater during winter), as long as it works most of the time, it will be just fine.

Are the components outside?
The cold may affect the expander chip working with 3v i2c bus signals.
(i.e. low voltage and low temperature is 1 extreme of the 4 corners of testing)

Is the display going to be out in the cold?
Depending on the temperature, it might freeze.

--- bill

Yeah, actually, I have a clear plastic bowl that goes over the bottom of the feeder. The heat plate and controller will be inside the bowl under the feeder. The current version (4 years old now) has a cat-5 cable that runs from the assembly into the house where I have the controller (using a PIC processor). The displays I have for the current controller has the double row of 8 pins instead of the single row of 16 pins (they are from CrystalFontz and is spec'd operating temperature of -4F to 158F. The lowest we see here in the Seattle area when we get a cold snap is +14F or so and by then, the heater is on so the display inside the bowl is going to be more in the neighborhood of 50F. My intention is to use either an Uno or just program a EMP8266 as the controller, so I will have wifi access to what is going on (current/ambient temp as well as power level (I use PWM with about a 4 second cycle time to control the FET driving the heater). All this because I got tired of putting hand warmers on the bottom of the feeders during a cold snap (and a retired engineer is forever coming up with ways to automate things !! )

No problems like that here, our hummingbirds are gone by October.

Don

floresta:
No problems like that here, our hummingbirds are gone by October.

Don

Yeah, the Rufous and others all head south, but the Annas are tough little buggers and will hang around during the winter here. Have to make sure they have liquid syrup at first light though so they can fuel up for another day of squabbling :slight_smile: Here is a shot of one in the snow (only modified a little bit to add the santa hat)

This is the existing feeder with the PIC controlled heater on it:

I think the conclusion I have come to is that I will use a 4 channel level shifter - 2 channels for the I2C and a third for the drive to the control FET since 5v logic FETs are much easier to get (like in my junkbox) than the 3.3v ones in a TO-220 case (lots of 3.3v SMD versions out there)

mikey