MINISTRY OF EDUCATION AND TRAINING HO CHI MINH CITYUNIVERSITY OF TECHNOLOGY AND EDUCATION FACULTY FOR HIGH QUALITY TRAINING ELECTRONICS AND TELECOMMUNICATION ENGINEERING TECHNOLOGY IOT-B
INTRODUCTION
PROBLEM STATEMENT
By 2050, the global population is projected to reach 9.8 billion, representing a 25% increase from current figures Urbanization is expected to rise significantly, with nearly 70% of the population living in urban areas, up from 49% To sustain this growing metropolitan population, agricultural productivity must double by 2050 Additionally, crop production will be crucial not only for food supply but also for essential industries, as crops like cotton and rubber play a vital role in the economies of many nations These increasing demands will further strain already limited agricultural resources.
The Internet of Things (IoT) is a transformative force that is reshaping our lives by making everyday objects smarter and more interconnected This extensive network connects devices with IP addresses, such as smartphones, lights, watches, and cars, to the internet, enabling automation and reducing the need for human intervention However, despite its many advantages, IoT raises significant concerns, including privacy violations and an over-reliance on technology, which can lead to job losses.
The 4.0 industrial revolution offers a new approach to resolve this problem By developing the new green house using IoT, it will show a portrait of traditional agriculture by enhancing plant productivity and minimize wasting crop The goal of this idea is not just revitalizing traditional farming methods but also to provide a solution for family home garden This product help farmers by collecting real-time data, monitoring the sensors and controlling the actuators to take care of the garden Precision plays a key role in agriculture so that we could use the collected data from the sensors for analytics [4].
While IoT technology in agriculture offers numerous benefits, it also presents significant drawbacks A major concern is its reliance on Wi-Fi signals; if the system loses connectivity, it can disrupt the entire monitoring process of the garden Additionally, individuals may desire personal space, making it challenging to maintain constant connectivity with family and friends while managing every aspect of their lives Furthermore, the potential misuse of personal data poses another serious downside to the implementation of IoT in agriculture.
The "Closed Garden System" allows farmers to effectively monitor and manage a limited number of crops by utilizing advanced technology This system builds on previous monitoring frameworks, providing real-time data on temperature and humidity while enabling users to control watering through a smartphone To enhance functionality during connectivity issues, users can set a timer for automatic watering The project focuses on designing a closed garden structure with an irrigation system that can be easily managed via a web interface.
OBJECTIVES
Research, design and manufacture “Automatic Monitoring and Control System in Agriculture based on IoT with the following fundamental features:
Research the theoretical basis of designing and constructing the garden.
Research and analyze the planting seeds automation system.
Design the seeding and watering system for each pre-programmed location, and integrated camera to easily monitor the garden remotely via smartphone device.
Developing an automatic system based on temperature, humidity, and soil moisture monitoring.
Designing the interface to monitor and control the devices on smartphones.
METHODOLOGY Error! Bookmark not defined 1.4 LIMITATIONS
The thesis investigates various references on garden monitoring and control systems to identify the most suitable option It assesses the latest requirements for automated garden design and focuses on creating an effective design tailored to its intended purpose The research includes evaluating simulation outcomes, performing actual modeling, and conducting a final assessment to enhance design results.
The limitations of this project are:
Using an ESP32 as a central microcontroller and camera for photo transmission is not ideal due to slow signal transmission speeds and heavy reliance on internet bandwidth.
The system is fully controlled via the app.
The system responding depends on the strength of the Wi-Fi signal.
Design a device’s model especially for educational purposes.
RESEARCH CONTENT Error! Bookmark not defined 1.6 THESIS REPORT OUTLINE Error! Bookmark not defined
This innovative product enables remote control of devices over the Internet, making it ideal for urban families It simplifies garden management by automating essential tasks such as seeding, watering, and monitoring environmental variables through a smartphone Users can conveniently set system conditions, eliminating the need for close proximity when managing their garden.
To achieve efficient design and construction while minimizing costs, the project has utilized various research methods, including reviewing documentation on microcontroller programming for Arduino IDE and studying fundamental electronics theory for hardware design.
The project’s report is arranged into 5 chapters:
Chapter 1 provides a comprehensive introduction to the topic, outlining the methodology and research content while highlighting relevant real-world facts It also offers a brief overview of the content, along with the objectives and limitations of the thesis.
Chapter 2: Literature review introduce research status, research direction, services and applications being used.
Chapter 3: Methodology: provides a general model of the system as a whole, the blocks of the system, the design and calculation of each block, and the devices used in these blocks.
Chapter 4: Experiment results: presenting the construction results of the system model
Chapter 5: Conclusion and recommendations: draw conclusions, strengths and weaknesses Present the plan of the topic in the future.
LITERATURE REVIEW
GREENHOUSE MODEL
Currently, our country has also applied and deployed many types of vegetable growing system in greenhouses, in which the two main types are prominent:
A closed greenhouse is a structure entirely enveloped in plastic film, including the roof and doors, designed to protect against insects It features a flat roof with slanted sides and is constructed using concrete columns or welded/screwed iron frames The plastic film used is highly durable, offering resistance to ultraviolet rays, sunlight, and wind This design ensures a long-lasting and effective environment for gardening.
Fig 2.1 Realistic closed garden model
An opened greenhouse is primarily covered on the roof and partially enclosed to mitigate the adverse effects of rain and wind, facilitating vegetable growth even during the rainy season However, it does not provide insect repellant properties.
Fig 2.2 Realistic opened garden model
While greenhouse models offer significant benefits, they also present several limitations Closed greenhouses can create environments with elevated temperature and humidity, leading to mold issues if not closely monitored Conversely, open greenhouses are vulnerable to insect infestations due to inadequate coverage Additionally, the installation costs and initial investments for these systems are often substantially higher than traditional farming methods Furthermore, the reliance on manual monitoring and supervision can pose challenges for individuals lacking farming experience.
This project aims to leverage the benefits of existing methods while addressing their limitations, particularly by reducing costs Furthermore, it introduces an Internet-based monitoring system, allowing users to easily manage their gardens remotely.
INTERNET OF THINGS (IoT)
The Internet of Things could be a network of physical devices Kevin Ashton
In 1999, researchers from the Massachusetts Institute of Technology introduced the concept of the Internet of Things (IoT), which encompasses a network of interconnected devices such as computers, mobile phones, refrigerators, doors, and cars that communicate and share data online Related technologies include Machine-to-Machine communication, the Web of Everything, ubiquitous computing, and embedded Internet systems For effective connectivity, physical objects must be equipped with microcontrollers and sensors that transmit data to an IoT cloud server, serving as a central hub for data exchange.
The Internet of Things (IoT) is a transformative technology that facilitates real-time communication and data exchange between people and devices It plays a crucial role in recording, analyzing, and evaluating data, which is essential for informed decision-making and reaching specific objectives.
Fig 2.3 Applications of the Internet of Things
Figure 2.3 illustrates the diverse applications of the Internet of Things (IoT) across various sectors, such as monitoring sunlight, temperature, and humidity for agriculture, controlling home appliances via smart home mobile applications, and overseeing water and biogas levels Additionally, IoT enhances safety by activating fire alarms in animal farms, providing flood alerts, and facilitating data recording The growing compatibility of IoT with smartphones is boosting its popularity, with user-friendly applications like Blynk, NETPIE, and Line Notify supporting these technologies.
COMMUNICATION PROTOCOLS
UART, or Universal Asynchronous Receiver-Transmitter, facilitates asynchronous serial data transmission by converting incoming and outgoing data into a serial binary stream It employs serial to parallel conversion to transform 8-bit serial data from a terminal computer into parallel data, while also converting parallel data from the CPU back into serial form This modulated data is transmitted at a specified baud rate, ensuring efficient communication.
The UART begins communication with a start bit of '0', as illustrated in figure 2.4 This start bit signals the beginning of serial data transfer, while the stop bit marks the end of the data exchange Additionally, a parity bit is included to ensure data integrity, with even parity indicated by '0' (representing an even number of 1's) and odd parity indicated by '1' (representing an odd number of 1's).
A single transmission line is utilized for data transmission, where '0' represents a blank space and '1' indicates a symbol condition During transmission, the Least Significant Bit (LSB) is typically sent first, with the transmitter delivering one bit at a time After transmitting one bit, the next bit follows, ensuring that all data bits reach the receiver at a specified baud rate, with each bit transmitted with a slight delay.
9600 baud rates, for example, each bit is sent with a 108 micro-second’s delay.
The RxD line (Receiver) is responsible for receiving data, as illustrated in Fig 2.6 Upon reading the data frame, the receiving UART counts the number of bits with a value of 1 to determine whether the total is even or odd If the parity bit is 0, indicating even parity, the sum of the 1 bits in the data frame will be even Conversely, if the parity bit is 1, indicating odd parity, the sum of the 1 bits will be odd.
When the parity bit aligns with the data, the UART confirms an error-free transmission Conversely, if the parity bit is 0 with an odd total, or 1 with an even total, the UART detects alterations in the data frame.
The Inter-Integrated Circuit (I2C) Protocol is a protocol expected to permit numerous "peripheral" digital coordinated circuits ("chips") to interface with at least one
I2C, depicted in Fig 2.7, utilizes two wires for asynchronous serial communication This protocol supports up to 128 devices and enables a multi-controller setup, allowing various controllers to connect with any peripheral device on the bus.
The I2C bus consists of two key signals: SDA (data) and SCL (clock) The bus controller continuously generates the clock signal, while some peripheral devices have the ability to pull the clock line low, effectively halting the controller from sending more data.
The start and stop sequences are distinct events where the SDA (data line) shifts while the SCL (clock line) remains high, as shown in Fig 2.8 During data transmission, the SDA must remain stable and not shift when the SCL is high These sequences signify the initiation and conclusion of communication with the slave system.
Fig 2.8 Start(left) and Stop(right) condition
For every 8 bits transmitted, each 8-bit byte of data necessitates 9 SCL clock pulses for transmission A LOW ACK bit from the receiving device indicates successful data reception and readiness for the next byte, as illustrated in Fig 2.9.
If it responds with a High-level bit, it means it cannot take any more data and the master should stop the transfer by sending a stop sequence.
I2C addresses are typically 7 bits in length; however, the master device transmits 8 bits when sending the 7-bit address The additional bit indicates whether the master is writing to or reading from the slave device Specifically, if this bit is set to 0, the master is sending data to the slave, while a value of 1 indicates that the master is reading from the slave The 7-bit address occupies the upper 7 bits of the byte, with the Read/Write (R/W) bit positioned in the least significant bit.
Fig 2.11 The master sends data to slave bit sequence
Bit R/W is set to LOW so master sends data to slave at 0xC0 which is illustrated in Fig 2.11 above.
Fig 2.12 The master reads data from slave bit sequence
Bit R/W is set to HIGH so master reads data to slave at 0xC1 as shown in Fig 2.12.
The IEEE (Institute of Electrical and Electronics Engineers) has established a numbering system to classify and standardize various technical protocols Currently, the four prevalent Wi-Fi standards are 802.11a, 802.11b, 802.11g, and 802.11n.
Figure 2.13 provides a comprehensive overview of Wi-Fi standards from 1999 to 2019, detailing the name of each Wi-Fi standard, its release year, frequency, speed, and both indoor and outdoor range for each type.
Fig 2.13 Summary of Wi-Fi standards
802.11 o First introduced by IEEE in 1997. o Support for a maximum bandwidth of 2Mbps o
Uses the 2.4 GHz radio frequency. o Disadvantages: the amount of bandwidth is too low, leading to difficulties in data transmission.
The IEEE 802.11b standard, released in July 1999, evolved from the original 802.11 standard and supports bandwidths of up to 11 Mbps, making it comparable to traditional Ethernet Operating on the 2.4 GHz radio frequency, it is well-suited for home networks due to its reasonable pricing and relatively good signal quality within its range However, its limitations include restricted bandwidth and susceptibility to interference from various devices that also utilize the 2.4 GHz frequency, such as cordless phones and microwave ovens.
The 802.11a standard was developed alongside 802.11b but is less commonly adopted due to its higher cost and the rapid popularity of 802.11b It is compatible with enterprise network models and offers a maximum bandwidth of 54 Mbps, operating on a 5GHz radio frequency The advantages of 802.11a include high speed and reduced interference from other devices due to its frequency However, it also has drawbacks such as a relatively high cost, a limited operating range, and susceptibility to obstructions.
The 802.11g standard, released between 2002 and 2003, combines features from both 802.11a and 802.11b, offering a maximum bandwidth of 54Mbps and operating on the recommended 2.4GHz frequency Its advantages include high speed, an extensive active signal range, and reduced signal obstruction However, it comes with a relatively higher cost compared to 802.11b and may experience interference from other devices utilizing the same 2.4GHz frequency.
METHODOLOGY
HARDWARE DESIGN
The automatic garden system is highly beneficial for farmers who find frequent trips to the greenhouse unnecessary This innovative solution allows remote farmers to plant, irrigate, and monitor crop quality through a mobile shower head equipped with a camera Additionally, an LCD display provides essential information regarding the garden's status, including temperature, humidity, and soil moisture This design carefully selects relevant parameters to optimize garden management.
3.1.1 System block diagram design a Block diagram
The system is composed of ten interconnected blocks designed to form a stable operating framework, as illustrated in the block diagram of Fig 3.1 The power block serves as the main energy source for the entire system ESP32 CPUs, equipped with ESP32 CAM, automatically connect to a pre-coded Wi-Fi network to receive sensor data, which is continuously updated to the Blynk app via Wi-Fi The ESP32 CAM uploads images at regular intervals to the Blynk app, where the data is displayed simultaneously on both the app and an LCD This setup allows for remote control of various modules, including drivers, fans, lamps, and pumps, through the Blynk app.
Fig 3.1 Block diagram of the system b Explain the function of blocks
Power Supply: This block provide electricity for all blocks include control actuator, camera, sensors, platform, screen and other working blocks.
CPU: Gather data from the device then analyze and control the control actuator, and display on
Server: Analyze the image getting from the camera and transfer that to platform block.
Camera: Getting images from surrounding environment and transmit signal to modified images block.
The Blink app serves as a versatile platform that facilitates communication between the analysis block and the camera Initially designed for display and storage purposes, it now enables users to operate and monitor their gardens remotely via Wi-Fi.
Display: Allow users to monitor environment variables on screen.
Sensor: Gather environment variables to know the latest status of the garden.
Actuator: Receiving signals from central control block and control speed and flow of the engine also the status of the device such as lights, fans and water pump.
3.1.2 Circuit design and calculation a Supply power block
Table 3.1 summarizes the equipment utilized in this project, detailing the device names, quantities, and the operating voltage and current specifications provided by the manufacturers This information is essential for calculating the power consumption and selecting the appropriate power source for the model.
TABLE 3.1 Parameters about power consumption of components
Name of Part Amount Operating Voltage Current Consumption
From the formula (3.1) and the table The Power Consumption of this System is calculated as below:
To ensure optimal performance, select the source block with conditions I power ≥ I max and P power ≥ P max The 220 AC transformer to DC power (12V - 5A) honeycomb, with a power rating of 60 W, is sufficient to supply power to all blocks.
Here the group select a 12V - 5A honeycomb set to ensure the continuity of the garden and restricting the use of batteries to lead to expensive cost.
The 12V 5A honeycomb power supply, a type of 12-volt DC power supply, efficiently converts 110/220VAC AC voltage into 12V DC, making it ideal for powering various equipment An actual image of the 12V 5A honeycomb power supply is shown in Fig 3.2 below.
The honeycomb power supply offers essential features such as heat dissipation, overload protection, short circuit protection, and overvoltage protection It ensures high efficiency and maintains a stable output voltage within the allowed power limits, preventing voltage drops even under high consumption currents.
The LM2596 is a highly efficient step-down DC voltage converter, commonly referred to as a buck converter, capable of delivering stable output voltages of 3.3V, 5V, and 12V This compact module can reduce input voltages from 30VDC to 1.5VDC while maintaining an impressive efficiency of 92% It is ideal for applications in power distribution and low voltage power supply for devices such as cameras and robots.
1 The output voltage can be adjusted by the using the flat head turn the variable resistor.
2 The converter could supply up to 3 amps of direct current load current.
3 Heating shutoff and current limit are two methods of circuit protection.
Fig 3.4 The schematic of LM2596 Buck Converter
The LM2596 is known for its high current rating of 3A It has many versions with fixed output voltage such as 3.3V, 5V and 12V But, the most famous is the
LM2596-ADJ which has variable output voltage as Fig 3.4 shows above.
Unregulated voltage is supplied to pin 1 (Vin) via a filter capacitor to minimize input noise To activate the IC, the ON/OFF pin (pin 5) must be grounded; setting it high will place the IC in off mode, preventing leakage current and conserving battery power The feedback pin plays a crucial role in regulating the output voltage by sensing its level and adjusting the internal switch's frequency accordingly Ultimately, the output voltage is delivered through pin 2, following an LC filter.
Calculate the output voltage for LM2596
The LM2596-ADJ's output voltage is adjustable through its feedback pin, which receives feedback voltage from a voltage divider composed of resistors R1 and R2, as illustrated in the circuit diagram.
The value of these R1 and R2 determines the output voltage of the IC The formula for calculating R1 and R2 is given below.
Here the value of Vref can be considered as 1.23V hence the formula becomes
R1 should be in range from 1k Ohm to 5k Ohm R2 is required needing flat-head screwdriver to adjust resistance.
For example, if the thesis requires Vout = 5V Follow formula (3.2) the R2 is:
So it is required needing to turn varible resistor and measuring it output voltage that equal to 5V.
The LM2596 circuit, detailed in Tab 3.2, operates with an input voltage range of 3V to 30V The output voltage is adjustable via the rotating resistor R2, and the circuit is capable of delivering a power output of 15W.
TABLE 3.2 LM2596 buck converter specifications
Output voltage Adjustable from 1.5V to 30V
The ESP32 is an advanced, cost-effective microcontroller that features low power consumption, integrated Wi-Fi, and dual-mode Bluetooth It is designed to deliver optimal performance and RF capabilities, making it reliable and versatile for various applications, including voice encoding, music streaming, and MP3 decoding.
The ESP32 is designed for reliable operation in industrial environments, with a temperature range of -40°C to +125°C It utilizes advanced calibration technology to continuously correct external circuit imperfections and adapt to varying external conditions.
The ESP32 offers a comprehensive and integrated Wi-Fi network solution, enabling application storage and offloading Wi-Fi functions from other handlers It boots directly from external flash when storing applications and can connect to other controllers requiring Wi-Fi through interfaces like SPI, I2C, or UART In this setup, the ESP32 serves as the central processor, as illustrated in the accompanying image and pin diagram.
Fig 3.5 Pin diagram of ESP32 Module
Tab 3.3 describes the specifications of the pinout configuration of the ESP32 module, including parameters such as pin category, pin name, and more details.
TABLE 3.3 The pinout configurations of the ESP32 module
Pin Category Pin Name Details
Power Micro-USB, 3.3V, Micro-USB: The ESP32 may be charged via a
5V: To power the board, a regulated 5V can be given to this pin, which will then be regulated to 3.3V by the on-board regulator.
3.3V: To power the board, a regulated 3.3V can be applied to this pin.
GND stands for ground pins.
Enable EN The microcontroller is reset using the pin and button.
Analog Pins ADC1_0 to ADC1_5 and 12-bit 18 Channel ADC is used to measure
ADC2_0 to ADC2_9 analog voltage in the range of 0-3.3V.
Input/Output GPIO0 to GPIO39 There are 39 GPIO pins in total, which can be
Pins utilized as input or output pins 0V (low) and
3.3V (high) voltages (high) However, pins 34 to 39 can only be utilized as inputs.
Capacitive T0 to T9 These ten pins can be utilized as touch pins, Touch pins similar to the ones found on capacitive pads.
RTC GPIO RTCIO0 to RTCIO17 The ESP32 may be woken up from deep sleep pins state using these 18 GPIO pins.
Serial Rx, Tx TTL serial data is received and transmitted using this device.
External All GPIO An interrupt can be triggered by any GPIO. Interrupts
PWM All GPIO Any GPIO may be modified to work as PWM through the software, and there are 16 distinct channels available for PWM.
VSPI GPIO23 (MOSI), Used for SPI-1 communication.
GPIO19(MISO), GPIO18(CLK) and GPIO5
HSPI GPIO13 (MOSI), Used for SPI-2 communication.
GPIO12(MISO), GPIO14(CLK) and GPIO15 (CS)
The specifications of the ESP32 module are detailed in Tab 3.4, highlighting key parameters such as the type of microprocessor, maximum operating frequency, operating voltage, and the number of analog input pins It also includes information on digital to analog converter pins, digital input/output pins, direct current on I/O and 3.3V pins, SRAM capacity, and standard communication types, including Wi-Fi and Bluetooth capabilities.
Analog Input Pins 12-bit, 18 Channel
Digital I/O Pins 39 (of which 34 is normal GPIO pin)
DC Current on I/O Pins 40 mA
DC Current on 3.3V Pin 50 mA
Bluetooth V4.2 – Supports BLE and Classic Bluetooth c Image processing block
SOFTWARE DESIGN
Blynk is a leading IoT platform community that enables seamless synchronization of systems to the cloud, allowing users to design intuitive User Interfaces (UI) and enhance User Experiences (UX) for easy control, data analysis, and efficient management of deployed products at scale.
Blynk is a powerful platform tailored for the Internet of Things (IoT), enabling remote control of hardware, displaying sensor data, and storing and visualizing information, among other innovative features.
Blynk is a versatile IoT platform compatible with both iOS and Android devices, enabling seamless integration with various microcontrollers, including Node MCU ESP8266, Arduino, Raspberry Pi, and ESP32 The platform comprises three key components, as illustrated in Fig 3.22.
The Blynk application, which is used to control a device and display data on widgets.
The Blynk server, which is a cloud service responsible for all communications between smartphones and things.
Blynk libraries offer a range of widgets, including control buttons, display formats, notifications, and time management tools, allowing devices to efficiently transmit sensor data to a mobile application for easy viewing and management.
Fig 3.22 Blynk App working diagram
Step 1: The Blynk app is the app to build an over-the-air console The user needs to install the Blynk app, which supports both Android and iOS platforms The Fig 3.23 below is the application store of the two platforms on smartphones which can download the Blynk application here.
Fig 3.23 The application store of the two platforms on smartphones
Step 2: The next step is to create new account to use the App As demonstrated in Fig.
3.24 that create it using an email Moreover, if already have an account, just log in and skip to next step.
Fig 3.24 How to create an account on Blynk App
Step 3: Create a project and device
To start a new project, input the project name, select the device type as ESP32, and choose the connection type as Wi-Fi before clicking the Create button Refer to Fig 3.25 for the visual representation of the project creation process.
Fig 3.25 Create a project and device
After clicking the Create button, the system will send a unique 32-character authentication token code to the email address provided during account creation This device auth token is essential for programming in Arduino for server connections, as illustrated in Fig 3.26.
Fig 3.26 Enter authentoken, user name and password of Wi-Fi to program
Figure 3.27 illustrates a project featuring a blank canvas, allowing users to add various widgets for information display and control Numerous widget types are available, each serving distinct purposes that can be explored further.
Fig 3.27 Where to add widgets
Step 4: Add the widget to the project by clicking any blank space in the canvas or the icon on the top menu which can be chose the type of widget to add and drag and drop it on the canvas Actual image of add the widget to the project shown in Fig 3.28.
Fig 3.28 Add the widget to the project
Each widget features a dedicated Settings screen, accessible by clicking on the widget within the canvas The most crucial parameter is the PIN, which corresponds to the PIN used in the Blynk app, allowing for programming in Blocky Node Wi-Fi on Arduino Figure 3.29 illustrates the configuration process for the widget in the Blynk app.
You can enhance your project by incorporating various types of widgets The control interface allows you to switch between EDIT and PLAY modes, enabling interaction with the dashboard via the Play button To modify the canvas design or widget settings, simply click the STOP button.
Fig 3.30 as below shown the information will be displayed when upload the program to the microcontroller and click the play button in the application.
Fig 3.30 The information displayed on the App
The system features a 16X2 LCD panel that displays sensor data, real-time images, a temperature chart, and device status to the Blynk App It offers both MANUAL and AUTO operating modes, allowing users full control over the devices in MANUAL mode.
Users can set the environment's settings in AUTO mode, and the devices will function depending on the environment's measurements of those values. a Selection mode
Fig 3.31 Flow chart of selection mode
The flowchart in Fig 3.31 demonstrates the process of changing the working mode of the system Upon launching, the program initializes the microprocessors, sensors, and variables on the LCD panel By default, the system starts in AUTO mode, displaying three environmental parameters Users can change the operating mode by selecting the SETTING button, and any updates to the hardware will require the system to validate the status from the ESP32 via the App.
In MANU mode, it allows users to control devices arbitrarily and be updated to the App.
In AUTO mode, it allows the user to set the limit values of the environment, then automatically turn the device on or off. b Manual mode
In MANU mode, users can arbitrarily control six devices, including step motors, servos, pumps, fans, and lights, using buttons on the Blynk App, as illustrated in Fig 3.32.
Fig 3.32 Manual mode flow chart
In manual mode, the program continuously monitors the buttons, reversing their state when activated This allows devices to be turned on or off based on the state variable, independent of environmental parameters Additionally, the device status is updated in real time within the App and communicated back through ESP.
Fig 3.33 Automatic mode flow chart
EXPERIMENT RESULTS
MODEL IMPLEMENTATION
The completed system, as shown in Fig 4.1, measures 50x50 cm and features multiple planting zones Each zone will be monitored, watered, and cared for by a header equipped with a camera.
Fig 4.1 Automatic Monitoring and Control System in Agriculture based on IoT
Figure 4.2 illustrates a thoroughly tested wiring system, featuring multiple inspections of connections, secure zip-wire bundling, and silicone adhesive application to prevent wire breakage during short circuits Additionally, the system is housed in an aesthetically pleasing casing that provides water protection.
Fig 4.2 The system control cabinet
The system features a 16x2 LCD panel that provides real-time updates on essential garden data, including temperature, air humidity, soil moisture, the current operating mode, and network connection status Conveniently mounted on the electrical cabinet, the LCD ensures easy observation and continuously refreshes the garden's environmental information.
Fig 4.3 The system is not connected to the network
The LCD panel displays the temperature at 29 degrees, air humidity at 76 percent, and soil moisture at 22 percent However, the "!" symbol indicates that the device is not connected to a Wi-Fi network To update the system's information in the Blynk app, it is essential to connect the device to a Wi-Fi network.
The LCD screen shows "Ma," signifying that the system is in Manual mode and connected to the Wi-Fi network for monitoring via the Blynk app If a different letter appears, it indicates that the system has activated the automatic garden cultivation mode, which regulates the garden's conditions according to the programmed code.
Fig 4.4 The system is connected to the network
Upon opening the app, users receive instant information about their garden, including a temperature chart that allows them to review the garden's status over previous days.
Blynk app users can monitor their gardens through a 2MP camera mounted on the header, allowing them to receive real-time updates on garden conditions via streaming video, as illustrated in Fig 4.5.
Fig 4.5 Camera captures live images
The sow seeds system offers a unique feature that allows users to remotely monitor the planting process through a camera or app In manual mode, users select the area and activate the seeding button for automatic sowing, while in auto mode, the device autonomously moves to pre-programmed positions and seeds when the button is pressed.
The garden seeding head enables efficient seed planting across various garden areas, utilizing both automatic and manual modes for operation In manual mode, users can select specific areas to seed via the Blynk app, while the automatic mode allows the system to sequentially plant the correct seeds in all designated areas.
Fig 4.6 The sow seeds system is working
In MANUAL mode, users have full control over their equipment, allowing them to turn devices such as heat lamps, fans, water pumps, and seeds on and off as needed, all through the Blynk App.
In this mode, enabled actuators are highlighted in blue against the function background, with the light and fan functions operational, while watering and sowing functions remain inactive, as illustrated in Fig 4.7 The term "Manual" on the left indicates that the garden is under manual management Users can also find options to "SET SOIL MOISTURE" and "SET TEMPERATURE" in the upper right corner, which will appear in Automatic mode Additionally, the "CHOOSE POSITION" feature allows users to input a number to navigate to the desired section and perform necessary functions.
When pressing the "Fan" buttons on the Blynk app, the system will do and turn off/on the device.
In automatic mode, sensors monitor garden conditions such as humidity, temperature, and soil moisture to perform actions like watering, activating fans, or heating lights The app's preset parameters are compared with the sensor data, allowing the microcontroller to effectively manage the garden's needs.
Fig 4.8 The garden is in ideal condition
The microcontroller activates and deactivates mechanisms to maintain optimal garden conditions when sensor readings surpass set thresholds For example, if the ambient temperature exceeds the user-defined limit of 28 degrees, the system responds accordingly.
Celsius, the system will automatically activate the fan to dissipate the heat, as depicted. The system can also control the temperature and humidity here, as seen in Fig 4.9.
Fig 4.9 Set the temperature and humidity
4.2 PLANTING EXPERIMENTS ON THE SYSTEM
The graduation project titled "Automatic Monitoring and Control System in Agriculture based on IoT" has been successfully completed after extensive research and development This project involved experimenting with the cultivation of "Baby Leaf Mustard PN-912" in a 50 square centimeter garden, divided into multiple 8x8 positions, while utilizing the system's integrated monitoring features.
Fig 4.10 The map of garden
To optimize growth and development, choose organic soil and fast-growing plant varieties suitable for your conditions, as demonstrated in Fig 4.11 After experimentation, users can also incorporate these plants into their diet.
Using the "Auto" mode and the "Sow seed" button on App Blynk, following which you can watch the automatic planting procedure using the App's built-in camera
Fig 4.12 Select Auto mode and press the sow seed button