IoT Plant Vitals – Stats Monitor

In this project, we will monitor the growth of a pansy plant over a period of 3 weeks in a contained environment. The values were collected from various sensors using the Beagle Bone as the Host. Data will be pushed to database and will be made public. We are using Python/Bash/Cron to program the BBB Linux utilities and the various sensors being implemented in this project.

Python Script was used to collect data from sensors. Thanks to the rich libraries that are provided on the beagle bone platform,

Snippet of Script for data collection

#import libs for use
import time
import math
from bbio import *
import Adafruit_BMP.BMP085 as BMP085
import os
import urllib2
# initialize the sensor and read data 
SPI0.begin()
sensor = BMP085.BMP085() 
def analog_read(channel):
r = SPI0.transfer( [ 1 , ((8 + channel) << 4) , 0] )
#transfer data to adc. 
adc_out = ((r[1]&3) << 8) + r[2]
return adc_out
#indicate if it is day or night 
while True:
if analog_read(0) > 100:
dayandnight = 'day'
else:
dayandnight = 'night'

#read data from sensors.
moist = analog_read(1) 
pressure= sensor.read_pressure()
temp=sensor.read_temperature()
#print data
print 'Pressure = {0:0.2f} Pa'.format(sensor.read_pressure()) 
print 'Temp = {0:0.2f} *C'.format(sensor.read_temperature()) 
print "dayandnight = "
print dayandnight 
print "moisture = "
print moist
print " \n"

Linux Cron: scheduler runs our python script every hour. High customization allows for precise and continuous data collection.

pressuretempmoisture

BBB Setup

plant-iotplant-and-bbb

DATA: Download CSV Format

References:
Getting Webcam Images with Python and OpenCV 2 (For Real This Time)
http://data.sparkfun.com/input/9J0nlOZ891hR4Mm1lNyp?private_key=xz5NWqy7p9FvX80yxBmz&bbbname=MichaelandAnh&moisture=%5Bvalue%5D&night_or_day=%5Bvalue%5D&pressure=%5Bvalue%5D&temp=%5Bvalue%5D
https://help.ubuntu.com/community/CronHowto
Advertisements

2 thoughts on “IoT Plant Vitals – Stats Monitor

    1. I was going to use openCV to take periodic pictures of the plant. Unfortunately i had hardware issues with BBB and power supply for the Camera(not enough current, would shutoff randomly). Thanks for the reference !!

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s