arduino report
arduino report
GROUPS MEMBERS
1.MOSES KIROBI ED201/108660/21
1. Introduction
The practical implementation of interfacing a 16x2 Liquid Crystal Display (LCD) with an Arduino
microcontroller using an I2C communication module. The I2C module simplifies the connection
between the LCD and the Arduino, reducing the number of required pins and streamlining the
display of textual information.
2. Objectives
To establish a functional connection between an Arduino board and a 16x2 I2C LCD.
To program the Arduino to display specific text strings on the LCD screen.
To verify the correct display of information and troubleshoot any potential issues.
3. Materials Required
4. Procedure
The I2C LCD module was physically connected to the Arduino board.
o LCD SDA pin to Arduino A4 pin (for Arduino Uno/Nano) or pin 20 (for Arduino
Mega)
o LCD SCL pin to Arduino A5 pin (for Arduino Uno/Nano) or pin 21 (for Arduino
Mega)
The entire setup was arranged on a suitable workspace to ensure stable connections.
The Arduino IDE was used to write and upload the code to the Arduino board.
The LiquidCrystal_I2C library was installed through the Arduino IDE's Library Manager.
This library provides the necessary functions to communicate with the I2C LCD.
C++
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Initialize the LCD with its I2C address (usually 0x27 or 0x3F)
void setup() {
lcd.setCursor(0, 0);
lcd.print("Hello, World!");
lcd.setCursor(0, 1);
lcd.print("ISACK MAINA")
lcd.setCursor(0, 2);
lcd.print("ED201/110371/22"); // Added line to display student info
void loop() {
The code initializes the LCD, turns on the backlight, sets the cursor position, and prints
the specified text strings. The lcd.setCursor(0, 1); and lcd.print("ISACK MAINA ")
5. Results
The image provided shows the successful display of the text "Hello, World!" on the first
line of the LCD and "ISACK MAINA ED201/110371/22" on the second line.
This indicates that the Arduino was able to communicate with the I2C LCD and display
the programmed text as intended.
6. Discussion
The use of the I2C module significantly simplified the wiring, requiring only four
connections (VCC, GND, SDA, and SCL) compared to the more complex parallel wiring of
traditional LCDs.
The code accurately controls the LCD, allowing for precise placement of text on the
screen.
The results confirm the effectiveness of the LiquidCrystal_I2C library for interfacing with
I2C LCDs.
7. Troubleshooting
o Checking the I2C address if the LCD does not display anything.
o Adjusting the contrast potentiometer if the text is not visible.
o Ensuring the correct library and LCD size are used if wrong characters are
displayed.
8. Conclusion
The practical successfully demonstrated the interfacing of a 16x4 I2C LCD with an Arduino. The
Arduino was programmed to display specific text on the LCD, showcasing the ease and efficiency
of using the I2C communication protocol for LCD interfacing. The results align with the expected
outcome and validate the provided methodology.