0:00
Welcome to our channel! Today we're diving into a simple yet powerful project, connecting and using an i2c LCD with Arduino
0:06
This tutorial is perfect for beginners who want to enhance their Arduino projects with a clear and easy to read display
0:18
Let's start with a brief introduction. An i2c LCD module allows you to easily add a display to your Arduino projects
0:25
It uses the i2c communication protocol, which simplifies wiring and coding compared to parallel LCD modules
0:31
Plus, it saves on precious I-O pins. Here's what you'll need for this project
0:36
An Arduino board, we're using an Arduino Uno, an i2c LCD module, and some jumper wires
0:42
First, let's wire everything up. The i2c LCD module typically has four pins, GND, VCC, SDA, and SCL
0:49
Connect GND to the Arduino's GND, VCC to the Arduino's 5V, SDA to A4, and SCL to A5
0:57
Now that we've got our hardware set up, let's move on to the software. We'll be using the LiquidCrystal underscore i2c library
1:03
To install it, you need to download it first. I'll be posting the link to the library in the description
1:08
After downloading, open your Arduino IDE, go to Sketch, Include Library, Add Zip Library
1:15
Locate the downloaded zip file and click Open to install. With the library installed, it's time to write some code
1:21
Open a new sketch in the Arduino IDE and start by including the library at the top
1:25
Next, we need to define the LCD address and pin configuration. Most i2c LCD modules use the address 0x27
1:33
Let's write the code step by step. In the Setup function, we initialize the LCD with 16 columns and 2 rows and turn on the backlight
1:41
Now, let's move on to the Loop function, where we'll write the messages to the display
1:46
In the Loop function, we clear the screen, set the cursor to the first row and column, and print Hello
1:51
After a 1 second delay, we set the cursor to the first column of the second row and print World, followed by 6 exclamation marks
1:58
This cycle repeats every 3 seconds. Now, let's upload the code to our Arduino
2:03
Connect your Arduino to your computer via USB, select the correct board and port in the Arduino IDE, and hit the Upload button
2:11
Once uploaded, you should see Hello displayed on the first line and World on the second line of your LCD screen
2:17
If you don't, double check your connections and make sure you've set the correct i2c address and pin configuration
2:23
You can customize your display to show different messages, change the cursor position, and even clear the screen
2:29
Let's see how we can modify our Loop function to display a dynamic message
2:33
In this updated Loop function, we display Arduino on the first line, wait for 2 seconds
2:38
then display LCDDisplay on the second line and wait for another 2 seconds
2:42
After clearing the screen, we display Learning on the first line, wait for 1 second, and then Made Easy on the second line, waiting for 3 seconds before the loop repeats
2:50
By using the LCD.Clear function, we ensure that the screen is cleared before writing new messages
2:56
The LCDSetCursor function allows us to set the position where the next text will be displayed, giving you control of where each message appears
3:03
Experiment with different messages and timings to create a display that suits your project needs
3:08
And that's it! You've successfully customized the display of your i2c LCD with Arduino
3:14
This display can be a great addition to many projects, providing clear and concise information at a glance
3:19
If you found this tutorial helpful, please give it a thumbs up and subscribe to our channel for more Arduino projects and tutorials
3:26
Thanks for watching and happy coding