The block connects the soil moisture sensor to the specified pin. Once initialized, other moisture sensor-related blocks can be used.
This example demonstrates how to use the Soil Moisture sensor to detect the moisture in the soil and water the plant using the drip system. The system will water the plant when the moisture of the soil is low.
This example demonstrates how to use the Soil Moisture sensor to detect the moisture in the soil and water the plant using the drip system. The system will water the plant when the moisture of the soil is low.
Drip Irrigation Assembly Guide
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
We are using 2 devices in this project:
- Moisture Sensor: The moisture sensor provides real-time moisture reading from the soil. The moisture sensor connections are as follows:
- GND Pin connected to GND of the Quarky Expansion Board.
- VCC Pin connected to VCC of the Quarky Expansion Board.
- Signal Pin connected to A2 of the Quarky Expansion Board.
- 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 8 of the Quarky Expansion Board.
Note: Once the connection is done, make sure you have the drip irrigation system placed with some water in the tank.
Script
The project has 3 scripts:
- Script to display the real-time moisture level on the display of the Quakry. Based on the moisture value, the number of LEDs will light up. The script is a custom block defined with the name – Display Soil Moisture Level.
- The second script is another LED display showing the animation of the watering. The script is a custom block defined with the name – Watering Animation.
- The final script is the main script which has the logic to detect the moisture value. If the value becomes less than 30%, the pump gets ON and the watering continues until the moisture level gets to 80%.
Output
Uploading Code
You can also make the script work independently of PictoBlox using the Upload Mode. For that switch to upload mode and replace the when green flag clicked block with when Quarky starts up the block.
Read More