Arduino Mega 2560-Based Environmental Monitoring System with DHT22, MQ-2, and PIR Sensor
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves an Arduino Mega 2560 microcontroller interfacing with a DHT22 temperature and humidity sensor, an MQ-2 gas sensor, and a PIR motion sensor. The Arduino Mega 2560 reads data from these sensors and can be programmed to perform various tasks based on the sensor inputs.
Component List
Arduino Mega 2560
- Description: A microcontroller board based on the ATmega2560.
- Pins: IOREF, RESET, 3V3, 5V, GND, VIN, A0-A15, D0-D53, AREF, SDA, SCL
DHT22
- Description: A digital temperature and humidity sensor.
- Pins: +, Out, -
MQ-2
- Description: A gas sensor that can detect various gases including LPG, i-butane, methane, alcohol, hydrogen, and smoke.
- Pins: GND, VCC, ANALOG, Digital
PIR Sensor
- Description: A passive infrared sensor used to detect motion.
- Pins: VDD, SIG, GND
Comments
- Description: Placeholder components for documentation purposes.
- Pins: None
Wiring Details
Arduino Mega 2560
- 5V: Connected to VDD of PIR sensor, + of DHT22, and VCC of MQ-2.
- GND: Connected to GND of PIR sensor, - of DHT22, and GND of MQ-2.
- D2 PWM: Connected to Out of DHT22.
- A0: Connected to ANALOG of MQ-2.
- D3 PWM: Connected to SIG of PIR sensor.
DHT22
- +: Connected to 5V of Arduino Mega 2560.
- Out: Connected to D2 PWM of Arduino Mega 2560.
- -: Connected to GND of Arduino Mega 2560.
MQ-2
- VCC: Connected to 5V of Arduino Mega 2560.
- GND: Connected to GND of Arduino Mega 2560.
- ANALOG: Connected to A0 of Arduino Mega 2560.
- Digital: Not connected.
PIR Sensor
- VDD: Connected to 5V of Arduino Mega 2560.
- SIG: Connected to D3 PWM of Arduino Mega 2560.
- GND: Connected to GND of Arduino Mega 2560.
Code Documentation
Arduino Mega 2560 Code
sketch.ino
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
documentation.txt
This documentation provides a comprehensive overview of the circuit, including a summary, detailed component list, wiring details, and the code used for the Arduino Mega 2560 microcontroller.