Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use AHT20+BMP280: Examples, Pinouts, and Specs

Image of AHT20+BMP280
Cirkit Designer LogoDesign with AHT20+BMP280 in Cirkit Designer

AHT20 + BMP280 Sensor Module Documentation

1. Introduction

The AHT20 + BMP280 Sensor Module is a versatile and compact environmental sensing solution that combines two powerful sensors in a single module. The AHT20 is a high-precision temperature and humidity sensor, while the BMP280 is a barometric pressure and temperature sensor. Together, they provide accurate measurements of temperature, humidity, and atmospheric pressure, making this module ideal for a wide range of applications.

Common Applications:

  • Weather monitoring systems
  • IoT (Internet of Things) devices
  • Environmental data logging
  • HVAC (Heating, Ventilation, and Air Conditioning) systems
  • Altitude measurement for drones and other devices
  • Smart home automation

2. Technical Specifications

AHT20 Sensor Specifications:

Parameter Value
Supply Voltage 2.0V to 5.5V
Operating Current 0.25 mA (average)
Temperature Range -40°C to 85°C
Temperature Accuracy ±0.3°C
Humidity Range 0% to 100% RH
Humidity Accuracy ±2% RH
Communication Protocol I²C

BMP280 Sensor Specifications:

Parameter Value
Supply Voltage 1.71V to 3.6V
Operating Current 2.7 µA (in normal mode)
Pressure Range 300 hPa to 1100 hPa
Pressure Accuracy ±1 hPa
Temperature Range -40°C to 85°C
Temperature Accuracy ±1°C
Communication Protocol I²C or SPI

Pin Configuration:

Pin Name Description
1 VCC Power supply (3.3V or 5V, depending on the module)
2 GND Ground
3 SDA I²C data line
4 SCL I²C clock line

3. Usage Instructions

Connecting the AHT20 + BMP280 to an Arduino UNO:

  1. Wiring:

    • Connect the module's VCC pin to the Arduino's 5V pin.
    • Connect the GND pin to the Arduino's GND.
    • Connect the SDA pin to the Arduino's A4 pin (I²C data line).
    • Connect the SCL pin to the Arduino's A5 pin (I²C clock line).
  2. Install Required Libraries:

    • Install the Adafruit_AHTX0 library for the AHT20 sensor.
    • Install the Adafruit_BMP280 library for the BMP280 sensor.
    • These libraries can be installed via the Arduino IDE Library Manager.
  3. Arduino Code Example: Below is an example code to read temperature, humidity, and pressure data from the AHT20 and BMP280 sensors.

#include <Wire.h>
#include <Adafruit_AHTX0.h> // Library for AHT20
#include <Adafruit_BMP280.h> // Library for BMP280

// Create sensor objects
Adafruit_AHTX0 aht;
Adafruit_BMP280 bmp;

void setup() {
  Serial.begin(9600);
  while (!Serial); // Wait for Serial Monitor to open

  // Initialize AHT20 sensor
  if (!aht.begin()) {
    Serial.println("Failed to initialize AHT20 sensor!");
    while (1);
  }
  Serial.println("AHT20 sensor initialized.");

  // Initialize BMP280 sensor
  if (!bmp.begin(0x76)) { // Default I²C address for BMP280 is 0x76
    Serial.println("Failed to initialize BMP280 sensor!");
    while (1);
  }
  Serial.println("BMP280 sensor initialized.");
}

void loop() {
  // Read data from AHT20
  sensors_event_t humidity, temp;
  aht.getEvent(&humidity, &temp);

  // Read data from BMP280
  float pressure = bmp.readPressure() / 100.0F; // Convert to hPa
  float altitude = bmp.readAltitude(1013.25); // Sea level pressure in hPa

  // Print sensor data to Serial Monitor
  Serial.print("AHT20 - Temperature: ");
  Serial.print(temp.temperature);
  Serial.print(" °C, Humidity: ");
  Serial.print(humidity.relative_humidity);
  Serial.println(" %");

  Serial.print("BMP280 - Pressure: ");
  Serial.print(pressure);
  Serial.print(" hPa, Altitude: ");
  Serial.print(altitude);
  Serial.println(" m");

  delay(2000); // Wait 2 seconds before next reading
}

Important Considerations:

  • Ensure the I²C address of the BMP280 sensor matches the one in the code (default is 0x76).
  • Use appropriate pull-up resistors (typically 4.7kΩ) on the SDA and SCL lines if not already included on the module.
  • Avoid exposing the sensors to extreme conditions (e.g., high humidity or temperature) for prolonged periods to maintain accuracy.

4. Troubleshooting and FAQs

Common Issues and Solutions:

  1. Issue: The sensors are not detected by the Arduino.

    • Solution: Check the wiring and ensure the SDA and SCL lines are connected correctly. Verify the I²C addresses in the code.
  2. Issue: Incorrect or fluctuating readings.

    • Solution: Ensure the module is not exposed to electrical noise or unstable power supply. Use a decoupling capacitor (e.g., 0.1µF) across the VCC and GND pins.
  3. Issue: BMP280 altitude readings are inaccurate.

    • Solution: Update the sea level pressure value in the code (1013.25 hPa by default) to match the current atmospheric pressure at your location.

