I am new to this forum and new to Arduino. I was unable to find my question, so here it is.
I am using an Arduino Pro Mini 5 v 16 MHz in my attempt to get an LCD to work.
Using a parallel LCD has not been a problem, but when I try to us the I2C interface, I am not sure the interface works.
So, I have used "fade" to make sure that I can communicate with the pins. The LED did what it should.
Also, I have had difficulty trying to find a working LiquidCrystal_I2C.h file. Most will not compile. Once I find one that will compile, I don't see anything on the display.
I have tried to use a program called "I2C_scanner", actually a couple. Both compile and seem to run. These programs are looking for the I2C address of the LCD. If the LCD is not connected, the programs say "No I2C devices found". If I connect the A4 and A5 pins, it gets in an infinite loop and nothing is read out on the Serial Monitor display.
Using a "Hello World" sketch, is there a tool to view the I2C buss?
Using a "Hello World" sketch, is there a tool to view the I2C buss?
No, but it really doesn't matter, the I2C scanner is the most important tool for troubleshooting I2C.
It sounds like you're wiring something really wrong because there is no way, under normal circumstances, that doing anything to the parallel side of the I2C chip should make the I2C side lock up. Can you post a photo where we can clearly see your connections between the LCD, the I2C board and the Pro Mini?
Here is a photo of my set up: Green wire goes between A5 and SCL, Blue wire goes between A4 and SDA. LCD is powered with the squares showing in the display.
Thanks for the response, but the FTDI Header pins are not connected to anything in the photo. I plugged the FTDI header into the breadboard just for stability. There are no wires connected to that header.
Only wires connected to the Arduino Pro Mini are VCC, GND, A4 and A5. I verified that no wires are shorted.
If I plug in a parallel LCD, no problem with the LCD. It is when I try to use the I2C buss with an appropriate "Hello World" with an LiquidCrystal_I2C.h file that the display doe not work.
I know the it is hard to tell from the photo, but there are no shorts.
Thanks again.
What isn't shorted when you happen to measure it doesn't mean it isn't shorted one millisecond later when the board moves...
Not to sound critical but as Leo said, you cannot do that! You cannot plug a board into a solderless breadboard 90 degrees out of place even when the header pins are not soldered.
I have several of that specific backpack (I2C board). I'll post a link to a known working library in an hour or so. But, you've got to get the mini oriented correctly.
Get that compiled, loaded and you're off to the races... it's been tested and working with a pro mini and that very same I2C board at its default address of 0x27. Even if you've changed the address, the library will find the correct one automatically
Get that compiled, loaded and you're off to the races... it's been tested and working with a pro mini and that very same I2C board at its default address of 0x27. Even if you've changed the address, the library will find the correct one automatically
Not only will the library automatically locate the proper I2C address but it will auto detect the pin mappings used between the PCF8574 and the LCD as well as auto detect the backlight circuitry signal active level - all without having to recompile the code if something changes.
I don't know of any other library that does this.
The library can be quickly and easily installed using the IDE library manager.
Take a few minutes to read over the information on the github page as it includes information about the library and how to install it.
Installation is super easy when using the IDE library manager.
Just a few clicks and it will be downloaded and installed for you.
Then it should "just work".
The hd44780_I2Cexp i/o class also includes a diagnostic sketch that will test the i2c signals and the internal RAM of the LCD. It is good to run it to verify that the library and the LCD are working together properly.
I downloaded hd44780.h, hd44780_I2Cexp.h and HelloWorld.ino.
These did not compile. I will double check.
About my Arduino Pro Mini being on my breadboard. Really, it is not plugged into anything except for VCC, GND, A4 and A5. It is just floating in the air.
Yea! It Works!
After all of the LiquidCrystal_I2C.h files and other HelloWorld.ino sketches that I have tried.
This works!
Now to try and figure out what the software is doing and how it works.
Thank you bperrybap for your solution.
There is no need to be downloading any files manually unless you are not using the Arduino IDE or are using a really old version of the IDE.
Why are you not using the IDE library manager?
Do you have a specific reason for doing a manual partial install?
It is much simpler, faster, and a lot less work to install the library using the library manger.
Plus, it ensures that the library along with all its files and examples is installed properly.
Also by using the library manager you can select from any of the tested releases vs just getting tip of the master branch. Another plus is that by using the library manager, you can update the library in the future as I release updates with just a few clicks in the IDE.
And since it sounded like you were having some i2c issues, I would highly recommend that you run the diagnostic sketch to test your i2c signals to verify if you have the proper pullup resistors on the i2c signals.
Epilogue:
I downloaded the complete Library from Arduino web site and I was using the most current version of the Arduino software before I even started this project.
Here is the problem and the solution.
I was using the power through the programmer cable to run the program such as "Scanner". I thought that it was 5 v since that is the voltage of the USB port. Since all previous program examples seemed to work, I didn't think that there was an issue. (Only driving an LED and other simple things)
My documentation showed that my port address was 0x27, it was not. The "Scanner" software would hang up in a loop.
After I got a program to display on the LCD, thanks to you Bill, I looked into it further.
I started to check voltages on the Arduino Pro Mini and I realized that it was running at 3.3 volts when using the programming cable, but the LCD display needed 5 volts. The I2C buss needs pull-ups based on the LCD used. In my case, it needed 5 v.
Thus, the "scanner" software would not work when I was powering the Arduino Pro Mini by only 3.3 volts. The pull-ups needed 5 volts. The software download mentioned previously worked because it was self contained and I ran it using 5 volts to the RAW pin. Once I realized my problem, I modified my setup so that when I ran "scanner" I was using 5 volts. My reading came back as 0x3F for my LCD. (that is not what my documentation said). The Serial Monitor requires connection to the programming PC. I removed the VCC wire from the programming cable, connected RAW to 5.0 v and it all made sense. It worked as expected.
The information that you provided, Bill, was all self contained and worked. I did not have the programming cable connected. Once I realized that it was a voltage issue, most of my older programs using the Library file: LiquidCrystal_I2C.h began to work at a full 5 volts. The programmer cable only supplied 3.3 v.
PS. I did find many LiquidCrystal_I2C.h files on the web would not compile with many of the code examples.
Thank you for your help Bill, you helped me resolve the problem and sent me looking for the real cause. Thanks again!
I would have thought that it would work if everything is running at 3.3v.
I've run many of these LCDs at low voltage like that in past.
What does the I2CexpDiag sketch indicate when everything is run off the download cable at 3.3v?
I guess I could update the diagnostic code to report the voltage level feeding the Microcontroller on the AVR parts.
It isn't that difficult to do on those parts.
It would at least provide some additional information.
Here is an updated photo. Note that the white wire is removed from the USB adapter. That is the VCC or 3.3 V wire. All power is supplied by 5.0 V on board. Also note that the only wires connected to the breadboard are the wires connecting to the USB cable. Green Wire connects between A5 (SCL) and the SCL on the display. The Blue wire connects between A4 (SDA) and the SDA on the display.
The Scanner program now works as well as many others. All because of a voltage conflict. Good thing I had a voltmeter