Projects‎ > ‎

Pure Soil Sensor

Introduction:

The IoT Pure Soil Moisture detector is used to monitor the hydration of the soil for plants. It has three segments to detect air, mid soil, and deep soil moisture. All the data will be sent to a smartphone device using BLE protocol to update the user on soil moisture. We will be providing all the source code at the bottom of the page.


Connect the Hardware Components:

Luckily, the Pure Modules are wireless and solder-less, all you have to do is plug and play. As shown in Picture (1), the Pure CoreModule (in white) allows BLE protocol to communicate between smartphone devices. I have provided a link for a Quick Startup Guide on the CoreModule. In short, the moisture detector will be communicating to the coreModule using I2C protocol, then all the data will be sent to a smartphone device to update the user on the soil moisture.

Picture (1)



Hardware Design:

Our design consists of differential sensor configuration using coplanar plates in each channel using the FDC2214 chip. This allows the detector to do the correct calibration for the moisture according to different environments. Picture (2) below shows an early version of our testing board, and Picture (3) shows our current testing board where we added more capacitances and a common mode choke to reduce more EMI noises.

                             Capture.JPG

Picture (2)                                          picture(3)


Firmware Design:

On the firmware side, we customized 1 BLE gatt service, 3 read characteristics, and 1 write characteristic to help send out the data to the smartphone separately. Picture (4) shows the custom service and characteristics using the Nordic nRF Connect app.

Picture (4)


We have provided all the source code on our Github site, so all you have to do is flash the code on the chip and our board is ready for your testing.


Android Development:

We built on top of the BLE UART apps provided by Android Open Source Project. In our app, we added different features to suite our application needs.


Once you open the application, you will be prompted with connecting the BLE devices shown in picture (5). Click “Pure Soil” to connect to the BLE and jump to our main page shown in picture (6).


There are 6 buttons, 3 on top and 3 on the left hand side. The graph by default is showing the Mid Soil sensor data, following are the functionality of each button:


Read - request the hardware to wake up and send data over to the phone through BLE.


Clear - resets all the data points, graph, and seekbar.


Publish - publishes data to an online broker using MQTT protocol so you could potentially save all the data for analytical analysis.  


Air - toggles the plot to show the moisture in the air.


Mid soil - toggles the plot to show the moisture in mid soil.


Deep soil - toggles the plot to show  the moisture in deep soil.

Picture (5)                                            picture (6)


In order to display data and plot, all you have to do is to click the Read button on the top, shown in picture (7) below. As you can see, as the left hand side displays the data, the seek bar will follow that value. On the bottom, the graph will plot each point. In addition, there are green and red exclamation marks on the right side of the seekbar to indicate whether the soil has too much water or if it is too dry. If there aren’t any exclamation marks next the the seekbar then the soil is under perfect condition. Picture (8) and Picture (9) shows the Mid Soil Moisture and Air Moisture plots when you click those buttons.

Picture (7)                                              Picture (8)                      Picture (9)


Furthermore, if you want to save all the data for analytical analysis, you can use the publish button to push all the data to an online broker. Picture (10) below shows the data on a broker app called MYMQTT. You can change the Host, port, username, password, around line 144 of DeviceControlActivity.java, shown in picture (11).

Picture (10)



Picture (11)


Lastly, the state of your app will be saved when you close the app, so next time when you open the app again, your graph and data would still be there. Of course, if you want to clear everything, then just press the Clear button.


Links to Tutorial and Source Code

Quick Startup Guide

Pure Soil Moisture Firmware Source Code

Android App Source Code

Pure Engineering LLC Home Page


Comments