Arduino Mega 2560 Environmental Data Logger with DHT22 Sensors and Soil Moisture Monitoring
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
The circuit is designed around an Arduino Mega 2560 microcontroller, which serves as the central processing unit. The circuit includes multiple sensors and a storage module, specifically two SparkFun Soil Moisture Sensors, three DHT22 temperature and humidity sensors, and an SD card module for data logging. The sensors are powered by the 5V output from the Arduino and are interfaced with various digital and analog pins for data acquisition. The SD card module is interfaced with the SPI pins for data storage. Pull-up resistors are used for the DHT22 sensors' data lines.
Component List
Arduino Mega 2560
- Microcontroller board based on the ATmega2560
- It has 54 digital input/output pins (of which 15 can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button.
Resistor (10k Ohms)
- Three resistors with a resistance of 10k Ohms each
- Typically used as pull-up resistors in this circuit
DHT22 (Wokwi Compatible)
- Three DHT22 temperature and humidity sensors compatible with Wokwi simulation
- Each sensor has a VCC, SDA, NC (not connected), and GND pin
SD Card Module
- A module for reading and writing data to an SD card
- Interfaces with the Arduino via SPI (Serial Peripheral Interface)
SparkFun Soil Moisture Sensor
- Two soil moisture sensors that measure the volumetric content of water in the soil
- Each sensor has a VCC, GND, and SIG (signal) pin
Wiring Details
Arduino Mega 2560
- 5V and GND pins are used to power the sensors and the SD card module
- Analog pins A0 and A1 are connected to the SIG pins of the soil moisture sensors
- Digital pins D30, D31, and D32 are connected to the SDA pins of the DHT22 sensors through 10k Ohm pull-up resistors
- SPI pins D50 (MISO), D51 (MOSI), D52 (SCK), and D53 (CS) are used to interface with the SD card module
Resistor (10k Ohms)
- Connected between the 5V supply and the SDA pin of each DHT22 sensor
DHT22 (Wokwi Compatible)
- VCC pins connected to the 5V supply from the Arduino
- GND pins connected to the ground of the Arduino
- SDA pins connected to digital pins D30, D31, and D32 on the Arduino through 10k Ohm pull-up resistors
SD Card Module
- GND pin connected to the ground of the Arduino
- VCC pin connected to the 5V supply from the Arduino
- MISO, MOSI, SCK, and CS pins connected to digital pins D50, D51, D52, and D53 on the Arduino, respectively
SparkFun Soil Moisture Sensor
- VCC pins connected to the 5V supply from the Arduino
- GND pins connected to the ground of the Arduino
- SIG pins connected to analog pins A0 and A1 on the Arduino
Documented 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
The code file documentation.txt is empty and does not contain any additional information.