Table of Contents
Introduction
In this project, I try to build an automated plant watering system by leveraging the Raspberry Pi Pico microcontroller and LabVIEW software. This system utilizes a soil moisture sensor to monitor the plant's moisture levels, triggering a water pump through a relay module when the soil becomes too dry. For this project I plan to develop a LabVIEW graphical user interface (GUI) to monitor the plant's condition, displaying real-time moisture data and allowing manual water control. This project not only demonstrates hardware interfacing and programming skills but also offers insights into automation and control systems integration.
Methodology
Requirement Gathering
The first part of building this project is to gather the requirements of the project which includes the following
- the number of plants to be watered
- the desired watering schedule
- the type of soil moisture sensor to use
Since this is a prototype, I plan to water a single pot only.
Hardware Implementation
For the hardware part, obviously, I am using the Raspberry Pi Pico. On top of that, since I am building an automated plant watering system, I will be using the soil moisture sensor to get the soil moisture value and the relay to control the water pump. Since the beginning of the project, I have been excited about having a specific board that can be used as an interface for this project. Hence I decided to build one. The figure below shows the image of the board.
This board basically has a TFT 1.8" display, 4 grove ports, 3 indicator LEDs and 3 push buttons. Unfortunately, later I came to know the pin output does not tally with the SCPI lab tool. However, I am still able to access the other pin through the pin header. The image below shows the component populated on the PCB board. As can be seen in the figure below, some of the components are still missing. This is because I am yet to receive it.
As for the soil moisture sensor, I have decided to use the Maker Soil Moisture Sensor from Cytron Technologies. Below is the image of the sensor.
This sensor measures soil moisture by capacitance sensing, where the presence of water in the soil will increase the probe capacitance. The output of the sensor is analog output; higher moisture levels will produce a lower output voltage. Moreover, it comes with an LED indicator for easier indication of the moisture level.
The next component which I used was the relay module. The purpose of the relay module is to turn ON and OFF the submersible water pump. Since the water pump requires a higher voltage, the relay will act as an automatic switch for the submersible water pump. Below is the image of the relay module, as well as the water pump.
Software Development
For the software development, we will be using the LabVIEW. First, need to download the LabVIEW Community Software. The installation process is pretty straightforward. Just follow the steps and you are done with setting up the software. Below is the screenshot of the download window, whereby we need to choose the OS and other things before we can start to download the software. Just be sure to select the community editions.
Once it is installed, the next step is to download the SCPI tool. I came to know about the SCPI tool from lesson 10. The SCPI tool is used for communication with Raspberry Pi Pico and LabVIEW. Thanks to Shabaz and Jan Cumps. Also in the same GitHub, there are example files included. I downloaded the file and tried to run it. Below are the videos of the test which I have done.
Example Digital Out.
The video below shows the test for digital out.
From the video above, I am able to control the LED connected to pin GP15 which is at PIN2. Refer to the screenshot of the reference below.
I am only able to use the GP15, since the GP22 and GP14 is either not connected or connected to other peripherals. The next example that i would like to try is the analog input example.
Example Analog Input.
The video below shows the test for analog input.
For the analog input, I am using the GP26 which is connected to Pins 0. From the video above it can be seen that the value of the moisture sensor is updated accordingly in the LabView as the moisture level of the soil changes from dry to wet.
Auto Plant Watering System
Now we have seen that both the digital output and the analog input are working fine as per the example. Now we will start to design the "Auto Plant Watering System".
Firstly all the components or devices are connected.
Next, we designed the Auto Plant front panel and continued with the block diagram.
System Testing And Deployment
Now we are ready to test the system. Basically how it operates is that the water pump is activated if the soil becomes dry and the pump will stop once the soil becomes wet. The video below is a demonstration of the system.
And this the test video
Results
As a result, I would say that the objective of the project is achieved. The plant watering is automated using the Raspberry Pi Pico and LabView(of course by using other peripherals as well). Saying that a lot more cosmetic work can be done to make the project more easily deployed. Also, the PCB board which I designed for this project can be updated, to cater or to incorporate the pinouts as per the SCPI pins layout. In the future I would like to add more features to this project, specifically to add water reservoir monitoring as well as the humidity and temperature sensor.
Conclusion
In conclusion, I would say this design challenge was very interesting from the very beginning. Starting the quiz which indirectly teaches the user to get familiar with the LabView environment. Moving on with building the project was quite a challenge though( especially for me who had zero experience on using LabView before). Overall it was a very good experience.
TIPS & TRICKS
One tip that I can share is, to always refer to the help if there are any doubts or unclear of any of the functions in the LabView. Personally, I refer mostly to the HELP window to solve the error which I face.