Building a smart IoT flowerpot from scratch

Enrique Gamboa
9 min readOct 17, 2021

--

Nowadays it looks like technology is expanding faster than ever, things that we usually saw when we were little in cartoons or other tv shows seem to be magically happening as if these would be windows for the future after all. While I dive more into where we are standing and where we are going I can’t stop thinking about how technology can change everything we know. Usually, I work with software and data, but my curiosity of how the technology is changing the world approached me to this little cute project, that I hope to use as an introduction to understanding how I can connect software with hardware and more importantly how the combination of these two can beneficiate others 🌱.

Smart IoT flowerpot in action

Introduction

Smart IoT flowerpot thirsty

This project is a cute IoT flowerpot that helps you tracking the basic measures needed to take care of your favorite plants such as water 💧, moisture 🧴, and temperature 🌡levels. You can see the measures directly on the device or on the online dashboards. This DYI project is an interesting way to showcase how we can easily make such a cool project 😎 with a 3D printer and low budget but more importantly, they are amazing learning paths for future IoT innovators. This project is powered by python code and you might just need to edit simple parameters to make this project work.

“Build a smart planter with Adafruit PyPortal and CircuitPython. Monitor your plants vitals with Adafruit STEMMA Soil Sensor and plot moisture and temperature data. Use Adafruit IO to create a visual dashboard with gauges of your plants water levels.” (Brothers and Rubell, 2020)

This is an Adafruit project. All the materials and official documentation needed can be found here, so if you want to make your own flowerpot you can easily order from their website all the parts needed. Link

The total investment I did on this project was $101.18 with all the parts + shipping and taxes. The 3D models were printed at home. (🤔 This actually can be a great Christmas gift 🎅🏻).

Here is a video demo of the final results of the project:

Video demonstration

How I made it

This project was such a good experience. I can’t explain the satisfaction that you can feel when you see the PyPortal screen being animated and working with real data, for sure all this with the cute plant on the top. Plus if you add the huge benefit of having a real-time dashboard with Adafruit IO working to measure your IoT flowerpot, all this creates a bunch of possibilities for any kind of creator 🤯.

This project was created following Adafruits 2020 guide “Pyportal pet planter with Adafruit IO”. All the elements needed and the detailed instructions for this project can be found in this Link.

Basically, these are the electronic needed:

  • PyPortal Titano
  • STEMMA Soil Sensor
  • STEMMA Cable — F/F
  • Mini Oval Speaker
  • 3D printer
Electronics needed for the smart IoT flowerpot

Assembly

Printing the case

The Assembly of this project was pretty easy, the 3D model published in Thinkerverse (link) is simple to print and build, and the wiring of the electronic parts doesn’t take more than 5 minutes.

3D Printing

3D printed parts

The 3D parts of this project can be found on this Thingiverse page. Printing all the 7 parts was simple, and took me about 23.48 hrs on a single Ender V2.

Wiring & Assembly

(Brothers and Rubell, 2020)

Wiring the electronic parts was something pretty straightforward. You just need to connect the STEMMA soil sensor and the speaker into the PyPortal Titano, like the diagram. For detailed assembly and wiring instructions here is the link.

Then, just screw and put together the 3D parts, PyPortal the speaker and the sensor resulted pretty simple and intuitive. Even this 3D model design comes with a drip tray to get rid of the water excess for your lovely oxygen or THC machine 🌳.

Soil sensor assembled

This is the final result. The sensor for the way that is being assembled in the 3D model structure, adds another waterproof layer of protection to the sensor circuits. “The soil sensor is mounted to the planter cup with the capacitive tip being inside and the electrical components on the outside. This keeps any dirt and water away from the components on-board the soil sensor” (Brothers and Rubell, 2020).

smart IoT flowerpot assembled

Adafruit IO Setup

Build a Dashboard

Because this flowerpot is an IoT project it needs to be connected to the network, Adafruit IO Setup is an integral platform that provides all the needed tasks to connect all your IoT devices, helping with feeds, dashboards, connections, security, etc.

For this project, all the data collected from the smart flowerpot will be available on these Adafruit IO dashboards. This results pretty conveniently considering that you can check your plant 🌱 (or plants 🌱🌵🌳) in any device anywhere in the world, also in case of your plant(s) moisture or the temperature gets too high or low, the IoT flowerpot will notify you using the speaker.

Temperature and Moisture dashboard for your loved one 🌱

This is one of the most convenient parts of this IoT project due to the convenience of leveraging the data generated from the flowerpot, into a centralized platform. Just imagine if you want to measure not just one plant, but thousands, these are the types of cases where business intelligence platforms such as Adafruit IO become pure gold.

Building the dashboard was simple and quick, took me approximal an hour to get familiar with the platform and follow all the instructions until I saw my beautiful dashboards ready to be feed.

Obtain Adafruit IO Key

