Ugenz Academy/IoT Tutorial

Pressure And Environmental Sensors

10 min read1,904 words

Reading progress

Keep learning

Pressure and Environmental Sensors

Pressure and environmental sensors are used to measure conditions such as atmospheric pressure, altitude, temperature, humidity, air quality, and other environmental parameters.

These sensors are widely used in:

  • Weather stations
  • Drones
  • Aircraft
  • Smartphones
  • IoT systems
  • Smart agriculture
  • Industrial automation
  • Indoor environmental monitoring
  • Robotics
  • Navigation systems

1. What is Pressure?

Pressure is the force exerted over an area.

In simple terms:

Pressure tells us how strongly something is pushing on a given area.

The SI unit of pressure is:

Pascal (Pa)

Other commonly used units include:

  • hPa — hectopascal
  • kPa — kilopascal
  • bar
  • psi
  • atm

For atmospheric pressure, hPa is commonly used.

Typical sea-level atmospheric pressure is around:

1013 hPa

The actual pressure changes with weather and altitude.


2. Atmospheric Pressure

The Earth's atmosphere has weight.

That weight produces atmospheric pressure.

Atmosphere ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ───────────────── Earth

At higher altitude, there is generally less atmosphere above you, so atmospheric pressure decreases.

Therefore:

Altitude ↑ ↓ Atmospheric Pressure ↓

This relationship allows pressure sensors to be used for altitude estimation.


3. What is a Pressure Sensor?

A pressure sensor detects pressure and converts it into an electrical signal that an electronic system can measure.

Basic operation:

Pressure ↓ Pressure-Sensitive Element ↓ Electrical Signal ↓ Microcontroller ↓ Pressure Value

For modern digital sensors:

Pressure ↓ MEMS sensing element ↓ Internal electronics ↓ Digital data ↓ ESP32 / Arduino

4. Types of Pressure

Pressure sensors can measure different types of pressure.

Atmospheric Pressure

Pressure exerted by the surrounding atmosphere.

Used in:

  • Weather stations
  • Altimeters
  • Drones

Gauge Pressure

Pressure measured relative to atmospheric pressure.

Used in:

  • Tires
  • Industrial systems
  • Hydraulic systems

Absolute Pressure

Pressure measured relative to a vacuum reference.

Used in:

  • Industrial measurement
  • Vacuum systems
  • Specialized instruments

5. MEMS Pressure Sensors

Many modern pressure sensors use MEMS technology.

MEMS = Micro-Electro-Mechanical Systems

A MEMS pressure sensor contains extremely small mechanical structures fabricated on a semiconductor.

Conceptually:

External Pressure ↓ Tiny MEMS Structure ↓ Mechanical Change ↓ Electrical Measurement ↓ Digital Processing

This allows pressure sensors to be:

  • Small
  • Low power
  • Fast
  • Affordable
  • Suitable for portable electronics

6. BMP180

The BMP180 is a digital barometric pressure sensor.

It can measure:

  • Atmospheric pressure
  • Temperature

It can also be used to estimate altitude.

Typical communication:

BMP180 ↓ I²C ↓ Arduino / ESP32

It is commonly found in educational and older IoT projects.


7. BMP280

The BMP280 is a popular barometric pressure sensor.

It measures:

  • Temperature
  • Atmospheric pressure

It does not measure humidity.

BMP280 ├── Temperature └── Pressure

It supports digital communication such as:

  • I²C
  • SPI

8. BME280

The BME280 is an environmental sensor that measures:

  • Temperature
  • Humidity
  • Atmospheric pressure
BME280 ┌────┼────┐ ↓ ↓ ↓ Temperature Humidity Pressure

This makes it particularly useful for weather and environmental monitoring.

It can communicate through:

  • I²C
  • SPI

9. BMP280 vs BME280

This is a very important distinction.

FeatureBMP280BME280
Temperature✅✅
Pressure✅✅
Humidity❌✅
I²C✅✅
SPI✅✅
Environmental monitoringGoodBetter

Easy way to remember:

BMP → Pressure + Temperature BME → Pressure + Humidity + Temperature

