Arduino Leonardo Environmental Monitoring System with Relay-Controlled Watering
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary of the Circuit
This circuit is designed to interface various sensors and actuators with an Arduino Leonardo microcontroller. The sensors include a DHT11 temperature and humidity sensor, an Adafruit BMP180 barometric pressure sensor, a Light Dependent Resistor (LDR) for light sensing, and a capacitive soil moisture sensor. Actuators in the circuit include a fan, a water pump, and a relay module for controlling high-power devices. An OLED display is also included for data visualization. The circuit is powered by a 4xAA battery pack. The Arduino Leonardo facilitates data acquisition from the sensors and controls the actuators based on the sensor inputs.
Component List
Arduino Leonardo (Rev3b)
- Microcontroller board based on the ATmega32u4
- Provides digital and analog I/O pins
- Features USB connectivity for programming and communication
DHT11
- Digital temperature and humidity sensor
- Provides a calibrated digital output
Adafruit BMP180
- Digital barometric pressure sensor
- Also provides temperature measurements
- Uses I2C interface for communication
LDR (Light Dependent Resistor)
- Changes resistance based on the light intensity
- Used for light sensing applications
Fan
- Electric fan for cooling or air circulation
- Powered by 5V supply
NPN-Transistor
- Bipolar junction transistor used as a switch or amplifier
- Controls the fan operation in this circuit
Capacitive Soil Moisture Sensor V1.2
- Measures the moisture content in soil
- Provides analog output
Relay module 1 channel
- Electrically operated switch
- Allows for controlling high-power devices with low-power signals
4xAA Battery Pack
- Provides power to the circuit
- Holds 4 AA batteries connected in series
Water Pump
- Electric pump for moving water
- Controlled by the relay module
OLED 1.3"
- Small display for showing data
- Uses I2C interface for communication
Wiring Details
Arduino Leonardo (Rev3b)
5Vconnected to DHT11, Adafruit BMP180, LDR, NPN-Transistor base, Capacitive Soil Moisture Sensor, Relay module, OLED displayGNDconnected to DHT11, Adafruit BMP180, LDR, Capacitive Soil Moisture Sensor, Fan, OLED display, Relay module, 4xAA battery pack NEG, Water PumpD2/SDAconnected to DHT11 sensor data pinSCLconnected to Adafruit BMP180 and OLED display for I2C clockSDAconnected to Adafruit BMP180 and OLED display for I2C dataA0connected to LDR analog outputD4/A6connected to Relay module signal pinA1connected to Capacitive Soil Moisture Sensor analog outputD9 PWM/A9connected to NPN-Transistor collector
DHT11
5VandGNDfor power supplySfor data output connected to Arduino LeonardoD2/SDA
Adafruit BMP180
+5VandGNDfor power supplySCLandSDAfor I2C communication with Arduino Leonardo
LDR
VCCandGNDfor power supplyA0for analog light intensity output connected to Arduino LeonardoA0
Fan
5VandGNDfor power supply- Controlled by NPN-Transistor
NPN-Transistor
Bconnected to Arduino Leonardo5VCconnected to Arduino LeonardoD9 PWM/A9Econnected to Fan5V
Capacitive Soil Moisture Sensor V1.2
VCCandGNDfor power supplyAOUTfor analog moisture level output connected to Arduino LeonardoA1
Relay module 1 channel
5VandGNDfor power supplySfor signal input connected to Arduino LeonardoD4/A6NCnormally closed contact connected to Water PumpVCCCOMcommon contact connected to 4xAA battery packPOS
4xAA Battery Pack
POSandNEGfor power supplyNEGconnected to Arduino LeonardoGNDPOSconnected to Relay moduleCOM
Water Pump
VCCandGNDfor power supplyVCCconnected to Relay moduleNC
OLED 1.3"
GNDandVCCfor power supplySCLandSDAfor I2C communication with Arduino Leonardo
Documented Code
No code was provided for the microcontroller. The documentation of the code would typically include descriptions of the functions, algorithms, and logic used to read sensor data, control actuators, and display information on the OLED screen. It would also include setup and loop functions for the Arduino sketch, along with any necessary library imports and global variable definitions.