5v 16x2 LCD on 3.3v - Page 1
Forum section: electronics / projects

author: ion
author_rank: Regular Contributor
timestamp: April 04, 2021, 08:08:37 pm
content: Just as I'm finishing a design that has a HD44780 based LCD, I realised these displays are meant for 5V and the circuitry is at 3.3V.Looking around the internet I found that the issue is with the contrast, as otherwise it would work fine on 3.3V. I did a simple test to confirm, and the LCD is unreadable at maximum contrast below 3.6V.As the power source for the board is 5V going straight to the 3.3V regulator, I was thinking of powering the LCD directly from the 5V source. Unfortunately there is a sensor attached to the MCU that isn't 5V tolerant as otherwise I would power everthing at 5V.I have attached a simple schematic of what I have in mind, would this cause issues for the MCU?

author: mariush
author_rank: Super Contributor
timestamp: April 04, 2021, 08:22:59 pm
content: It should work.If you don't need to read from the lcd display and you want to be absolutely sure 5v won't go back towards the mcu, a easy hack would be to just use a shift register between the mcu and the lcd display .... a basic 74HC595 8 bit shift register would be plenty and they're available in dip packages :https://www.digikey.com/en/products/detail/nexperia-usa-inc/74HC595PW-112/1230493You can shift 6 bits for D0..D3 and RS and EN and 2 bits of padding using only 3 pins (data,clock, latch/enable) , the shift register accepts anything around 1.6v..2.4v or higher as high / 1, anything lower as low / 0 and outputs near 5v or 0v// could also use an output pin of the shift register to power the backlight directly from 5v through the shift register, most shift registers can do up to around 35mA on each pin, but you should be fine with 10-15mA for the backlight.

author: Ian.M
author_rank: Super Contributor
timestamp: April 04, 2021, 08:28:34 pm
content: @ion,No, as you've got R/W grounded so the LCD cant output on its data lines with 5V levels, however it may not work as a 3.3V MCU cant output a high enough level for a 5V HD44780 based display to reliably recognize as logic '1'. A genuine HD44780 has a guaranteed logic '1' threshold of 70% Vcc, which at 5V is 3.5V. Therefore it may be preferable to operate the LCD at 3.3V Vcc and provide a negative bias voltage to Vo to get acceptable contrast.Mariush's suggestion of a shift register is also valid but use a 74HCT595 so it will work reliably with 3.3V input levels.Also its unlikely that your MCU I/O pin can sink enough current to operate the backlight directly. Its usual to use a transistor to switch it.

author: gnuarm
author_rank: Super Contributor
timestamp: April 08, 2021, 04:47:23 am
content: The ICs on these LCD display chips work fine at 3.3V. The issue is the LCD itself. Being multiplexed it requires something around 4V to get proper contrast. This voltage is across the resistor string that sets the multiple voltages for the different phases of drive. The resistor string just uses the resistors as voltage dividers to create several different voltages. One end of the resistor string is connected to Vcc and the other end connects to V0. Rather than drive Vcc with 5V which means the LCD input signals have to be driven with a 5V chip, you can drive Vcc from 3.3V and drive V0 with -1 V or so through a resistor.You can use +3.3V power to generate a minus voltage from an I/O pin on the MCU. Typically people add a chip like a 7660 to do this and in fact, if you nose around your LCD circuit board you may find an 8 pin socket that is intended to be used for a 7660 chip. I'm not sure where they provide the negative output, but I've read they do it.Instead you can use one output pin, two capacitors, two diodes and a resistor to do the same thing. Here is a circuit that in simulation produces -2V. The resistor R1 limits the inrush current. The load resistor is just to test the circuit with. Your LCD load will be 100 Kohms or more. Since you only need a volt or so you can use any diode, they don't need to be Schottky diodes. The capacitors can be smaller too, 100 nF is fine for both, maybe even 10 nF with 100 k load.

author: kjr18
author_rank: Regular Contributor
timestamp: April 08, 2021, 07:40:19 am
content: Here you have short tutorial how to make your 5V 16x2 display to work on 3.3V. All you need is some smd caps, one 7660 and that's all. Of course if your lcd has those pads on it.

author: ebclr
author_rank: Super Contributor
timestamp: April 08, 2021, 07:50:48 am
content: Why not buy the right component it's very cheaphttps://pt.aliexpress.com/item/32864727517.html?spm=a2g0o.productlist.0.0.2c3c79220MuIc8&algo_pvid=fc414141-1591-43d8-b9fa-abf779f05c95&algo_expid=fc414141-1591-43d8-b9fa-abf779f05c95-0&btsid=0b0a556e16178682021876440e7132&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

author: ion
author_rank: Regular Contributor
timestamp: April 08, 2021, 11:15:57 am
content: Thanks everyone for all the suggestions!I managed to see the first couple of replies before the servers went down, and I figured as it won't cause damage I'd just try it. And it worked just fine at 5V with the MCU at 3.3V.Then I tried lowering the voltage on the LCD, and with V0 tied to ground I found the contrast to vary between good at 3.5V and almost unreadable at 3.2V.3.3V is still usable, at least on the LCD I have, but due to multiple variables between the breadboard and the PCB, I just added a couple of jumpers to the layout - at least one of them should work.There are pads for a 7660 on the back of the LCD, so this would also have been an option if I wanted more contrast and didn't have access to a higher voltage.@ Ian.MYou're right about the backlight, but I am limiting the current to well below what the I/O pin can handle, hence the lack of transistor.@ebclrI did think about that, but with the shipping times at the moment I'd be better off getting a 7660 locally and modifying what I have.

author: Ian.M
author_rank: Super Contributor
timestamp: April 08, 2021, 11:42:06 am
content: Personally I'd go with a 3.3V LCD supply and Gnuarm's PWM pin feeding a charge pump to get a negative bias voltage for Vo. You can also do software contrast control that way - simply vary the PWM frequency to vary the rate of charge pumping, and thus the voltage across the load resistor.There's always the option to kludge it by dropping the LCD supply voltage down to ideally 4.3V You can be pretty sure that an otherwise unloaded 3.3V logic output will exceed the 3V 70% logic '1' threshold voltage, and if you need to be able to read back the LCD, 1K resistors in the data lines will be enough to protect non-5V tolerant input pins on your MCU. Ideally use an adjustable LDO, but a carefully chosen silicon diode +a pulldown resistor may be sufficient.Another alternative if your MCU has any 5V tolerant pins, that guarantees valid logic levels, is to drive them as (effectively) open drain, with pullups to the LCD's +5V supply