10. BME680

The BME680 is a more advanced environmental sensor.

It can provide:

  • Temperature
  • Humidity
  • Pressure
  • Gas-resistance measurement
BME680 ├── Temperature ├── Humidity ├── Pressure └── Gas Resistance

It is useful for environmental sensing and indoor-air-quality-related projects.

However, its gas-resistance measurement should not be treated as a direct measurement of a specific gas concentration without appropriate characterization and algorithms.


11. BME688

The BME688 is a newer environmental sensor in the BME family.

It provides:

  • Temperature
  • Humidity
  • Pressure
  • Gas sensing

It can be used with software/algorithms for applications such as:

  • Indoor air monitoring
  • Environmental classification
  • Smart-home systems
  • IoT

Again, gas-sensing results depend heavily on the application, calibration, environmental conditions, and processing.


12. Pressure Sensor Comparison

SensorTemperatureHumidityPressureGas
BMP180✅❌✅❌
BMP280✅❌✅❌
BME280✅✅✅❌
BME680✅✅✅✅
BME688✅✅✅✅

13. Pressure and Altitude

One of the most interesting applications of a pressure sensor is altitude estimation.

As altitude increases:

Altitude ↑ ↓ Air Pressure ↓

Therefore, if a sensor measures atmospheric pressure, software can estimate altitude.

A simplified relationship is:

Altitude ≈ function of pressure

The exact calculation depends on atmospheric conditions and the reference pressure.


14. Example: Drone

A drone can use a barometric pressure sensor to help estimate changes in altitude.

Drone │ BME280 │ ↓ ESP32 │ Flight Controller │ Motors

If the drone moves upward:

Altitude ↑ ↓ Pressure ↓ ↓ Controller detects change

Barometric altitude is useful, but it is not perfect because weather and airflow can also change pressure.


15. Weather Station

A weather station can use several sensors together:

WEATHER STATION │ ┌────────┼────────┐ ↓ ↓ ↓ Temperature Humidity Pressure │ │ │ └────────┼────────┘ ↓ ESP32 ↓ Wi-Fi / Cloud

The system can display:

Temperature : 27.8°C Humidity : 64% Pressure : 1008 hPa

16. Pressure Sensor with ESP32

A BME280 can commonly be connected using I²C.

Typical I²C connections on many ESP32 boards are:

BME280 ESP32 VCC ───────── 3.3V GND ───────── GND SDA ───────── GPIO 21 SCL ───────── GPIO 22

Important: ESP32 board pin assignments can vary depending on the board and your software configuration, so SDA/SCL can also be assigned to other suitable GPIOs.


17. I²C Communication

I²C is a common communication protocol for environmental sensors.

It normally uses two signal lines:

SDA → Serial Data SCL → Serial Clock

Multiple compatible devices can share the same bus if they have suitable addresses.

Example:

ESP32 / \ / \ SDA SCL │ │ ┌────┴─────────┴────┐ │ │ BME280 OLED

Both devices can communicate with the ESP32 over the same I²C bus if their addresses are compatible.


18. SPI Communication

Some pressure/environmental sensors also support SPI.

SPI commonly uses:

SCK MOSI MISO CS

Compared with I²C, SPI generally uses more wires but can provide higher communication speed.


19. Environmental Sensors

"Environmental sensor" is a broad category.

It can include sensors that measure:

  • Temperature
  • Humidity
  • Pressure
  • Gas concentration
  • Air quality
  • Light
  • UV radiation
  • Rain
  • Soil conditions
  • Particulate matter

For example:

Environmental Monitoring │ ┌──────┼────────┐ ↓ ↓ ↓ Temperature Humidity Pressure │ │ │ └──────┼────────┘ ↓ ESP32

20. Air Pressure vs Air Quality

These two terms are often confused.

Air Pressure

Measures the force exerted by the atmosphere.

Example:

BME280

Air Quality

Describes pollution or contamination in the air.

Examples of relevant measurements include:

  • VOC-related sensing
  • CO₂
  • CO
  • Particulate matter
  • Other gases

Different sensors are required for these measurements.

