Arduino UNO with DHT22, MQ-5, KY-026 Flame Sensor, and LoRa Connectivity for Environmental Monitoring
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary of the Circuit
This circuit integrates an Arduino UNO microcontroller with a DHT22 temperature and humidity sensor, an MQ-5 gas sensor, a KY-026 Flame Sensor, and a LoRa Ra-02 SX1278 module for wireless communication. The Arduino UNO serves as the central processing unit, interfacing with the sensors to collect environmental data and using the LoRa module to transmit the data wirelessly. The sensors are powered by the Arduino's voltage supply lines, and their outputs are connected to the Arduino's analog and digital input pins for data acquisition. The LoRa module is interfaced with the Arduino via SPI communication and control lines.
Component List
Arduino UNO
- Microcontroller board based on the ATmega328P
- Features digital I/O pins, analog input pins, and power supply pins
- Utilized for controlling the sensors and handling communication with the LoRa module
DHT22
- Digital temperature and humidity sensor
- Provides calibrated digital output
- Used for measuring ambient temperature and humidity
MQ-5 Gas Sensor
- Gas sensor for detecting LPG, natural gas, and coal gas
- Outputs both digital and analog signals
- Employed for monitoring gas levels in the environment
KY-026 Flame Sensor
- Infrared flame sensor capable of detecting a flame or a light source of a wavelength in the range of 760nm to 1100 nm
- Outputs both analog and digital signals
- Used for fire detection
LoRa Ra-02 SX1278
- Wireless transceiver module based on the SX1278
- Operates on the 433 MHz frequency band
- Used for long-range wireless communication
Wiring Details
Arduino UNO
- 5V pin connected to VCC pins of DHT22, MQ-5, and KY-026 Flame Sensor
- GND pin connected to GND pins of DHT22, MQ-5, KY-026 Flame Sensor, and LoRa Ra-02 SX1278
- 3.3V pin connected to 3.3V pin of LoRa Ra-02 SX1278
- A0 pin connected to Analog out pin of MQ-5
- D13 pin connected to SCK pin of LoRa Ra-02 SX1278
- D12 pin connected to MISO pin of LoRa Ra-02 SX1278
- D11 pin connected to MOSI pin of LoRa Ra-02 SX1278
- D10 pin connected to NSS pin of LoRa Ra-02 SX1278
- D9 pin connected to RST pin of LoRa Ra-02 SX1278
- D7 pin connected to DAT pin of DHT22
- D6 pin connected to DO pin of KY-026 Flame Sensor
- D4 pin connected to DI00 pin of LoRa Ra-02 SX1278
DHT22
- VCC pin connected to 5V of Arduino UNO
- GND pin connected to GND of Arduino UNO
- DAT pin connected to D7 of Arduino UNO
MQ-5 Gas Sensor
- VCC pin connected to 5V of Arduino UNO
- GND pin connected to GND of Arduino UNO
- Analog out pin connected to A0 of Arduino UNO
KY-026 Flame Sensor
- VCC pin connected to 5V of Arduino UNO
- GND pin connected to GND of Arduino UNO
- DO pin connected to D6 of Arduino UNO
LoRa Ra-02 SX1278
- 3.3V pin connected to 3.3V of Arduino UNO
- GND pin connected to GND of Arduino UNO
- SCK pin connected to D13 of Arduino UNO
- MISO pin connected to D12 of Arduino UNO
- MOSI pin connected to D11 of Arduino UNO
- NSS pin connected to D10 of Arduino UNO
- RST pin connected to D9 of Arduino UNO
- DI00 pin connected to D4 of Arduino UNO
Documented Code
Arduino UNO Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
The provided code is a template for the Arduino UNO and does not contain any functional code. It consists of two primary functions: setup() which runs once upon reset or power-up, and loop() which runs continuously after setup() completes. The user is expected to fill in these functions with code to initialize the sensors and handle data collection and transmission using the LoRa module.