Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Nano and ESP8266-Based Wi-Fi Environment Monitoring System

View and Edit Project In Cirkit DesignerImage of Arduino Nano and ESP8266-Based Wi-Fi Environment Monitoring System

Drone Based Environment Monitoring System

Summary

This circuit is designed to monitor environmental conditions using various sensors and transmit the data via a WiFi module. The system includes an Arduino Nano microcontroller, an ESP8266 WiFi module, and several sensors including the DHT11 for humidity and temperature, the MQ-135 and MQ-7 for gas detection, and the BMP180 for pressure and temperature. The Arduino Nano reads data from these sensors and sends it to the ESP8266 for transmission.

Component List

  1. Arduino Nano

    • Description: A small, complete, and breadboard-friendly board based on the ATmega328P.
    • Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
  2. ESP8266 ESP-01 WiFi Module

    • Description: A self-contained SOC with integrated TCP/IP protocol stack that can give any microcontroller access to your WiFi network.
    • Pins: TXD, CH_PD, RST, VCC, GND, GPIO_2, GPIO_0, RXD
  3. DHT11

    • Description: A basic, low-cost digital temperature and humidity sensor.
    • Pins: vcc, GND, out
  4. MQ-135

    • Description: A gas sensor that can detect various gases including ammonia, nitrogen oxides, alcohol, benzene, smoke, and carbon dioxide.
    • Pins: D OUT, A OUT, GND, VCC
  5. MQ-7 Breakout

    • Description: A carbon monoxide (CO) sensor.
    • Pins: VCC, GND, DO, AO
  6. BMP180

    • Description: A barometric pressure sensor that can measure atmospheric pressure and temperature.
    • Pins: 3.3, SDA, SCL, GND, VCC

Wiring Details

Arduino Nano

ESP8266 ESP-01 WiFi Module

DHT11

MQ-135

MQ-7 Breakout

BMP180

Code Documentation

/*
 * Drone Based Environment Monitoring System
 * This Arduino sketch reads data from various sensors including DHT11, MQ-135, MQ-7, and BMP180.
 * It then sends the data to an ESP8266 WiFi module for transmission.
 */

#include <DHT.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP085_U.h>

#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);

void setup() {
  Serial.begin(9600);
  dht.begin();
  if(!bmp.begin()) {
    Serial.print("Could not find a valid BMP085 sensor, check wiring!");
    while(1);
  }
}

void loop() {
  // Read DHT11 sensor
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }

  // Read MQ-135 sensor
  int mq135Value = analogRead(A0);

  // Read MQ-7 sensor
  int mq7Value = analogRead(A1);

  // Read BMP180 sensor
  sensors_event_t event;
  bmp.getEvent(&event);
  if (event.pressure) {
    float temperature;
    bmp.getTemperature(&temperature);
    Serial.print("Temperature: ");
    Serial.print(temperature);
    Serial.println(" C");
    Serial.print("Pressure: ");
    Serial.print(event.pressure);
    Serial.println(" hPa");
  } else {
    Serial.println("Sensor error");
  }

  // Send data to ESP8266
  Serial.print("Humidity: ");
  Serial.print(h);
  Serial.print(" %");
  Serial.print(" Temperature: ");
  Serial.print(t);
  Serial.print(" C");
  Serial.print(" MQ-135: ");
  Serial.print(mq135Value);
  Serial.print(" MQ-7: ");
  Serial.print(mq7Value);
  Serial.println();

  delay(2000);
}

This code initializes the sensors and reads data from them in the loop function. The data is then sent to the ESP8266 WiFi module via the serial connection. The DHT11 sensor is used for humidity and temperature, the MQ-135 and MQ-7 sensors are used for gas detection, and the BMP180 sensor is used for pressure and temperature.