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

ESP32-Based Air Quality Monitoring System with I2C Sensor Multiplexing

Image of ESP32-Based Air Quality Monitoring System with I2C Sensor Multiplexing

Circuit Documentation

Summary

The circuit in question is designed around the ESP32 microcontroller, which serves as the central processing unit. The circuit includes an Adafruit TCA9548A I2C multiplexer, multiple 5-pin relimate connectors for peripheral connections, a DHT11 temperature and humidity sensor, and an MQ-5 gas sensor. The ESP32 communicates with the I2C multiplexer, which in turn interfaces with various peripherals through the relimate connectors. The DHT11 and MQ-5 sensors provide environmental data back to the ESP32 for processing.

Component List

ESP32 (30 pin)

  • Description: A 30-pin microcontroller with Wi-Fi and Bluetooth capabilities.
  • Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, Vin, D23, D22, TX0, RX0, D21, D19, D18, D5, TX2, RX2, D4, D2, D15, 3V3

Adafruit TCA9548A

  • Description: An I2C multiplexer that allows multiple I2C devices to be connected to the same I2C bus without address conflicts.
  • Pins: 2SDA, 2SCL, 3SDA, 3SCL, 4SDA, 4SCL, 5SDA, 5SCL, 6SDA, 6SCL, 7SDA, 7SCL, VCC, GND, INPUTSDA, INPUTSCL, RESET, A0, A1, A2, 0SDA, 0SCL, 1SDA, 1SCL

5 pin relimate connector

  • Description: A connector used for interfacing peripherals with the circuit.
  • Pins: vcc, GND, SDA, SCL, ADDR

DHT11

  • Description: A basic, ultra low-cost digital temperature and humidity sensor.
  • Pins: 5V, S, GND

MQ-5

  • Description: A gas sensor used for detecting LPG, natural gas, and coal gas.
  • Pins: VCC, GND, Digi Out, Analog out

Wiring Details

ESP32 (30 pin)

  • D32 connected to MQ-5 Analog out
  • GND connected to common ground net
  • D22 connected to Adafruit TCA9548A INPUTSCL
  • D21 connected to Adafruit TCA9548A INPUTSDA
  • D4 connected to DHT11 S
  • 3V3 connected to common VCC net

Adafruit TCA9548A

  • INPUTSCL connected to ESP32 D22
  • INPUTSDA connected to ESP32 D21
  • GND connected to common ground net
  • VCC connected to common VCC net
  • A0, A1, A2 connected to common ground net (address pins set to 0)
  • 2SDA, 2SCL connected to 5 pin relimate connector SDA/SCL
  • 3SDA, 3SCL connected to 5 pin relimate connector SDA/SCL
  • 4SDA, 4SCL connected to 5 pin relimate connector SDA/SCL
  • 5SDA, 5SCL connected to 5 pin relimate connector SDA/SCL
  • 6SDA, 6SCL connected to 5 pin relimate connector SDA/SCL
  • 7SDA, 7SCL connected to 5 pin relimate connector SDA/SCL
  • 0SDA, 0SCL connected to 5 pin relimate connector SDA/SCL
  • 1SDA, 1SCL connected to 5 pin relimate connector SDA/SCL

5 pin relimate connectors

  • GND connected to common ground net
  • vcc connected to common VCC net
  • SDA/SCL connected to corresponding SDA/SCL on Adafruit TCA9548A

DHT11

  • 5V connected to common VCC net
  • S connected to ESP32 D4
  • GND connected to common ground net

MQ-5

  • VCC connected to common VCC net
  • GND connected to common ground net
  • Analog out connected to ESP32 D32

Documented Code

ESP32 (30 pin) - sketch.ino

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

MQ-5 - sketch.ino

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

Note: The provided code is a template and does not include specific functionality. It is expected that the user will add the necessary code to interact with the sensors and peripherals connected to the ESP32 and MQ-5.