Arduino MKR WiFi 1010 - OLED 128x32 Display
Create custom displays and visualize data! The OLED 128x32 display provides a compact, high-contrast screen perfect for showing sensor readings, status information, and graphics. This tutorial teaches you how to connect an OLED 128x32 display to your Arduino MKR WiFi 1010 and program it to display text, numbers, shapes, and images.
What You'll Learn:
- Connecting OLED 128x32 display to Arduino MKR WiFi 1010 I2C pins
- Programming Arduino MKR WiFi 1010 to display text on OLED screen
- Using Arduino MKR WiFi 1010 to show numbers and sensor readings
- Centering text on OLED display with Arduino MKR WiFi 1010
- Drawing shapes using Arduino MKR WiFi 1010 graphics functions
- Displaying custom images on Arduino MKR WiFi 1010 OLED screen
- Understanding I2C communication with Arduino MKR WiFi 1010
- Creating scrolling text effects using Arduino MKR WiFi 1010
Real-World Applications:
- Sensor displays: Arduino MKR WiFi 1010 showing temperature, humidity, and distance readings
- Status indicators: Arduino MKR WiFi 1010 displaying system state and connection status
- Data loggers: Arduino MKR WiFi 1010 with OLED showing live data updates
- Menu systems: Arduino MKR WiFi 1010 providing interactive user interfaces
- Weather stations: Arduino MKR WiFi 1010 displaying forecasts and measurements
- Clocks and timers: Arduino MKR WiFi 1010 showing current time and countdowns
- Notifications: Arduino MKR WiFi 1010 with OLED alerting users to events
- Game displays: Arduino MKR WiFi 1010 rendering simple graphics and scores

Display Technology:
OLED (Organic Light-Emitting Diode) displays produce their own light, eliminating the need for a backlight. Each pixel emits light independently, providing perfect blacks, high contrast ratios, and wide viewing angles compared to traditional LCD displays.
Hardware Preparation
| 1 | × | Arduino MKR WiFi 1010 | |
| 1 | × | Micro USB Cable | |
| 1 | × | SSD1306 I2C OLED Display 128x32 | |
| 1 | × | Jumper Wires |
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of OLED Display
What is an OLED Display?
The OLED 128x32 is a compact, monochrome display module using OLED (Organic Light-Emitting Diode) technology. The most common variant for Arduino projects is the SSD1306-based I2C OLED display.
How OLED Displays Work:
- Self-illuminating pixels: Each pixel generates its own light (no backlight needed)
- Organic compounds: Emit light when electric current applied
- Perfect blacks: Pixels turn completely off when displaying black
- High contrast: Bright whites against pure blacks
- Wide viewing angle: Visible from nearly any direction
- Low power: Only lit pixels consume power
Display Resolution:
- 128x32: 128 pixels wide × 32 pixels tall = 4,096 total pixels
- Screen size: Typically 0.91 inches diagonal
- Color: Monochrome (white or blue pixels on black background)

OLED vs LCD:
| Feature | OLED | LCD |
|---|---|---|
| Backlight | None (self-lit) | Required |
| Contrast | Perfect (infinite) | Limited |
| Black Level | True black | Gray/lit |
| Viewing Angle | ~170° | ~120° |
| Power Usage | Low (black areas) | Constant |
| Thickness | Very thin | Thicker |
| Response Time | Fast (<1ms) | Slower |
| Cost | Moderate | Lower |
Common OLED Sizes:
- 128x32: Compact, good for simple data (this tutorial)
- 128x64: Larger, more information display
- Both use same SSD1306 driver and I2C interface
Pinout

The OLED 128x32 display has four pins:
Power Pins:
- VCC pin: Connect to power supply (3.3V or 5V)
- Module accepts wide voltage range
- 3.3V sufficient for Arduino MKR WiFi 1010
- Current consumption: ~10-20mA (depends on pixels lit)
- GND pin: Connect to ground (0V)
- Common ground with Arduino
- SCL pin (Serial Clock): Clock signal for I2C
- Connect to Arduino A5 (SCL)
- Synchronizes data transmission
- Has internal pull-up resistor (usually built-in)
- SDA pin (Serial Data): Data signal for I2C
- Connect to Arduino A4 (SDA)
- Sends display commands and pixel data
- Has internal pull-up resistor (usually built-in)
- Most OLED modules use 0x3C (default)
- Some modules use 0x3D (alternate)
- Can be scanned using I2C scanner code (see Troubleshooting)
- The connections on the OLED module might be different depending on manufacturer. Please use the labels shown on your OLED module. Look carefully!
- This guide uses an OLED screen with the SSD1306 I2C driver. Tested with DIYables OLED displays.
- Pin order may vary: Some modules have GND-VCC-SCL-SDA, others have VCC-GND-SCL-SDA
I2C Communication Pins:
Understanding I2C:
I2C Address:
※ NOTE THAT:
Wiring Diagram

