Welcome to Raspberry Pi 5 repository
3. OLED Display
OpenClaw OLED Display Tutorial
Before starting, please complete [01-Peripheral Hardware Configuration], [02-OpenClaw API-KEY Configuration], [03-OpenClaw Model Switching], [04-AI Voice Interaction Configuration], and [05-Three Dialogue Configuration Tests] in the
Preparation Before Usedirectory. If you are only using TUI/WhatsApp, you can skip04. This article assumes the basic environment is ready and only covers OLED-related content.
1. Tutorial Objectives
This article demonstrates OpenClaw's natural language control capability through OLED peripherals. After completing this tutorial, readers will be able to:
- Understand the basic approach to controlling OLED display with OpenClaw
- Communicate with OpenClaw via WhatsApp, TUI, and voice commands
- Complete four OLED cases: text display, metric display, weather card, animation display
- Understand the complete chain from "user input" to "screen display"
2. Hardware Preparation
- OpenClaw main control board
- OLED display screen
[default SSD1306 128x32 / I2C address 0x3C] [Optional] Microphone module- Wiring diagram

3. Software Preparation
Code entry points used in this tutorial:
- Low-level driver code:
/home/pi/hardware_hal_demo/ - OLED control command:
/home/pi/hardware_hal_demo/oled - Temperature and humidity display with OLED:
/home/pi/hardware_hal_demo/dht_oled - Voice entry:
/home/pi/voice_to_openclaw/src/main.py
The oled tool already supports the following capabilities:
- Display text
text - Display image
image - Display animation
animation - Display weather card
weather - Clear screen
clear
If you just want to quickly display temperature and humidity readings on OLED, you can also directly use dht_oled.
dht_oled #Display temperature and humidity data on OLEDoled text --text 'Hi, world' #Display textoled weather --location 'Shenzhen' --condition 'Sunny' --temperature '26°C' --humidity '57%' #Weather cardoled image --path ~/hardware_hal_demo/assets/oled/mountain_photo_128x32.png #Display imageoled animation --path ~/hardware_hal_demo/assets/oled/sunrise_anim_128x32.gif #Display GIF animationoled clear # Clear screenNote: The GIF and image display can be generated by AI with 128x32 resolution, then placed in this path: ~/hardware_hal_demo/assets/oled/
For more commands, see the md document in this folder:
xxxxxxxxxx/home/pi/hardware_hal_demo/README.mdIf the low-level commands execute normally, it means the hardware and Raspberry Pi board are properly connected with normal communication.
4. Testing OLED Display
Before starting this tutorial, please complete an openclaw tui basic conversation self-check first; if you haven't done this yet, see [05-Three Dialogue Configuration Tests]. After confirming OpenClaw can respond normally, proceed with the OLED-specific test.
Enter TUI by typing the following in the terminal:
xxxxxxxxxxopenclaw tui
You can try the following in the terminal:
- Display "Hi, OpenClaw" on OLED
- Display "Today we start learning OLED" on the screen
- Clear the OLED screen
- Display current status "System OK" on OLED

5. Three Ways to Communicate with OpenClaw
| Method | Suitable Scenario | Advantages | Suggested Use |
|---|---|---|---|
| Remote control, classroom demonstration | Easy to connect, suitable for multi-person experience | Demonstrate "remote natural language control" | |
| TUI | Local debugging, command verification | Most direct, easiest to troubleshoot | First to get the control link working |
| Voice Code | Voice interaction, complete AI experience | Closest to real conversation experience | As the final demonstration solution |
If you have the optional AI voice module + speaker, the TUI and WhatsApp conversations need to broadcast OpenClaw's replies. You can run the following program in the terminal. This is not needed for AI voice module conversations.
- Modify the TTS enable parameter
xxxxxxxxxx/home/pi/voice_to_openclaw/.env
xxxxxxxxxxENABLE_TTS=true # This parameter controls whether to broadcast replies. After saving, run the program below in the terminal.- Terminal input
xxxxxxxxxxcd ~/voice_to_openclawsource .venv/bin/activatepython -m src.openclaw_session_tts
5.1 WhatsApp Solution
For WhatsApp integration steps, please refer directly to [05-Three Dialogue Configuration Tests]. This section only includes dialogue examples suitable for the OLED tutorial.
After creating, you can converse directly, for example:
- Display "Welcome to OpenClaw" on OLED
- Help me display current temperature and humidity data on OLED
- Clear the OLED screen

5.2 TUI Solution
If you have already completed the TUI self-check from chapter 0, simply type the following command in the terminal to continue the conversation:
xxxxxxxxxxopenclaw tui
5.3 Voice Code Solution
xxxxxxxxxxRequires optional AI voice interaction module + speaker
For voice module installation, environment configuration, and basic wake-up flow, please refer directly to [04-AI Voice Interaction Configuration]. After waking up, you can directly speak control content, for example:
- Display "Hi" on OLED
- Change the screen content to "Welcome to OpenClaw"
- Clear the screen

6. Comprehensive Cases
Note: All demonstrations below use the openclaw tui method for conversation. You can also choose WhatsApp or voice to complete.
6.1 Case 1: Text Display
Experiment Objective
Have OLED display a fixed text for the most basic screen control.
Effect Description
After OpenClaw receives the command, it will render the specified text on the OLED screen. This case is suitable for verifying whether text rendering, line wrapping, and screen refresh are normal.
Example Commands
- Display "Hi, OpenClaw" on OLED
- Display "Today's task is testing OLED"
- Change the screen content to "System Ready"
6.2 Case 2: Metric Display
Experiment Objective
Have OLED display single-line status metrics in a more compact way.
Effect Description
This mode is suitable for compressing short information like temperature, humidity, battery level, and status values into one line, more like a simple dashboard reading.
Example Commands
- Display "Temp 26C Hum 57%" on OLED
- Write the current status as a short message in one line
- Change the screen content to "CPU OK RAM OK"
6.3 Case 3: Weather Card
Experiment Objective
Have OLED display a more complete weather information card.
Effect Description
The screen can display location, weather, temperature, and humidity information. This case is suitable for weather stations, environmental monitoring, or information panels.
Example Commands
- Display Shenzhen sunny 26 degrees humidity 57% on OLED
- Make a simple weather card
- Format current temperature and humidity as a card-style display
6.4 Case 4: Animation Display
Experiment Objective
Have OLED play images or animations, showcasing richer visual effects.
Effect Description
Besides static text, OLED can also display bitmaps, GIF animations, or simple self-check animations. This case is very suitable for boot pages, emoji animations, or classroom demonstrations (you can prepare photos or GIF animations to display and place them in the path /home/pi/hardware_hal_demo/assets/oled).
Example Commands
- Play a simple animation on OLED
- Display an icon image
- Make a boot welcome animation