IoT-Based Motion Detection and Environmental Monitoring System for Agriculture Security Using ESP32

Authors

Hanisah Mohd Zali

Faculty of Engineering, Built Environment and Information Technology, MAHSA University, Selangor, Malaysia (Malaysia)

Nurul Husna Balqis

Faculty of Engineering, Built Environment and Information Technology, MAHSA University, Selangor, Malaysia (Malaysia)

Norul Ashikin Norzain

Faculty of Engineering, Built Environment and Information Technology, MAHSA University, Selangor, Malaysia (Malaysia)

Nik Nurzuliyana Mohd Rajdi

Faculty of Engineering, Built Environment and Information Technology, MAHSA University, Selangor, Malaysia (Malaysia)

Hajar Jaafar

Faculty of Electrical Engineering, UiTM Kampus Pasir Gudang, Johor, Malaysia (Malaysia)

Article Information

DOI: 10.47772/IJRISS.2026.102100222

Subject Category: Educational Technology

Volume/Issue: 10/21 | Page No: 2770-2780

Publication Timeline

Submitted: 2026-10-12

Accepted: 2026-10-17

Published: 2026-10-31

Abstract

Manual patrolling continues to be used on many small farms to locate trespassers, any stray animals and any changes to the field conditions, leaving the site open for much of the day. The low cost Internet of Things (IoT) systems reported in literature typically concentrate on environmental sensing tasks or intrusion detection tasks, and few of them couple an on-site deterrent with off-site notification. A mini-monitoring unit with the integration of motion detection and environmental monitoring using a single ESP32 microcontroller is presented here. A passive infrared (PIR) sensor is used for detecting movement in the monitored area, a DHT11 sensor is used for measuring ambient temperature and relative humidity, and an LED and an active buzzer are used as a local visual and audible alarm. The sensor data and system status are transmitted wirelessly via Wi-Fi to the Blynk IoT platform, and a dashboard is created to display information such as the system's motion state, real-time temperature and humidity readings. The firmware was programmed using the Arduino IDE, tested on the Wokwi simulator and deployed to a breadboard prototype placed next to a scaled up planting enclosure. The two cases that were operating were assessed. In the absence of the motion, the output of the PIR remained LOW, both alarm outputs were off and the unit continued to report temperature and humidity every 2 s. Once the motion was enabled the output from the PIR was HIGH, then the LED and buzzer were turned ON in the same control cycle, the motion status report was displayed on the dashboard, and the environmental readings were not interrupted. During the tests the data of temperature and humidity were successfully displayed on the Blynk dashboard. The results confirm that the unit works as designed in both cases and that a level of farm surveillance can be realised that is practical and achieved using low cost and widely available parts at approximately RM 56 per unit. Sensing range and sensor accuracy and reliance on Wi-Fi are also addressed.

Keywords

ESP32, PIR sensor, DHT11, Blynk IoT, agriculture security

Downloads

References

1. Adeagbo, A. A. (2024). IoT based environment monitoring system using ESP32. arXiv preprint arXiv:2405.14047. https://doi.org/10.48550/arXiv.2405.14047 [Google Scholar] [Crossref]

2. Alui, N., & Mohamed, M. (2023). The prototype of animal intrusion detection and monitoring system using IoT. Evolution in Electrical and Electronic Engineering, 4(2), 707–715. https://doi.org/10.30880/eeee.2023.04.02.085 [Google Scholar] [Crossref]

3. Chaganti, R., Varadarajan, V., Gorantla, V. S., Gadekallu, T. R., & Ravi, V. (2022). Blockchain-based cloud-enabled security monitoring using Internet of Things in smart agriculture. Future Internet, 14(9), 250. https://doi.org/10.3390/fi14090250 [Google Scholar] [Crossref]

4. Elijah, O., Rahman, T. A., Orikumhi, I., Leow, C. Y., & Hindia, M. H. D. N. (2018). An overview of Internet of Things (IoT) and data analytics in agriculture: Benefits and challenges. IEEE Internet of Things Journal, 5(5), 3758–3773. https://doi.org/10.1109/JIOT.2018.2844296 [Google Scholar] [Crossref]

5. Khalid, I. K., & Mohammad Radzi, N. H. (2024). Farm protection system for animal and human theft using solar photovoltaic-powered IoT system. Evolution in Electrical and Electronic Engineering, 5(2), 270–276. https://doi.org/10.30880/eeee.2024.05.02.033 [Google Scholar] [Crossref]

6. Miao, J., Rajasekhar, D., Mishra, S., Nayak, S. K., & Yadav, R. (2023). A fog-based smart agriculture system to detect animal intrusion. arXiv preprint arXiv:2308.06614. https://doi.org/10.48550/arXiv.2308.06614 [Google Scholar] [Crossref]

7. Mohd Khalid, N. K., Jamal, N., Mustafa, F., Zambri, N. A., & Abdullah, M. S. R. (2024). Solar power IoT based smart agriculture system using NodeMCU ESP32. Progress in Engineering Application and Technology, 5(1), 95–102. https://publisher.uthm.edu.my/periodicals/index.php/peat/article/view/14803 [Google Scholar] [Crossref]

8. Putri, D. I. H., Pratama, H. P., & Sari, N. T. A. (2021). Framework design IoT for smart agriculture. Jurnal Sistem Cerdas, 4(1), 1–8. [Google Scholar] [Crossref]

9. Rahman, M. M., Al Shakil, S., & Mustakim, M. R. (2025). A survey on intrusion detection system in IoT networks. Cyber Security and Applications, 3, 100082. https://doi.org/10.1016/j.csa.2024.100082 [Google Scholar] [Crossref]

10. Rajak, P., Ganguly, A., Adhikary, S., & Bhattacharya, S. (2023). Internet of Things and smart sensors in agriculture: Scopes and challenges. Journal of Agriculture and Food Research, 14, 100776. https://doi.org/10.1016/j.jafr.2023.100776 [Google Scholar] [Crossref]

11. Sheikh Mansoor, S., Iqbal, S., Popescu, S. M., et al. (2025). Integration of smart sensors and IoT in precision agriculture: Trends, challenges and future prospectives. Frontiers in Plant Science, 16, 1587869. https://doi.org/10.3389/fpls.2025.1587869 [Google Scholar] [Crossref]

Metrics

Views & Downloads

Similar Articles