To connect the IoT flowerpot with the platform you need to retrieve your username and key from your Adafruit profile. You can get these both from the same place with a couple of clicks.

Save the user and key, you will need them on the next step.

For detailed instructions on how to create the dashboards and get your Adafruit IO Key, follow this link.

PyPortal python code and connection setup

The PyPortal, setup, python code deployment, and Adafruit IO connection were pretty simple. I’ve got a little confused with the Adafruit guide steps “PyPortal CircuitPython Setup”, “Internet Connection” and “Code setup”, because following them I realize that the only step you need to do is the “Code setup” instructions, and omit the other two steps unless you are interested to learn more detailed PyPortal configurations and type of network requests such as gets and posts.

Basically, I can summarize the PyPortal python code and connection setup in the following steps:

Download the following files:

— — — — — — — — — — — —

  • Bundle for Version 7.x: Link

This will install Circuit Python for the PyPortal Titano(reference).

— — — — — — — — — — — —

  • Pet Planter project assets: Link

This zip file has all the assets and python code needed for this project. Then follow these steps:

— — — — — — — — — — — —

  1. Install the Bundle for Version 7.x Circuit Python on the PyPortal Titano.
    - Press two times the “Reset” button and paste into the PyPortal the downloaded file, the device on your computer will change to “CIRCUITPY”
  2. Install PyPortal IDE for your computer, I installed Mu on my mac.
    - Mu is an IDE for Circuit Python and other languages, frameworks, link to download.
  3. Copy all the files from the Pet Planter project assets zip file (second downloaded file) and paste them into “CIRCUITPY”
  4. Modify secrets.py file. This is located in the root of “CIRCUITPY”.
    - There add your WIFI SSID, password, Adafruit IO user, and key as follows:

In theory, copying, pasting the files from the zip file to the CIRCUITPY would launch the application on the device. This wasn't my case, I got an error with the WAV files which are just two files that had audio for when the plant needs water or when it has an excess of water, the PyPortal for some reason couldn't process the WAV files that come on the zip file, and the solution was simple enough to record my own WAV files with my own voice.

Just right after I made that change, my PyPortal started to work as expected, the IoT flowerpot will notify you when the plant is thirsty or when has more water than it should.

This is how the flowerpot reacts when needs water:

Demonstration of smart IoT flowerpot requesting water

This is how the flowerpot reacts when has enough water:

Demonstration of smart IoT flowerpot alerting excess of water

The parameters to change the threshold when the plant needs water and when it has an excess of it can be found at the beginning of code.py file, which works as the main python file. In case you want to change completely the logic of this flowerpot or make any minor or big modifications, this is a single file that will allow you to customize your flowerpot as you want.

Succulent chilling on a smart IoT flowerpot

Conclusions and next steps

Building this project was definitely fun, and easier than I thought. DIY projects like this are one of the best ways to spend time, win some knowledge, and have fun with technology. Also, it helps me thinking what else I can do, or how people could use it in society.

Troubles and notes.

I thought I would have more problems building this project, but they were just a couple that got solved easily.

The first issue was with the WAV files that are included on the Pet Planter project assets.zip downloadable zip file from the official guide of this project. They were giving me an error at compilation time, to solve this it was easy enough to record my own files by using this free WAV tool link, and replacing the original WAV files.

Succulent tag

The second issue, the plant I used to pilot my experiment was a Succulent. This was an issue because this plant does not require too much water, and will take a long time for you to see how this plant changes the moisture on the ground, but most importantly, you can kill this plant for experimenting with it ☠️. Recommendation, build this DYI with another plant that requires more water.

(No plants were hurt on this experiment 😇)

Notes

Be careful printing and building ⚠️, I had a little accident while I was separating a 3D part from my 3d printer bed.

Accident separating a 3D part from my 3d printer bed

I accidentally stuck the spatula on the side of my finger, thankfully, wasn’t anything major, and I just needed a bandage, alcohol, and a shot of tequila to feel fine. But even though tools are pretty easy to manipulate, accidents can happen, so be safe building stuff.

Next Steps

The very next phase planned for this project will be the connection to GCP and Azure as different projects, to experiment with IoT capabilities on these platforms. Having this archived, I would like to create more flowerpots to experiment with handling data from different plants and gather it together as BI tools with dashboards and alerts.

Later in the next phases, I want to connect this flowerpot to more sensors to make it be autonomously as possible.

smart IoT flowerpot working

Reference

Brothers, R. and Rubell, B (2020). Pyportal pet planter with Adafruit Io. Adafruit Learning System. Retrieved October 7, 2021, from https://learn.adafruit.com/pyportal-pet-planter-with-adafruit-io?view=all#pyportal-wiring.

buymeacoffee.com/jegamboafuentes

--

--

Enrique Gamboa

If art is a human abstraction, Artificial Intelligence is the abstraction of humanity 🦾