satya N
Published © GPL3+

Smart Irrigation using Bolt IoT

Based on agriculture farm temperature conditions the motor pump will run and pump water to plants

BeginnerFull instructions provided2 hours304
Smart Irrigation using Bolt IoT

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
L293D Motor Driver
×1
Submersible Mini Water Pump - 3-6V DC
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
power bank
×1

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud
vm ware
ubuntu server
SMS Messaging API
Twilio SMS Messaging API

Hand tools and fabrication machines

tester

Story

Read more

Code

conf.py

Python
SID = 'You can find SID in your Twilio Dashboard' 
AUTH_TOKEN = 'You can find  on your Twilio Dashboard' 
FROM_NUMBER = 'This is the no. generated by Twilio. You can find this on your Twilio Dashboard'
TO_NUMBER = 'This is your number. Make sure you are adding +91 in beginning'
API_KEY = 'This is your Bolt Cloud accout API key'
DEVICE_ID = 'This is the ID of your Bolt device' 

final_project.py

Python
This code is used to checking the temperature of the farm,controlling the motor and sending an alert messages
import conf
from boltiot import Sms,Bolt
import json,time

#this value is your wish based on your plant/farm
treshold_value=25

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)
    try:
        sensor_value=int(data['value']))
        sensor_value=(sensor_value*100)/1024
        print("Sensor value is: "+str(sensor_value))
        if sensor_value>treshold_value:
            response=sms.send_sms("The current temperature is: "+str(sensor_value)+"Switching on the water pump to supply water to our farm")
            print("Switching on the motor")
            mybolt.digitalWrite('1','HIGH')
            print("Motor on succesfully")
            time.sleep(30)
            print("Switching off the motor")
            mybolt.digitalWrite('1','LOW')
            print("Motor off successfully")
    except Exception as e:
        print("An error occured")
        print(e)
    time.sleep(100)

Credits

satya N

satya N

1 project • 0 followers

Comments