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)

Screenshot 2026-03-30 165858.png
IMG_6343.jpg

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:

  1. Use a high-precision pressure sensor
  2. Convert pressure into altitude
  3. Design custom hardware mounts using CAD
  4. Combine physical measurement with digital design


Supplies

Electronics

  1. ESP32
  2. MS5611 (GY-63) pressure sensor
  3. 30-pin breakout terminal adapter
  4. Large breadboard
  5. Jumper wires

Tools

  1. Digital calipers (critical for CAD accuracy)
  2. Computer with Arduino IDE
  3. 3D printer
  4. Tinkercad (or similar CAD software)
  5. 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

IMG_6348.JPG

Measure:

  1. Length and width of the breadboard
  2. Height and thickness
  3. Breakout adapter dimensions
  4. Spacing needed for wiring

Add small tolerance of about 0.2 to 0.5 mm to all measurements.

Design the Mount in Tinkercad

Screenshot 2026-03-30 165249.png
Screenshot 2026-03-30 165235.png

Open Tinkercad and design a base to hold:

  1. Breadboard
  2. ESP32
  3. 30 pin breakout adapter

Make sure:

  1. Components fit snug but not tight
  2. Wires have room to route
  3. USB port is accessible

Export the design as an STL file.

3D Print the Base

IMG_6346.JPG
IMG_6347.JPG
Screenshot 2026-03-30 165618.png

Print the model using:

  1. 0.2 mm layer height
  2. 10 to 20 percent infill

After printing, test fit all components and adjust design if needed.

Wire the Circuit

IMG_6344.jpg

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

Screenshot 2026-03-30 170458.png

Upload the following code to your ESP32:

Open the Serial Monitor at 115200 baud.



Baseline Calibration

FV58PONMNDMK3WF.jpg

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

F1EDLPJMNDMK3W6.jpg

The screen and serial output will show:

  1. Current pressure
  2. Estimated altitude
  3. Pressure change
  4. Altitude change


Test the Altimeter

FH4XSABMNDMK3Z0.png

Test the device by changing elevation.

Try:

  1. Walking upstairs
  2. Lifting the device up and down
  3. Moving between floors

You should see altitude and pressure change in real time.

How It Works

IMG_6345.jpg

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