I am working on my first Arduino project using an LCD monitor. I have tried two separate I2C 16x2 displays, with both an Arduino Micro and an Uno. Both monitors have failed. One never worked at all (no I2C was found) - tried with the Micro. the other monitor (with an Uno) worked for about an hour, then the same old “no I2C found”. the code is pretty simple so far - just the “Hello world” sketch. I verified the voltage (5V) with a meter and it ranges between 4.99 and 5.04 which should be good.
Any suggestions as to what I might have done wrong, or what to try would be most appreciated.
It sounds like several possibilities. First does the display have a daughter board where you connect to VCC, and SDA? If not it will never work, it is probably not a I2C interface. Is the daughter board oriented correctly? If you post a schematic, not a frizzy thing it would be much easier to answer. First be sure all grounds are connected. Second be sure it is wired correctly. Third be sure you have the appropriate pull up resistors, probably about 4.7K. Load the I2C scanner software, there are many available, and work with it until it shows you the address, if it doesn't then the display will not work.
I suppose you would have to show us what you actually did, how you connected them (diagrams and photos), what displays (web site) you used and the code you used (according to the instructions) for us to have the slightest chance of figuring out what you did wrong.
Now just in case you have not done adequate research here and seen the common advice, we recommend you install the “HD44780” library via the Library Manager in the IDE and use the test programs provided there for I2C displays
The hd44780 library comes with a diagnostic sketch, I2CexpDiag, as and example in the hd44780_I2Cexp i/o class that will test the i2c signals and then do a h/w check of the LCD internal memory.
Thanks for all of the replies. I bought a third display, hooked it up exactly as I did the first 2, used the exact same code and it worked like a champ this time. So much for high quality $7 displays!
There are several different versions of the i2c backpacks for hd44780 displays.
You never really know which version you are going to get.
backpacks from different manufactures/vendors can use different h/w designs - there is no actual standard.
Some have pullups and some don't, and the pin wiring between the PCF8574 chip and the hd44780 pins can also vary between them.
These differences can cause things to not work correctly.
Symptoms can vary depending on the specific h/w version you have and the library used.
Symptoms like not working at all, or working intermittently or unreliably.
This is why it is recommend that you use the hd44780 library and initially run the included I2CexpDiag diagnostic sketch.
The diagnostic sketch will tell if your backpack does not have the required pullup resistors.
It will also test the LCD h/w and backlight.
If you use a library like the LiquidCrystal_I2C library, it will only work with a specific version of the backpack.
Some libraries like newLiquidCrystal allow you to configure the pin mappings but many, if not most users struggle with this as they don't know how to look at the backpack or use an ohm meter to determine the pin mappings.
If you use the hd44780 library, it will auto detect everything and self configure it self for the backpack you have regardless of its h/w design and i2c address.
I would recommend that you install the hd44780 library and run the I2CexpDiag sketch on the devices that you were having issues with to see if it can detect any issues.
The LCD works great on an Uno. However, when I connect it all by itself (no other devices) to a Micro, the I2C will not work. The display backlight fires up, but no communication. Iran an I2C scanner and it did not find any I2C devices. I double-double checked the wiring (VCC to 5v, GND to GND, SCA to A4, SCL to A5). Even used multiple sets of jumpers to eliminate a bad connection, but zip. I am only using USB power, but I don't think it is a power issue.
This is only a problem because I now have my project (altimeter and VSI) completed and am planning the build and really need to downsize to the Micro.
Go on. You have been a Forum member for 10 days.
You must have learned that Arduino Micro | Arduino Official Store has I2C pins on different PORT pins to a Uno.
The Micro I2C pins are named SDA and SCL and are on digital pins 2, 3 (port pins PD1, PD0 )
The Uno I2C pins are named SDA and SCL and are on analog pins A4, A5 (port pins PC4, PC5 )
Connect your LCD to the correct SDA, SCL, 5V, GND pins and it should work.
p.s. never used a Micro. The pictures and pinout diagrams on the Internet are HORRIBLE.
If you had run I2CexpDiag it will tell you the pins that are used.
David - I bet you're right. I knew there was a difference, but hadn't worked on the Micro for a while and it simply slipped my mind. I will give it a try. Thanks a million.
This topic was automatically closed after 58 days. New replies are no longer allowed.