So:

Pressure ≠ Air Quality

21. Environmental Sensor Applications

Weather Monitoring

Measure:

  • Temperature
  • Humidity
  • Pressure
Sensors ↓ ESP32 ↓ Internet ↓ Weather Dashboard

Smart Agriculture

Environmental sensors can monitor greenhouse conditions.

Temperature Humidity Pressure Soil Moisture ↓ ESP32 ↓ Automation

The system can control:

  • Fans
  • Water pumps
  • Ventilation
  • Irrigation

Smart Home

A smart home can monitor indoor conditions.

BME280 ↓ ESP32 ↓ Web Dashboard

Example:

Room Temperature: 28°C Humidity: 61% Pressure: 1007 hPa

22. Server Room Monitoring

Electronic equipment can be sensitive to environmental conditions.

A monitoring system can detect abnormal temperature and humidity.

Temperature Sensor ↓ ESP32 ↓ Threshold Check ↓ ┌───┴────┐ Normal High ↓ Alert

Possible actions:

  • Turn on cooling
  • Activate alarm
  • Send notification
  • Log the event

23. Pressure Sensor Data Logging

Sensor data can be stored over time.

Example:

Time Temperature Humidity Pressure 09:00 26.5°C 60% 1012 hPa 10:00 27.1°C 58% 1011 hPa 11:00 28.0°C 56% 1009 hPa 12:00 29.2°C 54% 1008 hPa

This can help identify environmental trends.


24. Sensor Calibration

Pressure sensors can have measurement errors.

For accurate applications, calibration and proper reference conditions are important.

For example:

Reference Pressure = 1013 hPa Sensor Reading = 1008 hPa

A correction may be necessary depending on the application.

Altitude calculations especially require an appropriate reference sea-level pressure or starting pressure.


25. Common Problems

Problem 1: Wrong Sensor Library

Different sensors require different libraries and configurations.

Problem 2: Wrong I²C Address

A sensor may commonly use an address such as:

0x76

or

0x77

depending on the device configuration.

Problem 3: Incorrect Wiring

Check:

VCC GND SDA SCL

Problem 4: Wrong Voltage

Always check the sensor's operating voltage and the breakout board's specifications.

Problem 5: Incorrect Altitude Reference

Altitude calculated from pressure depends on the reference pressure and atmospheric conditions.


26. Simple ESP32 Environmental System

A practical system can look like:

BME280 ┌──────┼──────┐ ↓ ↓ ↓ Temp Humidity Pressure └──────┼──────┘ ↓ ESP32 │ ┌───────┼────────┐ ↓ ↓ ↓ LCD Wi-Fi SD Card │ │ │ Display Web/App Logging

This single sensor can provide three important environmental measurements.


27. Pressure Sensor in a Smart Weather Station

A more complete system could include:

WEATHER STATION │ ┌──────────────┼──────────────┐ ↓ ↓ ↓ BME280 LDR Rain Sensor │ │ │ └──────────────┼──────────────┘ ↓ ESP32 ↓ Wi-Fi ↓ Web Dashboard

The dashboard could show:

-------------------------------- WEATHER STATION -------------------------------- Temperature : 28.4°C Humidity : 62% Pressure : 1009 hPa Light : 740 lux Rain : No --------------------------------

Key Points to Remember

Pressure

Pressure is the force exerted over an area, and atmospheric pressure can be measured using barometric pressure sensors.

Important sensors

BMP180 → Temperature + Pressure BMP280 → Temperature + Pressure BME280 → Temperature + Humidity + Pressure BME680 → Temperature + Humidity + Pressure + Gas sensing BME688 → Temperature + Humidity + Pressure + Gas sensing

Important interfaces

I²C → SDA + SCL SPI → SCK + MOSI + MISO + CS

Most important relationship

Altitude ↑ ↓ Atmospheric Pressure generally ↓

Practical flow

Environment ↓ Pressure / Environmental Sensor ↓ ESP32 / Arduino ↓ Data Processing ↓ Display / Cloud / Automation

Keep learning. Keep building. Keep growing.

© 2026 Ugenz Academy