In this example, we will look into the basics of a Drip Irrigation System using the IoT House. With IoT House, you get 2 plant drip irrigation raw equipment.
Drip Irrigation
The drip irrigation system is a type of micro-irrigation of soil that has the potential to save water and nutrients by allowing water to drip slowly to the roots of plants. This leads to the wise use of water and also makes water reach the roots of plants and minimize evaporation. Drip irrigation systems distribute water through a network of valves, pipes, tubing, and emitters. Its efficiency depends on how well the system is designed, installed, maintained, and operated. A simple drip irrigation system is shown below in the figure.
Drip Irrigation Assembly
The following tutorials cover how to make the Drip Irrigation System:
- For 1 Plant: https://ai.thestempedia.com/docs/iot-house-quarky-addon-kit-documentation/1-plant-drip-irrigation-assembly-iot-house/
- For 2 Plants: https://ai.thestempedia.com/docs/iot-house-quarky-addon-kit-documentation/2-plants-drip-irrigation-assembly-iot-house/
Circuit
The Water Pump Connected to the Relay: The water pump is controlled by the smart switch of the IoT house which has a relay controlling the state. If the relay is ON, the smart switch gets ON, turning on the water pump. The relay has the following connections:
- GND Pin connected to GND of the Quarky Expansion Board.
- VCC Pin connected to VCC of the Quarky Expansion Board.
- Signal Pin connected to Servo 4 of the Quarky Expansion Board.
Python Code
The while loop will run continuously and check if the left pushbutton on the Quarky is pressed or not. If the left pushbutton is pressed, the relay connected to port 4 will be set to ON, otherwise, it will be set to OFF. After each check, the code will wait for one second before checking again.
#This code creates a Quarky object and an IoTHouse object
quarky = Quarky()
house = IoTHouse()
#This while loop will run continuously
while True:
#If the left pushbutton on the Quarky is pressed...
if quarky.readpushbutton("L"):
#Set relay connected to port 4 to ON
house.setrelay(0, "pwm4")
#If the left pushbutton is not pressed...
else:
#Set relay connected to port 4 to OFF
house.setrelay(1, "pwm4")
#Wait one second before checking the pushbutton again
time.sleep(1)
Output
Calibrating the Flow of Water
The flow of water can be adjusted with the loosening and tightening of the red part of the emitter.