Arduino Nano Based Soil Moisture Monitoring System with OLED Display and DHT11 Sensor
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
The circuit in question is designed to monitor soil moisture levels using multiple YL-69 Sonda sensors interfaced with YL-83 Module LM393 comparator modules. The system also includes a DHT11 temperature and humidity sensor and an OLED display for output. An Arduino Nano serves as the microcontroller to process sensor data and control the display. The circuit is powered by a MB102 Breadboard Power Supply Module that can provide both 3.3V and 5V outputs. The circuit is intended for monitoring the health of plants by checking the moisture level in the soil and displaying the temperature and humidity conditions.
Component List
Microcontroller
- Arduino Nano: A compact microcontroller board based on the ATmega328P, featuring digital and analog I/O pins.
Sensors
- YL-69 Sonda: Soil moisture sensor probes that detect the moisture level in the soil.
- YL-83 Module LM393: Comparator modules that interface with the YL-69 Sonda sensors and provide digital output signals.
- KY-015 DHT11: A sensor that measures ambient temperature and humidity.
Display
- 0.96" OLED: A small display that shows graphics and text, interfaced via I2C.
Power Supply
- MB102 Breadboard Power Supply Module 3.3V/5V: A module that provides regulated 3.3V and 5V outputs for breadboard projects.
Resistors
- Resistor (1k Ohms): Used for various purposes in the circuit, likely as pull-up or current-limiting resistors.
Miscellaneous
- Comment: Placeholder for additional notes or comments in the circuit design.
Wiring Details
Arduino Nano
- GND: Connected to the ground rail of the power supply module, OLED display, all YL-83 modules, and the DHT11 sensor.
- 5V: Powers the OLED display, all YL-83 modules, and the DHT11 sensor.
- D2: Digital input connected to the DHT11 sensor signal pin.
- D3 - D9: Digital inputs connected to the digital output pins (D0) of the YL-83 modules through 1k Ohm resistors.
- A4 (SDA), A5 (SCK): I2C communication pins connected to the OLED display.
YL-69 Sonda and YL-83 Module LM393
- Each YL-69 Sonda sensor is connected to a corresponding YL-83 module with "+" and "-" pins.
- The YL-83 modules are powered by the 5V output from the Arduino Nano and have their ground pins connected to the common ground rail.
- The digital output pins (D0) of the YL-83 modules are connected to the digital pins D3 - D9 on the Arduino Nano through 1k Ohm resistors.
KY-015 DHT11
- 5V: Connected to the 5V output from the Arduino Nano.
- S: Signal pin connected to digital pin D2 on the Arduino Nano.
- GND: Connected to the common ground rail.
0.96" OLED
- GND: Connected to the common ground rail.
- VDD: Powered by the 5V output from the Arduino Nano.
- SCK: Connected to analog pin A5 (SCK) on the Arduino Nano.
- SDA: Connected to analog pin A4 (SDA) on the Arduino Nano.
MB102 Breadboard Power Supply Module 3.3V/5V
- Provides the 5V and GND connections for the circuit.
Resistors (1k Ohms)
- Connected between the digital output pins (D0) of the YL-83 modules and the digital pins D3 - D9 on the Arduino Nano.
Documented Code
The code provided is for the Arduino Nano microcontroller. It includes the necessary libraries and defines the pins used for interfacing with the DHT11 sensor and the OLED display. The code initializes the DHT sensor and the display, reads the temperature and humidity from the DHT11 sensor, and reads the digital outputs from the YL-83 modules to determine the moisture level in the soil. The OLED display shows the temperature, humidity, and the number of plants that need watering based on the soil moisture readings.
The code is structured with a setup function that initializes the serial communication, the display, and the DHT sensor. The main loop function reads the sensor data, updates the display with the current temperature and humidity, and checks the soil moisture levels to determine if the plants need watering.
The code also includes animations for the OLED display, represented by arrays of bytes that define the bitmap images for temperature and humidity symbols. These animations are displayed on the OLED along with the sensor readings.
Due to the length of the code, it is not included in this document but is available in the provided files sketch.ino and documentation.txt.