Measuring Air Pressure Changes From Temperature in a Sealed System Using ESP32 Sensors

by The Debunker in Circuits > Arduino

106 Views, 1 Favorites, 0 Comments

Measuring Air Pressure Changes From Temperature in a Sealed System Using ESP32 Sensors

IMG_6332.jpg
IMG_6331.jpg

This project demonstrates how temperature directly affects air pressure using real sensor data inside a sealed environment.

Using an ESP32, a high precision MS5611 pressure sensor, and a BME280 environmental sensor, I built a system that measures temperature, humidity, and pressure in real time. The sensors are placed inside a sealed mason jar to isolate a fixed amount of air.

By heating and cooling the jar, we can observe how air pressure increases with temperature and decreases when cooled. The system includes a two minute stabilization delay to ensure accurate baseline measurements before each test.

This project highlights the relationship between temperature and pressure using real world data and provides a clear, visual demonstration of gas behavior in a controlled environment.

Supplies

IMG_6337.JPG
IMG_6338.JPG

Electronics

  1. ESP32 development board
  2. GY-63 MS5611-01BA03 (high precision pressure sensor)
  3. BME280 sensor (temperature, humidity, pressure)
  4. Breadboard
  5. Jumper wires
  6. Extermal USB Battery Pack

Other

  1. Mason jar with lid (airtight seal)
  2. Ice
  3. Heat source (room heat or gentle external warming)
  4. Optional: camera for recording results
  5. Computer with Arduino IDE
  6. USB cable for ESP32
  7. 3D printed base https://makerworld.com/en/models/2595647-esp32-breadboard-project-base-mount#profileId-2864313

Build the Sensor System

IMG_6335.JPG

Build the Sensor System

  1. Connect ESP32 and sensors using I2C wiring
  2. Mount everything on your breadboard
  3. Optional: use your 3D printed base for stability

📸 Include:

  1. Top-down wiring photo
  2. Close-up of sensors

ESP32 PinConnections

3.3V to VCC (both sensors)

GND to GND (both sensors)

GPIO 21 to SDA

GPIO 22 to SCL


Upload the Code

Screenshot 2026-03-30 161300.png
  1. Install required libraries:
  2. Adafruit BME280
  3. Adafruit GFX
  4. Adafruit ST7789
  5. Upload the provided sketch
  6. Open Serial Monitor to confirm readings

📸 Include:

  1. Serial output screenshot
  2. LCD screen powered on



Baseline Stabilization

IMG_6341.jpg

When powered on:

  1. The system waits 2 minutes
  2. This allows:
  3. Sealing the jar
  4. Temperature equalization
  5. Stable baseline capture

📌 This is CRITICAL for accuracy and judges will like this.

Seal the System

IMG_6331.jpg
  1. Place the electronics inside the mason jar
  2. Seal the lid tightly during countdown
  3. Avoid touching the glass during baseline

📸 Include:

  1. Jar sealed with sensors inside


Heating Experiment

YT Short.00_00_49_22.Still001.png
YT Short.00_00_33_16.Still003.png
  1. Apply gentle heat externally
  2. Observe:
  3. Temperature increases
  4. Pressure increases

Example Results (use your real numbers)

  1. +12°F temperature
  2. +700 Pa pressure increase

📸 Include:

  1. Before vs after readings
  2. Graph if possible


Cooling Experiment

YT Short.00_01_55_06.Still002.png
  1. Reset system
  2. Add ice around the jar

Observe:

  1. Temperature drops
  2. Pressure drops significantly

Example Results

  1. -5°F temperature
  2. -2800 Pa pressure drop

📸 Include:

  1. Ice setup
  2. Display readings


Results & Analysis (VERY IMPORTANT)

IMG_6334.JPG

This experiment shows:

  1. Air is made of moving molecules
  2. Heating increases molecular motion
  3. Faster molecules = more collisions = higher pressure
  4. Cooling reduces motion = lower pressure

Why the sealed jar matters:

  1. Keeps air volume constant
  2. Prevents pressure equalization with surroundings
  3. Makes changes measurable

Real-world connection:

  1. Weather systems
  2. Atmospheric pressure changes
  3. Thermodynamics


Improvements & Future Work

  1. Add SD card logging
  2. Graph results in Excel
  3. Add external temperature sensor
  4. Compare sealed vs open air system