Week 7 · Displays & Signals
Session 31: The I2C LCD
Learning outcomes
- Wire an I2C LCD to SDA and SCL with a common GND
- Find the backpack address with a scanner
- Print at positions with setCursor and update values without leftover characters
- Use the LiquidCrystal I2C library by Frank de Brabander
Kit and components
- Uno, I2C 16x2 LCD, 10 kΩ potentiometer, jumpers
- Oscilloscope
Pre-reading about 20 min
Students read these on their phones before class. They are listed on the student Before class page.
Session plan
- 0:0010 minRecap
Quiz: motors
- 0:1020 minDemo
Four wires and an address
Install the library, run the I2C scanner to show the address, then print on both lines.
- 0:3035 minBuild
Live reading on the LCD
Students build the worked sketch, run the scanner on their own backpack and write its address on the module.
- 1:0545 min
- 1:5010 minWrap-up
Why the leftover digit?
Checkpoint: ready to move on?
Each student's LCD shows a live potentiometer value that updates without leftover characters, and they know their backpack address.
Extension for fast finishers
Capture an LCD update on the scope using the lesson's I2C section.
Catch-up path
Blank screen checklist: backlight, contrast pot, address, SDA and SCL swapped.
Homework and practice
Code Along 13.4 and 13.5.
Facilitator notes
- Install the library on lab PCs before the session. Packages with similar names use different APIs.
- Most blank screens are the contrast pot on the back of the backpack.