In this how to build a Wi-Fi based smart farm monitoring system project tutorial, we are going to be using ESP8266 Wi-Fi Module to create a wireless access point to view some farm parameters on a home garden model. We are going to be measuring soil moisture content, digital humidity and temperature readings of the green plants in the model garden. This smart agricultural monitoring system, using Arduino design, should also be able to notice when there is night time so that it can activate a grow lamp that can enhance further growth of the garden plants. So, in this Wi-Fi based Smart Farm Monitoring System project; we aim to achieve the following:
Alternatively, you can get a SMPS with 12V, ≥ 3A with two DC-DC buck converters. Regulate 1 DC-DC buck converter to output 12V and the other to source 5V respectively.
The circuit diagram is built around the Atmega328P-PU Chip and where the 16MHz crystal is connected, the ceramic capacitors connected too. In this standalone version design of Arduino, the pushbutton was used to reset the program.
The microcontroller was powered by a 5V from a 5V linear power supply. The same 5V was used to power the DHT11 sensor, the 5V relay module, soil moisture sensor and a 3.3V regulator that powers the ESP8266-01 (ESP-01).
From the breadboard version and circuit diagram shown above, the humidity sensor is connected to the output pin of the 5V voltage regulator, and the signal pin is connected to the analog pin 0 of the Atmega328P-PU IC.
The following source code is coded into the Arduino IDE to effectively use the soil moisture sensor for the how to build a Wi-Fi based smart farm monitoring system.
/*PROGRAM TO TEST AND ADJUST THE SOIL ,MOISTURE CONTENT FOR WI-FI BASED SMART FARM MONITORING SYSTEM PROJECT */double sensor;
void setup() {
Serial.begin(9600);
}
void soilMonitor() {
// read the input on analog pin 0:
sensor = analogRead(A0);
// Convert the analog reading (which goes from 0 - 1023) to a range (0 - 100):
double TP = map(sensor, 0.00, 1023.00, 100.00, 0.00);
serial.println(TP);
delay(500);
}
void loop() {
soilMonitor();
}
To set and set the proper soil moisture content for our plants in the model garden, we code these syntax into the Arduino IDE, verify it for errors and upload it into out standalone MCU. We then open our serial monitor window and ensure that the communication between the MCU and the PC is set at 9600 baud rate as stated in the setup function.
We would see the readings on the serial monitor and we could calibrate them using the onboard potentiometer on the soil moisture sensor board.
In the first line, we declared the sensor read as a double because we are expecting floating point readings from the sensor. In the setup function, we started the serial communication to start displaying readings on the serial monitor screen. We created our own function soilMonitor() to read the signal the sensor pin connected to A0 of the MCU. We then mapped this reading such that the analog reading from the MCU which is from 0 to 1023 is mapped from 100 to 0. This means that; a value of 0.00 (since the reading is a floating point number) of the soil moisture sensor gets converted to 100.00 and the value of 1023.00 gets converted to 0.00.
The DHT11 sensor is connected as shown in the the circuit diagram above, the pin 3( the data signal pin) of the the DHT11 is connected to pin 12 of the Atmega328P-PU IC while the Vcc and the GND pin are connected the 5V and the GND of the power supply. Which is also where the pin 7 and 8 of the Atmega328P-PU has option for the Vcc and the GND. The following sketch below is uploaded into the Arduino IDE to check and test for the accurate reading of the digital humidity and temperature sensor.
//Import the DHT11 libs
#include <DHT.h>
#include <DHT_U.h>
// what digital pin are we connecting the DHT11 signal pin on the Atmega328
#define DHTPIN 6
// Define the type of dht you're using!
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
void setup() {
//begin the dht
dht.begin();
}
void loop() {
float h = dht.readHumidity();
// Read temperature as Celsius (the default)
float t = dht.readTemperature();
int Temp = t;
int Hum = h;
//print it out on the serial monitor window
serial.print(Hum);
serial.print(Temp);
//delay for half a sec
delay(500);
}
The ESP8266 module will be configured as a standalone WiFi access point in this Wi-Fi based smart farm monitoring system project. This means there will be no binding to an existing Wi-Fi network that is to be required for its mode of operation. To connect, the smartphone must be connected to the created access point though.
The circuit diagram shows the connection of the ESP8266 to the Atmega328P-PU as well as the DHT11.
For how to create a free GUI app using RemoteXY and Arduino to control home appliances, read this post.
Open the RemoteXY editor by logging onto their webpage. We would advise creating an account so that your projects can be saved for future reference. Start your new project design. Name it what you will like. In our case, since this project was inspired by Dami, a final year student at landmark varsity, we just simply named it DAMI FARM.
Next we selected a switch button for the user to manually turn on or off the DC pump when he or she feels like the parameters on the screen.
Highlight this switch button, then select the “Snap to pin” property to 7 (DC pump connection) value in the right pane of the “Element” tab.
Again, drag aand name it the project name. in this project, we had it as Smart farm as the caption just above it all.
Add two more labels to the under the switch button icon and edit these labels as shown below.
To communicate wirelessly in this How to Build a Wi-Fi based Smart Farm Monitoring System Project; Go to the website or Playstore to download the remoteXY app.
Run your sketch and then open the app and click on the add or (+) button.
Click on the Wi-Fi access point option available in the lists of options.
This would open another page that shows something like this shown below.
Turn on your Wi-Fi network (if it is not turned on) and search for the Wi-Fi access point network. This is very important for this How to Build a Wi-Fi based Smart Farm Monitoring System Project to work
You wuld see the network next, connect to it and start viewing and accessing you project remotely via Wi-Fi.
Check out the video of how the project is working below:
We have done justice to How to Build a Wi-Fi based Smart Farm Monitoring System Project. What do you think? Can you build similar a project design? Let us know in the comment section if you followed this guide to achieve a successful project work. You can contact us and send us pictures and videos of your project design on WhatsApp, Twitter, Telegram, Instagram to and send us pictures or ask questions too.
To build this project, you will typically need an ESP8266 or ESP32 Wi-Fi module, an Arduino board, various sensors (such as soil moisture, temperature, humidity, and light sensors), a relay module to control water pumps or other devices, and a power supply. Additionally, you may need a cloud platform or IoT service to view real-time data remotely.
The system collects data from sensors placed throughout the farm, such as soil moisture or temperature. The Wi-Fi module (ESP8266 or ESP32) sends this data to an IoT cloud platform where users can monitor the farm conditions remotely through a mobile app or web interface. Automated actions like irrigation can be triggered based on sensor data.
Yes, you can integrate relays or automated switches into the system to control irrigation systems, lights, or other equipment. By setting thresholds in the code (e.g., soil moisture levels), the system can automatically turn on or off the irrigation system based on real-time data.
You can access real-time farm data through any device connected to the internet, such as a smartphone or computer. The system uses a cloud-based IoT platform like ThingSpeak, Blynk, or custom-built web servers to display the data. You can monitor and control the farm from anywhere with Wi-Fi.
To ensure reliability, use a stable Wi-Fi connection, secure your system with proper encryption methods, and select sensors that are designed for outdoor use and can withstand farm conditions (e.g., water-resistant sensors). Additionally, regularly maintain the system to check for sensor malfunctions or network interruptions.
The Alpha's Warlock In "The Alpha's Warlock," the narrative centers around two main characters: Alpha Kael,…
embracing imperfections Let’s talk about something that touches each of our lives in one way…
The Cold War: A Tense Standoff Introduction The Cold War was not just a period…
The Birth of Bitcoin Introduction In a world where traditional finance often feels cumbersome and…
The Broken Mute’s Revenge In "The Broken Mute's Revenge," the story revolves around a young…
Introduction Imagine a classroom where students take the reins of their own education, setting their…
This website uses cookies.