Building a smart gardening system

In this section, we will develop a smart gardening system. We will use a PID controller to manage all inputs from our sensors, which will be used in decision system. We'll measure soil moisture, temperature, and humidity as parameters for our system. To keep it simple for now, we'll only use one parameter, soil moisture level.

A high-level architecture can be seen in the following figure:

You can replace the MCU board and computer with a mini computer such as a Raspberry Pi. If you use a Raspberry Pi, you should remember that it does not have an analog input pin so you need an additional chip ADC, for instance the MCP3008, to work with analog input.

Assuming the watering system is connected via a relay, if we want to water the garden or farm, we just send digital value 1 to a relay. Some designs use a motor.

Let's build!