This image is created using Fritzing. Click to enlarge image
Detailed Connections
OLED 128x32 Display Connections:
| OLED Module | Arduino MKR WiFi 1010 |
|---|---|
| VCC | 3.3V |
| GND | GND |
| SDA | A4 |
| SCL | A5 |
Connection Details:
- OLED VCC → Arduino 3.3V
- Provides power to display
- 3.3V sufficient (5V also works but not necessary)
- OLED GND → Arduino GND
- Common ground connection
- OLED SDA → Arduino A4 (I2C Data)
- Data communication pin
- Hardware I2C on Arduino MKR WiFi 1010
- OLED SCL → Arduino A5 (I2C Clock)
- Clock signal pin
- Hardware I2C on Arduino MKR WiFi 1010
- Double-check pin labels on your specific OLED module
- Ensure proper I2C connections (SDA to A4, SCL to A5)
- Use short jumper wires to reduce noise
- Keep wiring organized for easy troubleshooting
Power Supply:
For This Project: Simply plug your Arduino MKR WiFi 1010 into your computer's USB port. The OLED display draws only 10-20mA, well within USB power limits.
Wiring Tips:
How To Use OLED with Arduino MKR WiFi 1010
Install SSD1306 OLED library
- Click on the Libraries icon on the left side of the Arduino IDE.
- Search for SSD1306 and find the SSD1306 library made by Adafruit.
- Then, click the Install button to finish installing.

- You might see a message asking you to install extra library files.
- To add all of them, click the Install All button.

How to program for OLED
- Add the library
- Set the OLED screen size to 128 by 32.
- Make a new SSD1306 OLED item.
- In the setup() function, start the OLED display.
- Then you can show text, images, and draw a line.
Arduino MKR WiFi 1010 Code - Display Text on OLED
Here are some functions that can show text on the OLED:
- Oled.clearDisplay() – Turns off every pixel on the screen.
- Oled.drawPixel(x, y, color) – Draws a pixel at the specified x and y position.
- Oled.setTextSize(n) – Sets how big the text will be; you can choose a size between 1 and 8.
- Oled.setCursor(x, y) – Moves the starting point for writing text to the x and y coordinates.
- Oled.setTextColor(WHITE) – Sets the text color to white.
- Oled.setTextColor(BLACK, WHITE) – Sets the text color to black and the background color to white.
- Oled.println("message") – Writes a text message on the screen.
- Oled.println(number) – Writes a number on the screen.
- Oled.println(number, HEX) – Writes a number in hexadecimal (base 16) format.
- Oled.display() – Updates the screen so that your changes appear.
- Oled.startscrollright(start, stop) – Scrolls the text from left to right between the chosen start and stop points.
- Oled.startscrollleft(start, stop) – Scrolls the text from right to left between the chosen start and stop points.
- Oled.startscrolldiagright(start, stop) – Scrolls the text from the bottom left to the top right.
- Oled.startscrolldiagleft(start, stop) – Scrolls the text from the bottom right to the top left.
- Oled.stopscroll() – Stops the scrolling text.
How to vertical and horizontal center align text/number on OLED
If you want to learn how to center text and numbers on an OLED display both vertically and horizontally, please check out this guide: How to vertical/horizontal center on OLED.
Arduino MKR WiFi 1010 Code - Drawing on OLED
Arduino MKR WiFi 1010 Code – Display Image
To show a picture on an OLED, you need to first change the image (in any format) into a bitmap array. You can do this using an online tool. The picture below shows how to convert an image into a bitmap array; I used the Arduino MKR WiFi 1010 icon as an example.

After converting, copy the new array code and replace the ArduinoIcon array in the code below.
※ NOTE THAT:
The image should not be bigger than the screen. You need to make the image smaller and change the width and height settings in the oled.drawBitmap() function.
Troubleshooting Common Issues
Problem: Display Shows Nothing (Blank Screen)
Possible Causes:
- Incorrect wiring
- Wrong I2C address
- Power issue
- Faulty module
Solutions:
- Check wiring: Verify SDA to A4, SCL to A5, VCC to 3.3V, GND to GND
- Verify power: Ensure VCC connected to 3.3V or 5V
- Scan I2C address: Run I2C scanner code:
- Update address in code: Change 0x3C to 0x3D if scanner shows different address:
- Test with example code: Use simple text display to verify hardware
Problem: Display Garbled or Partial
Possible Causes:
- Loose connection
- Wrong display resolution setting
- Incorrect driver
Solutions:
- Check connections: Ensure wires firmly connected
- Verify resolution: Must be 128x32 in code:
- Confirm driver: Should be SSD1306 (most common)
- Reset display: Add delay after initialization:
Problem: Text Too Small or Too Large
Cause: Text size not set appropriately for 32-pixel height.
Solutions:
For 128x32 display:
- Size 1: ~21 characters per line, 4 lines
- Size 2: ~10 characters per line, 2 lines
- Size 3: ~7 characters per line, 1 line
Problem: Display Flickers
Cause: Calling oled.display() too frequently.
Solution: Use clearDisplay() once at start of update:
Problem: Display Dims After Time
Cause: Normal OLED behavior - static images can cause burn-in.
Solution: Use screensaver or vary content:
Challenge Yourself - Creative Extensions
Once you have basic OLED display working, try these enhancements:
1. Sensor Dashboard
Display multiple sensor readings:
2. Animated Loading Bar
Show progress indicator:
3. Scrolling Text Ticker
Create news ticker effect:
4. Button Menu System
Interactive menu with button navigation:
5. Real-Time Clock Display
Show time with RTC module:
6. Graph Plotter
Plot sensor data over time:
7. WiFi Status Indicator
Show connection status with icon:
8. Custom Bitmap Animations
Animate custom images:
9. Temperature Graph with Min/Max
Show current, min, max temperatures:
10. Pong Game
Simple game on OLED:
Experiment with OLED graphics and create custom displays!