MINI PROJECT
MUHAMMAD FAIRUZ BIN IMRAN (192020180)
DIPLOMA COMPUTER ENGINEERING (R2404)
NDJ 30003 - ELECTRONIC INSTRUMENTATION
Detecting Ground Dampness: A Mini-Project System for Detecting Ground Dampness
INTRODUCTION
Landslides are one of the most prevalent natural disasters in the world, and Malaysia is no exception. Landslides are caused for a variety of reasons, including climate change, human activities, and the primary cause, extreme rainfall in Malaysia. Unfortunately, slope monitoring is still done manually in Malaysia. Sensors and an early warning system for slope monitoring have yet to be deployed and disclosed. The system should keep up with technological improvements and evolve toward Industrial Revolution 4.0 to improve the slope monitoring strategy. Installing an Internet of Things (IoT)-based device might help with real-time slope monitoring. The major purpose of this research is to develop a landslide monitoring system, which is a soil monitoring system that employs an IoT-based platform to detect soil moisture conditions. To link the system's hardware and software, the recommended system uses a NodeMCU ESP32 microcontroller with WiFi capability. A soil moisture sensor is used in terms of hardware to gather data on soil moisture levels, which is then shown on the secondary display, an OLED display. Meanwhile, using Adafruit IO as an IoT platform, the soil moisture status monitoring system is shown on the website interface. The data from the sensor is immediately sent to the Adafruit IO online interface. By monitoring the volume of water injected during the surgery, the gadget was successfully tested. Because it could monitor and identify soil moisture levels as a landslide warning indicator, the system performed wonderfully. By replacing the soil moisture sensor with a more accurate and long-lasting sensor, the system may be enhanced.
EQUIPMENT
NodeMCU ESP32 as the microcontroller (ESP32 DEVKIT V1 DOIT)
Soil Moisture Sensor
IIC I2C Serial OLED Display Module
Breadboard
Jumper Wire
PROJECT OBJECTIVE
To store the user's recorded soil moisture status value as an Excel file.
To monitor and measure soil moisture and utilise the information to offer early landslide warnings.
To create software and technology capable of detecting soil dampness, which is a common cause of landslides.
To investigate the functioning and usability of sensors to identify appropriate sensors and IoT devices for detecting changes in soil parameters, notably moisture content, for landslide monitoring.
SCOPE OF PROJECT
The goal of this project is to keep track of the moisture levels in the soil. Landslides are more frequent during wet seasons when infiltration elevates soil moisture levels. A method based on fundamental electrical knowledge has been created to avoid an unplanned avalanche. The data from the soil moisture sensor will be shown visually on the web interface. A capacitive soil moisture sensor will be used to detect and monitor the soil moisture state. The Adafruit IO Website Interface will be used to create an Internet of Things (IoT) platform that will be accessible via a website and mobile devices. The recorded soil moisture status may be downloaded as a Microsoft Excel file from the website.
BLOCK DIAGRAM
The soil moisture sensor was mounted on the NodeMCU ESP32 DEVKIT V1 DOIT to start the procedure. The Raspberry Pi 3 B+, which runs Ubuntu OS (Linux), and the OLED display, which will function as a secondary display, will then be linked to the ESP32 DEVKIT V1 DOIT. The ESP32 DEVKIT V1 DOIT is a WiFi module that connects to the Adafruit IO Website Interface, allowing data from the serial monitor in the Arduino IDE software to be displayed on the website.
FLOWCHART
Schematic Diagram
ARDUINO IDE
The Arduino Integrated Development Environment (IDE) is a cross-platform application written in C and C++ that runs on Windows, macOS, and Linux. It's used to create and upload programmes to Arduino-compatible boards and other vendor development boards that support third-party cores. The IDE's source code is released under the GNU General Public License, version 2. The Arduino IDE has code structure guidelines to support the languages C and C++. The Wiring Project is a software package included with the Arduino IDE that enables you to do a range of common input and output activities. User-written code just requires two simple procedures to start the drawing and conduct the 22 routines.
The main programme loop is generated and linked with a programme stub into an executable cyclic executive programme using the GNU toolchain, which is also included in the IDE version.
CODING
#include <WiFi.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
const char *ssid = "Fairuzimran";
const char *pass = "192020180";
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
WiFiClient client;
#define MQTT_SERV "io.adafruit.com"
#define MQTT_PORT 1883
#define MQTT_NAME "Fairuzimran192020180"
#define MQTT_PASS "aio_pLgw46etTDOBUJWcKQJvWaLT4aQe"
const int Sensor_pin = 36;
int Sensor_value;
Adafruit_MQTT_Client mqtt(&client, MQTT_SERV, MQTT_PORT, MQTT_NAME, MQTT_PASS);
Adafruit_MQTT_Publish Sensor_data = Adafruit_MQTT_Publish(&mqtt, MQTT_NAME "/f/Mini Project");
void setup()
{
Serial.begin(115200);
delay(5);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
}
void loop()
{
MQTT_connect();
Sensor_value = ( ( (analogRead(Sensor_pin) / 1023.00) * 100 ) -100);
Serial.print("Soil Moisture is = ");
Serial.print(Sensor_value);
Serial.println("%");
display.clearDisplay();
display.setTextSize(2);
display.setTextColor(RED);
display.setCursor(0, 10);
display.println("Soil");
display.setCursor(0, 30);
display.println("Moisture");
display.setCursor(0, 50);
display.println(Sensor_value);
display.setCursor(40, 50);
display.println("%");
display.display();
if (! Sensor_data.publish(Sensor_value))
{
delay(5000);
}
delay(5000);
}
void MQTT_connect() {
int8_t again;
if (mqtt.connected()) {
return;
}
Serial.print("Connecting to Adafruit IO");
uint8_t retry = 5;
while ((again = mqtt.connect()) != 0) {
Serial.println(mqtt.connectErrorString(again));
Serial.println("Retrying Adafruit connection in 5 seconds...");
mqtt.disconnect();
delay(5000);
retry--;
if (retry == 0) {
while (1);
}
}
Serial.println("");
Serial.println("Adafruit IO is Connected!");
}
Adafruit Application
The "things" in the Internet of Things are uniquely recognised based on communication and object identification attributes. People, machines, and information may all be used to classify "things." Computers, sensors, televisions, books, and other items are examples of "things." We call these "things" the "Internet of Things" when they have particular qualities that allow them to connect via the "internet."
Adafruit IO is one such cloud service that focuses on IoT cloud installations. Adafruit IO works with a variety of devices, including the Raspberry Pi, ESP32 DEV IT, and Arduino. For the following reasons, IoT developers choose Adafruit IO over other IoT cloud providers:
Powerful API: Provides us libraries for various programming languages, which also provide built-in user interface support.
Dashboard: Understanding data via charts and graphs enables us to make better decisions.
Data Security: Better encryption algorithms protect data on the cloud platform.
Documentation & Community: Many blogs with amazing community support allow continuous development of the products.
Graph Illustration
RESULT
CONCLUSION
The project's Soil Moisture Status Data System for Detecting Ground Dampness was completed on time. The soil moisture sensor will detect the level of moisture in the soil. The signal will be forwarded to the ESP32 on the NodeMCU board, where it will be processed. The captured data value will be shown on the Adafruit IO Website Interface and OLED Display. The data on the Adafruit Io website is graphed and available for download in Excel format. The Soil Moisture Status Data System is entirely computerised.
Comments
Post a Comment