Maria Jose
August 15, 2021

Prototyping a Solar Powered Watering System with CircuitPython

Most people around the world are getting more and more interested in living a long and healthy life nowadays. And many studies have proven that growing house plants, as long as being a trend, improves health. The truth is, we are so busy with work, and even when we get home, that we do not have enough time to properly water our plants when they need it.

Last year, I decided to grow fresh lettuces in my windows. It was a great idea, but I was very busy and I decided that this could be automated.

In this guide you will learn how to build a functional and beginner friendly system to keep your plants alive using different sensors, microcontrollers and CircuitPython.

Plantaris Solar and previous projects

This project is a variation from two previous projects Plantaris and Plantaris Data. The main goal of this project was to implement a beginner friendly and sustainable watering system.

Check the previous projects here:

Before to start…

Plantaris Solar is a prototype for testing the functionality using a beginner friendly approach. This will not be the final design / implementation.

Let’s start…

Step 1: What Do We Need ?

Materials:

Note: This is not a product placement.

Step 2: How should I start?

There is not an unique answer for that and you should find your own way. I am going to share some advice and how I did it, maybe this could help you as a guidance.

My recommendation is break your challenge in multiple challenges. Starting step by step and checking the different functionalities will help you to debug and find possible problems easily.

In our system we have different challenges:

A. Energy:

As it was mentioned previously, we will need provide energy to the pump soil moisture sensor and the microcontroller. It is needed it to have this in mind to know how many solar panel we will need for this project. In this example we will use two solar panels to get the energy.

✨ It is important to check if you solar panel can reach the Voltage that your electrical components need. To do that, we can use a digital multimeter, we can measure voltage, resistance, and current.

Once we checked that we can quantify the energy captured by our solar panels.

✨ It is recommended to answer some questions before buy solar panels.

🌀 Do you need storage this energy?

🌀 Can you storage the energy? How?

🌀 Do you need a Plan B for storage energy?


B. Watering: pump, relay:

For this prototype was used a horizontal water pump connected to a relay. The relay acts as a switch (ON/OFF)

✨ First it is recommended to connect your pump to some batteries (5V) and check if your pump works fine. No coding is need it!

Example:

In this video I am doing the function that will do the relay. ✨ As next step connect the relay to the pump and the batteries and try to evaluate if this works correctly.

✨ It is needed to do an experiment to know how much time you will need to water your plants.

C. Sensor: soil moisture sensor:

This section will be extended in other blog post because it is an interesting and important topic. For now, I will keep it simple.

✨ It is recommended to use “capacitative sensors” because these sensors are protected against corrosion and we will have the sensor in constant contact with soil and water, a perfect situation by corrosion.

✨ It is needed to do some experiments with our sensor and our soil. Even manufacturers have some range, could be different in our hands. Establish experiments with dry, medium dry and wet soil will provide us a range of values to determine when we will consider dry and when it will be need it to be activated the watering system. Be careful this the electronics, they are not waterproof.

Official Sensor tutorial

D. Microcontroller and programming:

The microcontroller chose for this project was a CircuitPlayground Express (CPX). This project is trying to be beginner friendly and this microcontroller is a great option that contains a huge amount of sensors and options (see below) and no soldering is needed. It is a great option for experimentation and learning.

CircuitPlayground Express (CPX)

Official documentation: Adafruit Circuit Playground Express

What about the Programming language?

We will run CircuitPython in our CPX board. This version of Python is beginner friendly because it is easy to install and it is possible drag and drop on the CIRCUITPY drive.

Official documentation: CircuitPython


🌀 Could be used another microcontroller and continue being beginner friendly? yes, it depends on the previous knowledge.


Step 3: What about the coding?

✨ Be sure that you install CircuitPython following the official documentation. ✨ Be sure that you have all the libraries needed for this project.

How this works?

How this is written in CircuitPython?

Once you write your code your system should be functional, like this:

Follow and contact me