I2c screen not working with uno but works with Nano

Hi all,

Am using an Arduino to create a controller for my an intercooler sprayer for my car. In short the controller triggers a relay to turn on a pump for a set time depending on a few inputs(time, temp, pressure etc.). There is also a basic GUI controlled by a rotary encoder to set some of the variables.

I decided adding a i2c interface to my setup would tidy it up some. However I cannot get it working on my Elegoo UNO R3 I am using to develop this. However it works fine on my Nano I am planning on using for the implementation.

I am following this guide.
https://create.arduino.cc/projecthub/akshayjoseph666/interface-i2c-16x2-lcd-with-arduino-uno-just-4-wires-273b24

Running the 'Scanner' software I find the i2c device at 0X27 on both

Scanning...
I2C device found at address 0x27 !
done

This is the code I am running .

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

LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup()
{

	lcd.begin(16,2);
	lcd.backlight();
	lcd.clear();
	lcd.setCursor(4,0);
	lcd.print("Hackster");
}

void loop()
{
}

It works fine on Nano. plugged in like this
SDA-A4
SCL-A5
VCC-5v
GND-GND

On the Uno I get nothing, If I change the varistor I can see the top line has white blocks for each character and nothing on the bottom.
I have tried connecting it as above and connecting SDA-SDA & SCL-SCL. Both times do the same thing.

The Uno has been working fine, using the screen without i2c and with loads of different digital and analogue I/O so I don't think it is the board.

Any ideas?

Try another GND pin on the Uno. Maybe it is a physical connection issue.... and SCL and SDA pins are duplicated at the higher end of the digital pins (D18, D19), see (5) Connector Pinouts:

@chris-red your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advise on) your project.

Thanks for the reply I had already tried the other pins and no luck have tried another ground too now and still the same.

Hmm... thinking (via ddg.gg)... Had a thought. Lost it.

A thought - Did the I2C scanner not scan right? My OLED shows 0x3C or 0x3D on Uno and Nano. My thought is that 0x27 just was close enough to work. Why? I use 0x3C (128x32) for my 128x64 without blue smoke (yet).

From the tutorial I followed the address is set by jumpers on the I2C interface. 0x27 is the default as such with all 3 jumpers not set.

Yes, but give 0x3C or 0x3D a push down the hill. It might work, or it might not crash any worse than it is... But, in my cold heart, it feels like a physical issue: Nano doing well, Uno not well.

Maybe the board is broken. Maybe they did not put enough decoupling capacitors on it and it is very noisy.

The main difference between the I2C Scanner and the sketch is that the sketch turns the backlight on. Maybe the board has trouble with that current.

Can you try a better quality USB cable ?
If you measure the 5V and GND on the LCD display, then it should be at least 4.5V.

My best advise is to shrug your shoulders :person_shrugging: O well, that didn't work, let's use the Nano :sunglasses:

That's what I have gone with. :grin:

How were you powering the UNO?

I would install the hd44780 library and run the included I2CexpDiag sketch in the hd44780_I2Cexp i/o class examples.
It will test several things and report back any issues it finds.

--- bill

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.