Arduino uno + Arduino uno Sensor shield v.5 + LCD with I2C

There was a existing project which is the Obstacle avoiding Robot, and I'm planning to add a LCD with I2C on that project. Where do I connect the I2C in the Arduino Shield V.5. I'm new to the arduino.

The Adafruit Shield v.5 ? https://www.adafruit.com/product/51

That shield does not have the SDA and SCL near the USB connector yet.
You can use A4 (SDA) and A5 (SCL).

[ADDED] There is also a "Sensor shield V5", that does also not have the SDA and SCL pins near the USB connector. You can use A4 and A5, but there are also 4 pins in the middle of the board for the I2C bus.

1 Like

An I2C display will connect to analog inputs A4 (SDA) and A5 (SCL). Those pins are in the same places on the proto shield as they are on the Uno.

Edit: the below is for a 1602 (16x2) or 2004 (20x4) LCD character display with a hd44780 driver.

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.

To 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 menus, 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.

It seems that the shield does have the extra I2C pins near the USB connector as well as A4 and A5 as shown in the red boxes. A4 and SDA are the same electrically as are A5 and SCL.

1 Like

Thankyou, I manage to work the LCD to the obstacle avoiding robot. But I have another problem, because of the LCD the HC-SR04 sensor becomes less responsive/sensitive. Is there any option to make it more responsive/sensitive like changing the code or putting it on other pins in the shield?

I am not sure what that means. How does an LCD become less responsive? Is it too slow?

The sensor becomes less responsive/sensitive when it sense an object. The Obstacle Avoiding Robot has a HC-SR04 sensor and it is attached to the servo.

Measure the voltage at the supply to the rangefinder. I have found that they do not work as well if the supply voltage is less than 5V.

What is supplying power to the servo?