Most of the time it is enough to measure the soil moisture on a plant to determine the health status of a plant. However, this can only be a statement about whether an adequate water supply is guaranteed. It is just as important to recognize an oversupply, which can cause mold, as well as an undersupply, which can lead to desiccation of the plant. Furthermore, a sufficient supply of nutrients is also an important part of keeping the plant healthy.
The color of the leaves is a good indicator of whether there are enough nutrients to ensure good growth. Therefore, in this project not only the soil moisture but also the leaf color of the plant is used to gain knowledge about the health status of the plants.
In the first chapter a self-sufficient device is presented, which transmits the measured data via Bluetooth Low Energy to a base station. The second chapter deals with the measurement of leaf color and the associated limitations. And the last chapter will cover how all data can be collected by a base station for further analysis.
Chapter #1
Since nRF51 modules are particularly suitable for ultra low power applications (and I had a few of them lying around), I decided to use them for solar powered standalone devices. Unfortunately, these microcontrollers are already deprecated and the SDK for software development is not maintained anymore. So, using the old nRF SDK 12.3 (https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v12.3.0%2Findex.html) from 2017 had to be used accordingly. But this was actually not a big problem, because this device has just two requirements:
- record data from ADC and report it in an BLE advertising message to the base station
- sleep 99% of the time and consume as less energy as possible
After uploading the firmware and putting all components together the device can be placed next to a plant. But now you have to make sure that the solar cell is not covered by the plant itself, otherwise the harvested energy will not be enough to power the microcontroller.
Chapter #2
Nordic Thingy:53 has a onboard color sensor which can measure red, green, blue and infrared light. Unfortunately, this sensor need to be placed directly under the leaves and the light needs to shine through them. Otherwise to many shuttered light can be captured by the sensor and distort the measurement. For software development nRF Connect SDK 2.1.0 was used and a simple BLE advertising device was created. You can find the source code and project configuration for VSCode attached.
Chapter #3
Now it's time to collect the data from solar powered soil moisture sensor and from Thingy:53. A ESP32 has the ability to connect to WiFi network, which allows us to send data in a very convenient way via mqtt to a server. At the same time it can scan for BLE advertising messages. So this is a perfect match for this project. Here a TTGO T5 was used, because it also has a ePaper display for showing the essential status of the plant.
The display shows the current soil moisture value provided by the device described in chapter #1 and the leaf color status. Since the measurement of the leaf color was not as reliable as expected (caused by environmental conditions) it shows only "OK" or "not OK" when certain thresholds are reached.
What's next?
- improve power consumption for standalone devices
- add reference color measurement to compensate change in environmental influences (rising / setting sun, clouds)
- add ML to detect anomalies of leaf color
- use external color sensor to make recoding of leaf color easier
- add external light to make measurement more reliable
- scale the project by adding more sensors
Comments