SAQEEB MOMIN
Published © GPL3+

Irrigation Motor Control and Monitoring system

Controlling and monitoring the pump which is used to irrigate the agricultural land.

IntermediateFull instructions providedOver 2 days947
Irrigation Motor Control and Monitoring system

Story

Read more

Schematics

BLOCK DIAGRAM (SCHEMATIC)

just to analyse the circuit

Code

Irrigation motor control and monitoring (Python code)

Python
Code for running the project
import conf
from boltiot import Sms, Bolt
import json, time

minimum_limit = 921
maximum_limit = 1024  


mybolt = Bolt(conf.API_KEY, conf.DEVICE_ID)
sms = Sms(conf.SID, conf.AUTH_TOKEN, conf.TO_NUMBER, conf.FROM_NUMBER)


while True: 
    print ("Reading sensor value")
    response = mybolt.analogRead('A0') 
    data = json.loads(response) 
    print("Sensor value is: " + str(data['value']))
    try: 
        sensor_value = int(data['value']) 
        if sensor_value > maximum_limit or sensor_value < minimum_limit:
            response = mybolt.digitalWrite('0', HIGH)
            print("Making request to Twilio to send a SMS")
            response = sms.send_sms("The Current condition of soil is dry " +str(sensor_value))
            response = sms.send_sms("MOTOR turned on")
            print("Response received from Twilio is: " + str(response))
            print("Status of SMS at Twilio is :" + str(response.status))
        else:
            response = mybolt.digitalWrite('0', 'LOW')
            print("Making request to Twilio to send a SMS")
            response = sms.send_sms("Moisture is present in the soil/ land is irrigated " +str(sensor_value))
            response = sms.send_sms("MOTOR is in off condition")
            print("Response received from Twilio is: " + str(response))
            print("Status of SMS at Twilio is :" + str(response.status))

    except Exception as e: 
        print ("Error occured: Below are the details")
        print (e)
    time.sleep(10

Credits

SAQEEB MOMIN

SAQEEB MOMIN

1 project • 4 followers
Student at KLS Gogte Institute of Technology

Comments