Build a High-Precision Altimeter With ESP32 and MS5611 (Plus Custom CAD Mount)
by The Debunker in Circuits > Arduino
169 Views, 1 Favorites, 0 Comments
Build a High-Precision Altimeter With ESP32 and MS5611 (Plus Custom CAD Mount)
In this project, I built a high-precision digital altimeter using an ESP32 and the MS5611 pressure sensor, capable of detecting small elevation changes in real time.
What makes this project unique is the combination of electronics and mechanical design. I used digital calipers to measure a breadboard and a 30-pin breakout adapter, then designed a custom mounting base in Tinkercad to hold all components securely.
The MS5611 sensor is extremely sensitive to pressure changes, allowing us to estimate altitude using atmospheric pressure. This means even small elevation changes—like walking upstairs—can be detected.
This project demonstrates how to:
- Use a high-precision pressure sensor
- Convert pressure into altitude
- Design custom hardware mounts using CAD
- Combine physical measurement with digital design
Supplies
Electronics
- ESP32
- MS5611 (GY-63) pressure sensor
- 30-pin breakout terminal adapter
- Large breadboard
- Jumper wires
Tools
- Digital calipers (critical for CAD accuracy)
- Computer with Arduino IDE
- 3D printer
- Tinkercad (or similar CAD software)
- Base to mount this. https://makerworld.com/en/models/2595647-esp32-breadboard-project-base-mount#profileId-2864313
Wiring
3.3V - VCC
GND - GND
GPIO 21 - SDA
GPIO 22 - SCL
Measure Your Components
Measure:
- Length and width of the breadboard
- Height and thickness
- Breakout adapter dimensions
- Spacing needed for wiring
Add small tolerance of about 0.2 to 0.5 mm to all measurements.
Design the Mount in Tinkercad
Open Tinkercad and design a base to hold:
- Breadboard
- ESP32
- 30 pin breakout adapter
Make sure:
- Components fit snug but not tight
- Wires have room to route
- USB port is accessible
Export the design as an STL file.
3D Print the Base
Print the model using:
- 0.2 mm layer height
- 10 to 20 percent infill
After printing, test fit all components and adjust design if needed.
Wire the Circuit
Connect the MS5611 to the ESP32 using I2C.
Connections:
ESP32 3.3V to MS5611 VCC
ESP32 GND to MS5611 GND
ESP32 GPIO 21 to SDA
ESP32 GPIO 22 to SCL
Upload the Code
Upload the following code to your ESP32:
Open the Serial Monitor at 115200 baud.
Baseline Calibration
When the device starts, it captures a baseline pressure and altitude.
Keep the device still for a few seconds during startup so it can stabilize.
Read Altitude Data
The screen and serial output will show:
- Current pressure
- Estimated altitude
- Pressure change
- Altitude change
Test the Altimeter
Test the device by changing elevation.
Try:
- Walking upstairs
- Lifting the device up and down
- Moving between floors
You should see altitude and pressure change in real time.
How It Works
The sensor measures air pressure. As altitude increases, air pressure decreases.
The code converts pressure into altitude using a standard atmospheric formula.
Improvements
Add data logging with an SD card
Add a battery for portability
Add an enclosure for outdoor use
Compare readings with known elevations