New to displays, not new to Arduino - Help!

All,

I have done a lot of Arduino projects, including some using I2C. I decided to do some projects to display values on a display instead of using a serial port.

First I bought some 2 X LCD 1602 2 line display LCDs that have 16 pins. I was able to get this to work, but the wiring was ugly, so after a little research, I decided to get some I2C adapters for 1602 LCDs. I started by breadboarding and connecting everything to an Arduino UNO. I used code to check the I2C address and then tried using a demo program to display Something on the screen. I got nothing. After several attempts, I decided to solder the 16 pins for I2C adapter to the 1602 LCD display, and still nothing. No errors...nothing. I could prove that the Arduino was properly sending stuff to the I2C interface, but nothing displayed on the screen. In both instances above, I adjusted the variable resister a lot, but ...nothing.

I wondered whether there was some compatibility problem that I could not discover between the I2C adapter and the 1602 2 line display since I bought them from different sources.

So I decided to try another tack. I bought some OLED 128X 32 displays. I thought this would solve 2 possible problems;

  1. not getting the backlight resistance properly adjusted, and
  2. having the I2C adapter as part of the product, not worrying about compatibility problems

I wired up this I2C device downloaded appropriate Adafruit libraries and sample code. Again I have successfully tested the I2C interface and address. I have double checked wiring, and again, everything seems to work (Including Serial.println inserted code), but nothing displays.

I am getting frustrated. I would have thought that displaying stuff on an LCD would be a straightforward thing to do with Arduinos. I don't think I have had any other Arduino experience where I try to do such a simple straightforward thing, and get nothing.

I am not looking for sophisticated graphics or anything. I just want to display text. What is the most straightforward way to do this and not get caught with things that don't work and no easy way to debug the problem?

Also, if someone has any idea how I could step by step figure out either what is wrong with my 2 X 1602 and I2c adapter or my OLED display, it would be appreciated.

Thank You

George Clay

gclayjr:
I started by breadboarding and connecting everything to an Arduino UNO.

What exactly do you mean by "breadboarding?"

gclayjr:
I used code to check the I2C address and then tried using a demo program to display Something on the screen. I got nothing.

Which code?

gclayjr:
After several attempts, I decided to solder the 16 pins for I2C adapter to the 1602 LCD display, and still nothing.

If they were not soldered before, how were you connecting them?

gclayjr:
No errors...nothing. I could prove that the Arduino was properly sending stuff to the I2C interface, but nothing displayed on the screen.

How did you prove that?

Did the backlight operate?

gclayjr:
In both instances above, I adjusted the variable resister a lot, but ...nothing.

A very odd statement. Adjusting the contrast potentiometer should have shown something - at least at one end. So what was it?

If it is possible to identify the connection of the contrast potentiometer to Vcc and disconnect that without breaking any other connection, that will greatly improve contrast control. This is a longstanding fault in the design of these modules but not the cause of your problem.

gclayjr:
I wondered whether there was some compatibility problem that I could not discover between the I2C adapter and the 1602 2 line display since I bought them from different sources.

That is absurd. There are a few alternate designs (of the "backpack") which require code adjustments, but the huge majority are perfectly well known however many vendors are hawking them.

You need to install the HD44780 library using the IDE Library Manager and use the examples it provides. You may also need to test whatever jumper leads you are using.

Paul_B

  1. Breadboarding is a common term for connecting electronic circuits to white boards with rows of holes in them with wires that have pins on them. I am surprised that you haven't experienced this before. Most pictures of Arduinos connected to stuff is done this way

  2. I2C address scanning code is also very common. Most tutorials I have seen regarding I2C devices has a copy to download. You upload it to an Arduino with an I2C device connected to it, then open the serial monitor, and it displays the I2C address

  3. Yes the backlight operated, I could sometimes see little black squares in the background. What I meant was nothing that intelligent displayed.

  4. I was "grasping at Straws to figure out what might be wrong

  5. I will look into HD44780 Library. Thanks for your advice

George

For an I2C LCD display to work, the I2C address and the I2C backpack to LCD pin mapping must be correct. If the library default settings for either or both are not correct the LCD will not work. You can try to figure out the right pin mapping and use an I2C scanner to find the address, but if you install and use the hd44780 library that is done automatically by the library.

Install the hd44780 library. The hd44780 library is the best available for I2C LCDs. The library is available in the Library Manager. Go to Library Manager (in the IDE, Sketch, Include Libraries, Manage Libraries) and in the Topics dropdown choose Display and in the Filter your search box enter hd44780. Select and install the hd44780 library by Bill Perry.

The class that you want to use is the hd44780_I2Cexp class. There are examples to show how to use the library. The nice thing about the hd44780 library is that it will autodetect the I2C address and the I2C backpack to LCD pin mapping.

In the examples, there is a diagnostic sketch that will help us to help you if you still have trouble with the display. Run the diagnostic sketch and post the results.