Shreyas B V
Published © GPL3+

Smart Ombrometer

Why to look manually on the markings when this SMART OMBROMETER alerts you the amount of rainfall by SMS and alarms when rainfall is high

IntermediateWork in progress4 hours276
Smart Ombrometer

Things used in this project

Hardware components

Internet Connected Computer
×1
Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
3 mm LED: Red
3 mm LED: Red
×1
Buzzer
Buzzer
×1
Grove - Water Sensor
Seeed Grove - Water Sensor
×1
Breadboard (generic)
Breadboard (generic)
×1
USB Cable, Male - Female
USB Cable, Male - Female
×1

Software apps and online services

Bolt IoT Android App
Bolt IoT Android App
Bolt Cloud
Bolt IoT Bolt Cloud
SMS Messaging API
Twilio SMS Messaging API
Oracle VM Virtual box

Story

Read more

Schematics

Circuit connections

Connect the circuit as shown in this image

Code

Configuration Code

Python
Configuration code (for sms alert)
SID = ' '
AUTH_TOKEN = ' '
FROM_NUMBER = ' '
TO_NUMBER = ' '
API_KEY = ' '
DEVICE_ID = ' '

Python code

Python
Complete code
import conf, requests, math, time, json
from boltiot import Sms, bolt

value1 = 20
value2 = 500
value3 = 1500
value4 = 500

data = []             #to empty the list for storing value
mybolt = Bolt(conf.API_KEY, conf.DEVICE_ID)
sms = Sms(conf.SID, conf.AUTH_TOKEN, conf.TO_NUMBER, conf.FROM_NUMBER)
mybolt.digitalWrite(0,"LOW")

def get_sv(pin):
    try:
        response = mybolt.analogRead(pin)
        data = json.loads(response)
        if data["success']!=1:
            print("Request Failed")
            print("Response", data)
            return -999
        sensor_value = int(data["value"])
        return sensor_value
    except Exception as e:
        print("Error")
        print(e)
        return -999
        
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 < value4:
            mybolt.digitalWrite(0,"LOW")
        elif sensor_value > value2 or sensor_value < value3:
            print("Making request to TWILIO to sens SMS")
            value = (sensor_value/20)
            response = sms.send_sms("The amount of rainfall is: " +str(value))
            print("Response recieved from TWILIO is: " +str(response_status))
            mybolt.digitalWrite(0,"HIGH")
        elif sensor_value > value1 or sensor_value < value2
            print("Making request to TWILIO to send SMS")
            value = (sensor_value/20)
            response = sms.send_sms("The amount of rainfall is: " +str(value))
            print("Response recieved from TWILIO is: " +str(response_status))
            mybolt.digitalWrite(0,"LOW")
    except Exception as e:
        print("Error")
        print(e)
    time.sleep(10)

Javascript

JavaScript
.js code
setChartLibrary('google-chart');
setChartTitle('Smart Ombrometer');
setChartType('barGraph');
setAxisName('Time Stamp', 'Water Level');
plotChart('time_stamp', 'water');

Credits

Shreyas B V

Shreyas B V

0 projects • 0 followers

Comments

Add projectSign up / Login