1694 views|0 replies

12

Posts

1

Resources
The OP
 

Automatic watering system based on esp32s2-work submission [Copy link]

 This post was last edited by Ziqifeinu on 2022-10-24 15:54
  • Introduction

Design name: Balcony ecological garden automatic management system.

Functional introduction: A set of equipment that can automatically water and spray garden plants. It mainly has the following functions:

  1. It has networking function, can report garden status through the network, and issue preset instructions to execute corresponding functions.
  2. Monitor environmental conditions, including light intensity (if the light is too strong, it will prompt the need for shading, and consider adding automatically controlled screens in the future), ambient temperature (spray to cool down when the temperature is too high), and soil temperature and humidity (automatically water when the soil is dry).
  3. Integrated into the smart home control system, mainly I built a smart home system myself using other development boards, which can display the data reported by this garden management system on the screen. Later, I will consider establishing a garden database, doing some statistical data, and creating some decision-making tasks.

Works photos:

  • System Block Diagram

The system block diagram is shown in the figure above. ESP32 collects sensor data, makes corresponding decisions and executes them based on the sensor data. At the same time, it reports the sensor data to the control terminal through MQTT, receives the instructions issued by the control terminal and executes them.

There are 3 types of sensors:

  1. Light intensity sensor: It is implemented using a photoresistor and obtains light intensity data by sampling the photoresistor voltage.
  2. Ambient temperature and humidity sensor: The common DH11 sensor is used here to obtain temperature and humidity data through single bus communication.
  3. Soil moisture sensor: It uses a capacitive direct-insertion sensor to output analog data, and the soil moisture data can be obtained through ADC sampling.

There are two control loops:

  1. Drip irrigation control circuit: It consists of a water source, a water pipe, and a small circulating water pump. When the water pump is powered on, water can be pumped into the flower pot.
  2. Spray control circuit: It is composed of an air pressure water sprayer, a water pipe, a nozzle, and a normally closed water valve. When the water valve is energized, the water flow path is opened, and water mist is sprayed out from the nozzle under the action of air pressure.

In addition, I have a Raspberry Pi 3B+ at home, which has been used as a home server. In order to complete this experiment, an MQTT broker was built on the Raspberry Pi to transfer MQTT data packets.

There is also an 86-box development kit that I applied for previously. The Qt environment has been ported to it. I can directly use Qt to write programs and build a simple control terminal to display the status of the watering system and provide simple buttons to control watering or spraying.

  • Functional Description

There are 4 tasks:

  1. Data collection task: collect data according to instructions
  2. Execution task: Control the equipment to complete watering or spraying according to instructions
  3. Remote communication tasks: reporting data or receiving remote control instructions via MQTT
  4. Decision-making tasks: control the data collection task to collect data; send sensor data to the remote communication task; parse the remote instructions received by the remote task. Control the execution of tasks based on sensor data and remote instructions.

The tasks are related to each other as shown in the figure below:

  • Work source code
auto_watering.rar (35.24 KB, downloads: 4)

  • Work function demonstration video

Silent version. Since it takes time for the sensor data to change, I directly send instructions on the remote terminal (86 development board) to let it execute watering and spraying. The logic of sensor judgment is the same. After remote execution, you can see that the corresponding action is triggered.

演示视频

  • Project Summary

This project was made according to my actual needs. The functions are not very cool, and the environment is indeed a bit simple. I bought experimental sensors and water pumps and valves on the Internet, and used a pressure spray bottle to pressurize the water. The whole thing is in the style of a garbage dump, but the effect is very practical. The growth of that pot of cat grass is almost entirely dependent on this device to complete the spraying (the seeds need to be kept moist during the germination stage) and drip irrigation (the water demand is relatively large after the germination is completed, and the roots absorb water very quickly), and the whole system is powered by batteries, so you can put it anywhere you want.

During this process, I came into contact with esp32 for the first time. I felt that it was very easy to use and the information was complete. IDF was integrated into vs code, which was very friendly to the development environment. Moreover, almost every peripheral has a complete use case. During the coding process, you can implement the functional code by only referring to the use case. The API provided by the original manufacturer has detailed documentation, and the naming and layering are very good, simple and easy to use. Our company recently has a project similar to a gateway, and is ready to use the esp32 chip to provide WiFi and Bluetooth functions.

  • other

In recent months, the company has been busy with chip bringup. This automatic watering project has also been on and off. Most of the functions were completed during the National Day holiday. Although the basic functions have been achieved, there is still a big gap from the expected effect. The ESP32 screen display program and video push function have not been implemented. The most important thing is that it only supports one drip irrigation function (I forgot to water the jasmine when growing cat grass, which caused a lot of jasmine to wither). I will improve it later when I have free time.

Moreover, the development board applied for this time is very playable. Voice recognition and video acquisition are the functions that I am interested in, and I want to experience these separately.

作品文档.docx (34.81 MB, downloads: 2)
This post is from DigiKey Technology Zone
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list