Shradhanjali Pradhan
Published © GPL3+

PLANT LIGHT MONITOR USING IoT

The light intensity level that plants are getting from the sun or when the temperature crosses beyond a threshold (using java and Twilio).

BeginnerFull instructions provided4 hours662
PLANT LIGHT MONITOR USING IoT

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
If you haven't purchased this kit then go to bolt IoT official account and you can buy that kit.
×1
USB Cable, Male - Female
USB Cable, Male - Female
×1
Temperature Sensor
Temperature Sensor
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1
LDR, 5 Mohm
LDR, 5 Mohm
×1
Resistor 10k ohm
Resistor 10k ohm
×1

Software apps and online services

SMS Messaging API
Twilio SMS Messaging API
Bolt Cloud
Bolt IoT Bolt Cloud

Story

Read more

Schematics

PLANT LIGHT MONITORING USING SENSOR

LDR measures the light intensity falling on the plant. Both the data are read by the Bolt unit and send to integrant logic whenever a read request arrives. The resistance of an LDR varies inversely with light, i.e., the resistance decreases as the intensity of light falling on the LDR increases. And the code will be written in bolt cloud.

WHEN TEMPERATURE CROSSES THERSHOLD

we’ll get an SMS through Twilio, when the threshold crosses the temperature level and we’ll write a python code using bolt python library by creating an account in Digital ocean droplets.

Code

PLANT LIGHT MONITORING USING SENSOR

JavaScript
LDR measures the light intensity falling on the plant. Both the data are read by the Bolt unit and send to integrant logic whenever a read request arrives. The resistance of an LDR varies inversely with light, i.e., the resistance decreases as the intensity of light falling on the LDR increases. And the code will be written in bolt cloud.
setChartLibrary("google_chart");
setChartType("bargraph");
plotChart("time_stamp","light monitor");

WHEN TEMPERATURE CROSSES THERSHOLD

Python
we’ll get an SMS through Twilio, when the threshold crosses the temperature level and we’ll write a python code using bolt python library by creating an account in Digital ocean droplets.
import conf
from boltiot import Sms, Bolt
import json, time

minimum_limit = 300
maximum_limit = 600  


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:
            print("Making request to Twilio to send a SMS")
            response = sms.send_sms("The Current temperature sensor value is " +str(sensor_value))
            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

Shradhanjali Pradhan
1 project • 2 followers

Comments