IOT_2nd
IOT_2nd
IOT_2nd
Experiment 2
1. Aim:
2. Objective-
3. Input/Equipment Used-
Laptop
Tinker CAD
LCD
Arduino Uno
Resistor
4. Procedure-
1. Start by opening WORKWI or Tinker CAD in browser and create a new project.
2. Choose the necessary components from the library, including an Arduino board,
an LCD module, resistors, and wires.
DEPARTMENT OF
COMPUTER SCIENCE &
ENGINEERING
3. Position the Arduino board on workspace and connect the power and ground rails.
4. Attach the LCD module to the Arduino. Ensure that the LCD's 16 pins
are connected to the correct Arduino pins as per the module's datasheet.
5. Add Resistors for Contrast: Incorporate a potentiometer or resistors to adjust
the LCD display contrast following the module's specifications.
6. Wire Connections: Use jumper wires to connect the Arduino board, LCD
module, and resistors, ensuring correct pin configuration.
7. Program Arduino: Write an Arduino program to control the LCD. Use
examples and tutorials for guidance if you are unfamiliar with Arduino
programming.
Figure 1
8. Upload Program: Use simulation platform to upload your code to Arduino board.
9. Run Simulation: Execute the simulation to test the LCD display. Check for
and correct any issues with connections or code.
10.If the LCD does not display correctly, troubleshoot and adjust the wiring and
code as needed.
DEPARTMENT OF
COMPUTER SCIENCE &
ENGINEERING
11.Once all connections and programming are verified, observe the final output on the
LCD to ensure everything works as intended.
DEPARTMENT OF
COMPUTER SCIENCE &
ENGINEERING
5. Connections-
The connection of Arduino and the LCD I2C module should be as follows:
6. CODE:
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x20, 16, 2);
void setup() {
lcd.init();
lcd.clear();
lcd.backlight();
}
void loop() {
lcd.clear();
lcd.setCursor(5, 0);
lcd.print("Abdul
Kalam");
lcd.setCursor(3, 1);
lcd.print("22BCS14739");
delay(2000);
}
DEPARTMENT OF
COMPUTER SCIENCE &
ENGINEERING
7. Result:
Figure 2
8. Conclusion:
Interfacing an LCD with an Arduino effectively involves careful wiring and programming. By
establishing power connections, adjusting the display's contrast with a potentiometer, and
correctly linking control and data pins, you set the foundation for communication between the
LCD and Arduino.