How it works

Generally speaking, this program combines two things: reading the current soil moisture value through a soil moisture sensor and implementing a PID controller. After measuring the soil moisture level, we send the value to the PID controller program. The output of the PID controller will cause a certain action. In this case, it will turn on the watering machine.