17. I2C, Address Scanning & I2C LCD
Share a two-wire bus and simplify display wiring.
Learning outcomes
- Explain SDA, SCL, addresses and pull-ups
- Scan an I2C bus
- Wire Uno I2C pins
- Use a common I2C LCD backpack
Parts and preparation
Uno, I2C LCD backpack/display and jumper wires. Install LiquidCrystal I2C by Frank de Brabander (see Libraries box).
Before power: inspect wiring, confirm supply voltage and ensure all connected circuits share GND.
Libraries for this lesson
In Arduino IDE 2 open Tools → Manage Libraries…. Search by the Library Manager name and install the package by the exact author below. Similar names from other authors can use different APIs and will break the example.
| Include | Library Manager name | Author | Install note |
|---|---|---|---|
Wire.h | Wire | Arduino | Built into the Arduino core. No Library Manager install required. |
LiquidCrystal_I2C.h | LiquidCrystal I2C | Frank de Brabander | Install via Library Manager. Other LiquidCrystal_I2C packages use different APIs (init vs begin). |
I2C bus
SDA carries data and SCL carries a shared clock. Devices use addresses, so several can share the wires. Uno SDA is A4 and SCL is A5.
Pull-ups
SDA and SCL are open-drain signals and need pull-up resistors; modules commonly include them. Too many modules can make the combined pull-up resistance too low.
Addresses
Common LCD backpack addresses are 0x27 and 0x3F, but scanning is more reliable than guessing.
Library variation
Several Library Manager packages share similar names. This course uses LiquidCrystal I2C by Frank de Brabander, which provides lcd.init() and lcd.backlight().
Wiring and safe build sequence

- LCD VCC -> 5 V
- LCD GND -> GND
- LCD SDA -> A4
- LCD SCL -> A5
Worked sketch
Download .ino sketch#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
Wire.begin();
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("I2C connected");
}
void loop() {
lcd.setCursor(0, 1);
lcd.print("ADC ");
lcd.print(analogRead(A0));
lcd.print(" ");
delay(250);
}How the code works
- Change 0x27 only if a scanner reports another address.
- All devices on the bus share SDA, SCL and GND.
Test and record evidence
Practical evidence checklist
Common faults and checks
- Run an I2C scanner if the display is blank.
- Adjust the backpack contrast potentiometer.
- Confirm the installed librarys initialization API.
Check your understanding
Q1. Why can devices share SDA and SCL?
Show answer
Each device responds to its own I2C address.
Q2. Which Uno pins are SDA and SCL?
Show answer
A4 is SDA and A5 is SCL.