Personal and Group Assignment
This week's personal assignment was to measure the wattage of different output devices.
Group Assignment
Here's the link to our group assignment of this week.
Introduction
What are output devices?
Output devices are components that allow a microcontroller to communicate information or produce effects in the physical world. While input devices capture data from the environment, output devices translate digital signals into something humans (or other systems) can perceive: light, sound, motion, or visual information.
Common output devices include LEDs, motors, servos, speakers, and displays. The key challenge is understanding each device's communication protocol, power requirements, and how to drive it correctly without damaging the microcontroller or the component itself.
OLED Display
About the SSD1306 OLED
The 0.96" OLED display uses the SSD1306 controller chip and communicates over I²C — the same protocol used by the MPU-6050 in the previous week. It has a resolution of 128×64 pixels with each pixel being individually switchable, producing sharp, high-contrast visuals with no backlight needed (the pixels emit their own light).
OLEDs are preferred over traditional LCD screens in embedded projects because they have lower power consumption, better contrast ratios, wider viewing angles, and no need for a backlight driver. The U8g2 library provides a wide range of fonts, shapes, and drawing functions that work across many display controllers including the SSD1306.
Technical Specifications — OLED Display
| Parameter | Value |
|---|---|
| Controller | SSD1306 |
| Resolution | 128 × 64 pixels |
| Display Size | 0.96 inches diagonal |
| Display Type | Monochrome OLED (white or blue) |
| Operating Voltage | 3.3V – 5V (onboard regulator) |
| Current Consumption | ~20 mA (typical) |
| Communication Protocol | I²C |
| I²C Address | 0x3C (most modules) / 0x3D |
| Library | U8g2 (by olikraus) |
Pinout & Wiring
The XIAO RP2350 has dedicated SDA (D4) and SCL (D5) pins for I²C. Multiple devices can share the same bus simultaneously since they each have unique addresses (0x3C for OLED, 0x68 for MPU-6050, etc.).
OLED connected via I²C (SDA=D4 / SCL=D5)
First text displayed on screen
Setup Process
1. Library Installation
Installed the U8g2 library by olikraus from the Arduino Library Manager. U8g2 supports a wide range of display controllers including the SSD1306 and does not require a separate graphics library.
2. I²C Address Scan
Ran an I²C scanner sketch to confirm the display's address (0x3C). This step is important — if the address in the code doesn't match the hardware, the display won't initialize.
3. First Display Output
Initialized the display using the U8g2 constructor for the SSD1306 and wrote custom code to display the welcome message with different font sizes.