A rosemary plant connected to a PyPortal tracking temperature and soil moisture
A rosemary plant connected to a PyPortal tracking temperature and soil moisture

Keep forgetting to water your plants? Want to monitor the ambient temperature of the room your plant is located in from across the world? 

In this guide, you will build an Internet-enabled plant monitoring display by combining Azure IoT Central from Microsoft and CircuitPython! 

Using Azure with your CircuitPython IoT projects allows you to rapidly prototype (and even mass-prototype) advanced internet-of-things devices and connect them to Microsoft Azure services.

Once your CircuitPython device's data is sent to Azure IoT Central, you can visualize your data on a dashboard. From there you can connect other Azure services such as:

  • Azure Blob Storage: Blob storage for all your sensor data to analyze later
  • Event Hubs: Real-time data pipelines capable of streaming millions of events per second between Azure services
  • Azure Stream Analytics: Real-time analytics pipeline allowing you to query data in real time
  • Azure Machine Learning: Build machine learning models that can be used from Stream Analytics to provide real-time predictions over your data

You can get hands on with and learn more about the Azure IoT services on Microsoft Learn.

CircuitPython Code

CircuitPython is perfect for building Internet-of-Things projects. This project uses the ESP32SPI CircuitPython library, which can use the ESP32 as a WiFi-coprocessor to send web requests.

We've created a CircuitPython Azure IoT helper module to provide an API to interact with Azure IoT Central.

You can rapidly update your code without having to compile and store WiFi and API secret keys on the device. This means that there's no editing code and re-uploading whenever you move the PyPortal to another network - just update a file and you're set. 

Stemma Soil Sensor

This soil sensor uses capacitive measurement. Capacitive measurements use only one probe, don't have any exposed metal, and don't introduce any DC currents into your plants. We use the built in capacitive touch measurement system built into the ATSAMD10 chip, which will give you a reading ranging from about 200 (very dry) to 2000 (very wet).

As a bonus, we also give you the ambient temperature from the internal temperature sensor on the microcontroller, it's not high precision, maybe good to + or - 2 degrees Celsius.

Prerequisite Guides

If you're new to CircuitPython, take a moment to walk through the following guides to get you started and up-to-speed:

Parts

Front view of a Adafruit PyPortal - CircuitPython Powered Internet Display with a pyportal logo image on the display.
PyPortal, our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Make custom touch screen interface...
$54.95
In Stock
Soil sensor in small potted plant, with wires connected to Adafruit Metro
Most low cost soil sensors are resistive style, where there's two prongs and the sensor measures the conductivity between the two. These work OK at first, but eventually...
$7.50
In Stock
Angled shot of 150mm/6" long 4-Pin JST-PH Cable
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-PH female 4-pin connectors on each end. These types of JST cables are commonly found on small rechargeable...
$0.75
In Stock

Materials

You'll need some extra supplies to finish this project. If you do not have them already, pick some up from Adafruit.

1 x PyPortal Stand
Adafruit PyPortal Desktop Stand Enclosure Kit
1 x USB Cable
Pink and Purple Braided USB A to Micro B Cable - 2 meter long

This guide was first published on May 24, 2019. It was last updated on Mar 18, 2024.

This page (Overview) was last updated on Mar 08, 2024.

Text editor powered by tinymce.