April 11, 2026
Description
Description:
A compact, experimental DIY digital level built around an ESP32-C3, MPU-6050, and a 0.96" OLED display. It provides real-time pitch and roll measurements with a clean bubble-style interface, multiple display modes, and adjustable tolerance. The device includes onboard calibration, battery monitoring, and a simple 3-button interface, all designed to fit into a small 3D-printed enclosure.
This project is intended for makers who want a customizable, portable digital level and a fun electronics build.
Features:
Parts List:
Microcontroller: Lolin ESP32-C3 Mini
IMU: GY-521 MPU-6050 (6-axis) ()
Display: 0.96" OLED SSD1306, 128×64, I2C ()
Voltage sensor: DC 0–25V voltage sensor module
3x Tactile buttons: 6×6mm 4-pin tactile push buttons
Simple On-Off Switch
4 Slot AA Battery pack: I used four 1.2V rechargeable batteries from Ikea → If you want to build this, make sure that your batteries don't exceed 5V in total
M3 screws and threaded inserts
Links suggestions (from Aliexpress):
Tips:
Pin Reference:
| Signal | GPIO Pin |
| I2C SDA (IMU + OLED shared) | GPIO 8 |
| I2C SCL (IMU + OLED shared) | GPIO 10 |
| Voltage sensor signal (S) | GPIO 1 |
| Button — MODE | GPIO 4 |
| Button — CAL | GPIO 3 |
| Button — TOL | GPIO 2 |
| All VCC (IMU, OLED) | 3.3V |
| All GND | GND |
| Battery + | VBUS |
Wiring Diagram:
ESP32-C3 Mini
┌─────────────────────────────┐
│ 3V3 ────────────────────────┼──► IMU VCC
│ └─────────────────────┼──► OLED VDD
│ │
│ GND ────────────────────────┼──► IMU GND
│ ├─────────────────────┼──► OLED GND
│ ├─────────────────────┼──► BTN other legs
│ └─────────────────────┼──► Voltage sensor V-
│ │
│ GPIO 8 (SDA) ───────────────────┼──► IMU SDA
│ └──────────────────┼──► OLED SDA
│ │
│ GPIO 10 (SCL) ─────────────────┼──► IMU SCL
│ └───────────────────┼──► OLED SCK
│ │
│ GPIO 1 ───────────────────────┼──► Voltage sensor S
│ GPIO 4 ───────────────────────┼──► MODE button
│ GPIO 3 ───────────────────────┼──► CAL button
│ GPIO 2 ───────────────────────┼──► TOL button
│ │
│ VBUS ─────────────────────── ┼──► Battery +
└─────────────────────────────┘
IMU (GY-521) OLED (SSD1306)
┌─────────┐ ┌─────────┐
│ VCC──3V3 │ │ VDD─3V3 │
│ GND──GND │ │ GND──GND │
│ SCL──G10 │ │ SCK──G10 │
│ SDA──G8 │ │ SDA──G8 │
│ XDA──NC │ └─────────┘
│ XCL──NC │
│ ADO──NC │
│ INT──NC │
└────────┘
NC = Not connected
G = GPIO
Voltage Sensor Module Battery
┌──────────────┐ ┌────────┐
│ V+ (screw) ──────┼─────┼─── BAT+ │
│ V- (screw) ──────┼─ GND ┼─── BAT- │
│ S ──── G1 ─────│ └────────┘
└──────────────┘
Buttons (all identical wiring)
GPIO 4 ──┤MODE├── GND
GPIO 3 ──┤CAL ├── GND
GPIO 2 ──┤TOL ├── GND
Use opposite legs of the 4-pin button
(left leg → GPIO, right leg → GND) → i recommend to wire the GNDs of the Buttons in series to save space
ON-OFF Switch
Connect Switch to the Battery's positive pole and the ESP32 VBUS/Voltage Sensor + Screw Terminal
Code (On GitHub):
https://github.com/ruidan-web/esp32-digital-level/tree/main
Project Status:
This is an experimental DIY project. Accuracy may vary depending on calibration, assembly, and component quality
Disclaimer:
This project is provided for educational and experimental DIY purposes only. The design, documentation, wiring diagrams, and software are provided as-is, without any guarantees of accuracy, completeness, or safety.
By building or using this project, you agree that you do so at your own risk. I am not responsible for any damage, injury, malfunction, data loss, incorrect measurements, or other issues that may occur from the use, assembly, or modification of this project.
License:
MakerWorld Exclusive License