Published: July 27, 2026
This project takes my earlier Arduino Nano tilt consoles and rebuilds them around an ESP32. The extra memory and processing power made it possible to combine four games, a particle fluid simulator, and an animated robot face in one compact OLED system.
The console is controlled by tilting an MPU-6500 motion sensor. One push button handles the menu and in-game actions, while a passive buzzer provides sound feedback.
| Mode | Description |
|---|---|
| Tilt Maze | Guide a ball through maze walls and reach the goal. |
| Coin Collector | Collect coins against a timer and try to beat the saved high score. |
| Tilt Snake | Control a growing snake, collect blinking food, and avoid collisions. |
| Space Dodger | Move a spaceship left and right while avoiding falling asteroids. |
| Fluid Sim | Tilt the console to change gravity and move 120 simulated particles. |
| Vector Face | Interact with an animated face featuring gaze, expressions, blinking, and a shake-to-dizzy reaction. |
| Component | Purpose |
|---|---|
| ESP32 Dev Module | Runs the console and all six modes |
| 128×64 I2C OLED display | Displays the menu, games, simulation, and robot face |
| MPU-6500-family IMU | Measures tilt and motion |
| Push button | Controls menu navigation and mode actions |
| Passive buzzer | Provides sound feedback |
| Breadboard and jumper wires | Connect the prototype |
| USB cable or power bank | Powers and programs the ESP32 |
| OLED Pin | ESP32 Pin |
|---|---|
| GND | GND |
| VCC | 3V3 |
| SDA | GPIO21 |
| SCL | GPIO22 |
| IMU Pin | ESP32 Pin |
|---|---|
| GND | GND |
| VCC | 3V3 |
| SDA | GPIO21 |
| SCL | GPIO22 |
| Component | Connection |
|---|---|
| Button leg 1 | GPIO18 |
| Button leg 2 | GND |
| Buzzer positive | GPIO25 |
| Buzzer negative | GND |
The button uses INPUT_PULLUP, so it reads LOW when pressed. The tested IMU was mounted with its X arrow facing upward and its Y arrow facing left.
| Library | Purpose |
|---|---|
| Adafruit SSD1306 | Controls the OLED display |
| Adafruit GFX Library | Provides graphics and drawing functions |
| Wire | Provides I2C communication |
| EEPROM | Stores calibration values and high scores |
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
lib_deps =
adafruit/Adafruit SSD1306
adafruit/Adafruit GFX Library
The full firmware is available on GitHub. This selected snippet shows how the six modes are registered in the menu.
constexpr uint8_t GAME_MAZE = 0;
constexpr uint8_t GAME_COIN = 1;
constexpr uint8_t GAME_SNAKE = 2;
constexpr uint8_t GAME_DODGER = 3;
constexpr uint8_t GAME_FLUID = 4;
constexpr uint8_t GAME_FACE = 5;
constexpr uint8_t GAME_COUNT = 6;
const char *const GAME_NAMES[GAME_COUNT] = {
"Tilt Maze",
"Coin Collector",
"Tilt Snake",
"Space Dodger",
"Fluid Sim",
"Vector Face",
};
View the complete ESP32 project on GitHub
0x3C, and the IMU is checked at 0x68 and 0x69.