Introduction: 5V LCD Display With Arduino Due 3.3V I2C
This post aims to explain an easier way to use the Arduino Due (or other 3.3V board) with the popular LCD 16x2 Display with the I2C adaptor module.
The initial problem is that the LCD needs 5V for its backlight to work properly, but the SCL and SDA pins should operate at 3.3V to communicate with the Arduino Due without causing harm. To solve this, I've found two options:
- The most mentioned solution is to use a Bi-Directional Logic Level Converter, which indeed solves the problem. But it also adds another component to your list and additional wiring connections on your circuit.
- The other way I've found is to simply desolder 2 pullup resistors in the "I2C adapter backpack" from the LCD. Besides being much easier, it has other advantages explained in the comparison at the end. This method is the main focus of this post.
LCD 16x2 Display with the I2C adaptor module
Soldering pump or soldering wick
Step 1: Origin of the Solution
The solution was not invented by me, I saw a pretty good suggestion and explanation on the Arduino Forum in the link below, which I will reproduce in this post.
Answer from: david_prentice
I couldn't find any complete tutorial on the internet and, since it is a very common problem, I am trying to present the solution here in detail, witness it actually works, and add info that might mitigate some skepticism about its outcomes.
Step 2: Explanation
For the I2C communication to work, it requires pullup resistors connected to the SDA and SCL pins. That's because the devices only turn these pins LOW while communicating. To represent a HIGH, it only has to not send a LOW, and thanks to the pullups it goes to HIGH. (this understanding will be pretty important later)
The LCD "I2C backpack" has two 4K7 pull-up resistors that serve the I2C requirement. But since they are connected to Vcc, if you use 5 V, they will pull SDA and SCL to 5 V.
If you look at the datasheet, you can see that, unlike other boards, the Due already has onboard 1K5 pull-up resistors on its main SDA, SCL pins, that pulls them to 3.3 V.
- Display LCD -> Arduino
- Gnd -> Gnd
- Vcc -> 5V
- SDA -> SDA
- SCL -> SCL
If you just connect the LCD on the Due (following the wiring above), the 1k5 (or 1k0) Due pullups connected to 3.3V and the 4K7 LCD pullups connected to the 5 V will result in idle I2C lines at 3.7 V (3.6 V with 1k0). That is not good, since the Due datasheet stipulates a maximum voltage of 3.6 V for its I/O lines.
By testing this scenario, with only the LCD, I got 3,56 V. By adding an EEPROM Module to the same SDA and SCL, it went up to 3.606 V. In both cases everything worked normally, but those are far from ideal voltage levels considering the 3.6 V stipulated maximum.
So yes, there is a chance it will work just like mine did while not doing any alteration. But the voltage level is still far from ideal and some discrepancy on the Due or LCD pullup may cause it to go above the 3.6 V limit. (It would be advisable to at least test before carefully with a 20K or 100K potentiometer what is the lowest resistance between 5 V and SCL/SDA pins before they get to 3.6 V, though the rest of the solution is much safer and probably easier)
The solution presented is to simply remove the pull-up resistors from the LCD backpack, which try to pull the line up to 5 V. Then, only the Due onboard pull-up resistors will remain, pulling the SCL and SDA lines to 3.3V. It worked perfectly, maintaining the idle pins at around 3.262 V!
The connections remain the same:
- LCD Display -> Arduino
- Gnd -> Gnd
- Vcc -> 5V
- SDA -> SDA
- SCL -> SCL
If you wonder if the LCD won't pull the line to 5 V to represent a HIGH when communicating, remember that on I2C the devices only pull the lines LOW, being the HIGH signal represented when not interfering, which will be the 3.3 V from the Due's onboard pull-ups.
Also, the 3.3 V is sufficient for the I2C backpack to consider as a HIGH signal.
Step 3: Identify and Remove the Resistors
The image above shows in red the pullup resistors I've found in my module.
As the LCD I2C adapter backpack may vary, the resistors may not be in the same configuration. To identify the pullup resistors, you can use a multimeter with a continuity test. Each pull-up resistor should have one end connected to the SCL or SDA pin and the other end to Vcc.
In my case, there were three of the 4K7 (472 in SMD code) resistors on the board. Only two of them satisfied the requirements above, pointing out these are the pullups we were looking for!
For extra precaution (if for some reason they weren't 4K7), I also tested the other resistors and confirmed none of them satisfied the requirements for being pull-ups.
Now, all you have to do is desolder them! It is easier if you have a soldering pump or soldering wick and tweezers to help.
Step 4: Comparison Between Solutions
Bi-Directional Logic Level Converter (LLC)
- Doesn't require any soldering equipment or ability
- Ads more cables and the LLC to your list components list
- Messier connections with the extra components
- Slightly more expensive
Desolder the LCD pull-up Resistors
- Cleaner final result.
- You probably can do it right away, not having to wait for the LLC.
- Especially good if you want to reduce the variety of components and assembly complexity in a complex project or that you want to replicate.
- Alters the LCD circuit (If you want it "ready to use" with the Uno, already having the 4K7 pullups, you can undo the changes resoldering them)
Step 5: Final Considerations
I hope this tutorial sheds some light on this compatibility issue and some of its possible solutions.
If you have any improvement ideas, better explanations, new solutions, or found any error in the post, please tell me in the comments! :)