FAQs:

Q1: Can I use this module with a 3.3V microcontroller?
A1: Yes, the module supports both 3.3V and 5V logic levels. Ensure the power supply matches your microcontroller's voltage.

Q2: What is the maximum I²C bus speed supported?
A2: The sensors support standard (100 kHz) and fast (400 kHz) I²C speeds.

Q3: Can I use SPI communication for the BMP280?
A3: Yes, the BMP280 supports SPI, but this module is typically configured for I²C communication.


This documentation provides a comprehensive guide to using the AHT20 + BMP280 sensor module. Whether you're a beginner or an experienced user, this guide will help you integrate the module into your projects with ease.

Explore Projects Built with AHT20+BMP280

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based BMP280 Barometric Pressure Sensor Interface
Image of Esp32 and Bmp280: A project utilizing AHT20+BMP280 in a practical application
This circuit connects an ESP32 development board with a BMP280 sensor. The ESP32 provides power to the BMP280 and communicates with it via I2C, using GPIO 22 and GPIO 21 as the serial clock line (SCL) and serial data line (SDA), respectively. The purpose of this circuit is likely to read atmospheric pressure and temperature data from the BMP280 sensor.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 and BME280 Sensor-Based Wi-Fi Weather Station
Image of BME280_ESP32: A project utilizing AHT20+BMP280 in a practical application
This circuit consists of an ESP32 microcontroller connected to a BME/BMP280 sensor. The ESP32 reads temperature, pressure, and humidity data from the sensor via I2C communication and prints the data to the Serial Monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Environmental Sensing Station with Hall Effect Sensors and Logic Level Conversion
Image of Stazione meteo: A project utilizing AHT20+BMP280 in a practical application
This circuit is designed to collect environmental data using an ESP32 microcontroller connected to a BMP280 pressure sensor, an LTR390 UV light sensor, and a DHT22 temperature and humidity sensor. It also includes multiple 3144 Hall effect sensors interfaced through bi-directional logic level converters, indicating mixed voltage operation. The ESP32 serves as the central hub for sensor data acquisition and processing.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 and INA3221-Based Smart Power Monitoring System with Bluetooth and Environmental Sensing
Image of NMEA2000 Engine Interface: A project utilizing AHT20+BMP280 in a practical application
This circuit is a sensor monitoring and communication system that uses an ESP32 microcontroller to read data from a BME/BMP280 environmental sensor and an INA3221 power monitor. The ESP32 communicates with the sensors via I2C and transmits data wirelessly using an HC-05 Bluetooth module. Additionally, the circuit includes optocouplers and diodes for signal isolation and protection.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with AHT20+BMP280

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Esp32 and Bmp280: A project utilizing AHT20+BMP280 in a practical application
ESP32-Based BMP280 Barometric Pressure Sensor Interface
This circuit connects an ESP32 development board with a BMP280 sensor. The ESP32 provides power to the BMP280 and communicates with it via I2C, using GPIO 22 and GPIO 21 as the serial clock line (SCL) and serial data line (SDA), respectively. The purpose of this circuit is likely to read atmospheric pressure and temperature data from the BMP280 sensor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of BME280_ESP32: A project utilizing AHT20+BMP280 in a practical application
ESP32 and BME280 Sensor-Based Wi-Fi Weather Station
This circuit consists of an ESP32 microcontroller connected to a BME/BMP280 sensor. The ESP32 reads temperature, pressure, and humidity data from the sensor via I2C communication and prints the data to the Serial Monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Stazione meteo: A project utilizing AHT20+BMP280 in a practical application
ESP32-Based Environmental Sensing Station with Hall Effect Sensors and Logic Level Conversion
This circuit is designed to collect environmental data using an ESP32 microcontroller connected to a BMP280 pressure sensor, an LTR390 UV light sensor, and a DHT22 temperature and humidity sensor. It also includes multiple 3144 Hall effect sensors interfaced through bi-directional logic level converters, indicating mixed voltage operation. The ESP32 serves as the central hub for sensor data acquisition and processing.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of NMEA2000 Engine Interface: A project utilizing AHT20+BMP280 in a practical application
ESP32 and INA3221-Based Smart Power Monitoring System with Bluetooth and Environmental Sensing
This circuit is a sensor monitoring and communication system that uses an ESP32 microcontroller to read data from a BME/BMP280 environmental sensor and an INA3221 power monitor. The ESP32 communicates with the sensors via I2C and transmits data wirelessly using an HC-05 Bluetooth module. Additionally, the circuit includes optocouplers and diodes for signal isolation and protection.
Cirkit Designer LogoOpen Project in Cirkit Designer