In this blog, I'll showcase some of the interesting things you can do with the Internet of Things (IoT) and Azure services at home, that could potentially be commercialised in an industrialised environment.
This blog was originally posted here by Keith Coutlemanis, Infrastructure Consultant at Telstra Purple on 02 Jun 2020 as part of a series. See also Part 2 and Part 3.
An IoT garden project
In my latest project, I used Microsoft IoT in my garden, not only to provide basic monitoring but with scope to take it to the next level. I utilised Azure Machine Learning and Azure Services to create a complex reactive ecosystem controlled through cloud services and voice commands.
The mini-farm environment for this project includes two plots of garden beds: a worm farm and a chicken house. The main goal is for the IoT solution to monitor the environment and control the water and feeding systems for the plants and animals.
The chicken coup
The small chicken coup for two to four chickens will require automatic watering and feeding systems. The watering system is connected to the mains supply and will refresh the watering outlet of the coup daily.
The feeding system is a 10-litre container with food pellets. The dispensing system is an Auger connected to a servo motor to feed pellets into the feeding tray daily. The level of chicken food in the 10-litre container is monitored through an ultrasonic system measuring the height of the food in the main chamber. The IoT system will monitor for enough food in the main reservoir and alert when it needs attention.
The worm farm
Worms are susceptible to heat and so when it gets too hot in the worm farm, it may impact upon their health. The project calls for monitoring the temperature of the worm farm and to send and record telemetric data to Azure cloud for storage and alerts. If excessive temperatures are measured, then Azure event systems will send instructions to the IoT device to turn on a watering system to cool down and moisten the worm farm to keep the environment cooler.
The garden plot
Typical watering systems on the market today will measure moisture levels and turn on the sprinkler systems without any measurement or logical analysis behind the process.
I wanted to do something upscale, so I created an IoT solution that will send telemetric data to Azure for recording long term statistics for moisture levels at the surface and underground at 10 cm. In addition, it can be used to determine evaporation rates, water usage, fertiliser usage, etc.
Power BI
The IoT device will monitor the environment and send telemetric data to Azure storage. Environmental measurements of temperature, humidity, light levels, soil moisture levels, water flow in LPM are sent every few minutes to Azure IoT HUB for processing.
The statistics are measured for real-time alerts and stored for long-term trend analysis. The evaporation rates and temperature trends are of importance because they reveal soil moisture health and water-retaining ability, which in turn impact plant growth and water usage.
Power BI is used to provide a historical graphical representation of soil moisture and evaporation rates.
Azure machine learning
The IoT device sends a small telemetric message to Azure blob storage every minute. That equates to over 500,000 status updates a year. From all this data, the goal is to determine evaporation deltas and use predictive algorithms to determine the minimum water requirements required in the current environment. The water requirements will change during the hot seasons, milder seasons and plant maturity.
I will use Azure machine learning to model an algorithm to determine evaporation rates and use reinforcement learning to determine the most efficient watering times and watering duration.
The Azure Machine learning service will then send web service commands to the IoT device to control the watering system.
Google IFTT
Just to show off, I have enabled Google Home assistant to turn on and off the watering system via voice commands. "Hey Google, water the garden." The sprinklers will turn on for 10 minutes.
Figure 1: The farm workspace with IoT solution
Above is an image of the solution on the workbench. You can see the water flow meter and water on/off solenoids, batteries and the Arduino MBK NB 1500 IoT device. In Part two, I'll show you how it was put together.
What's next?
For further reading on this project, and to try it yourself, check out part two – where we'll introduce the hardware used for this project – and part three in this blog series, as well as others on Telstra Purple.