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

Humanoid Sim Controller – Android App

For our Term project me and my partner Christian Gibbons worked on a Android Application that would be able to control HUBO Simulation. Our Android application communicated with our own custom built UDP/IP server, we were then able to send commands from the android device,  the server then takes the command and uses our HUBO walking algorithm to move in User Space.

Methodology

  • My contribution for this project was to create a android application to communicate with a UDP/IP server.  My partner Christian was responsible for creating the key frame motion controller
  • Since it was my first time creating a android application I spent hours doing research on android development, then spent some more on how UDP servers worked.
  • The next step was taking all the information and creating a server that would be able to communicate with a simple client on the local host. I did this by creating a UDP server that would be able to receive text messages from a client.
  • I initially wrote the client in Python we then made the switch to C. This was done due to the fact that the controller was written in C and we figured it would just be easier on us to have it all in one format.
  • With a working UDP Text messenger I ported the client program over to java, which is the language used by the Android SDK.
  • Once I had a working application I spent some time trying to connect the Android Application to communicate with the UDP server on the Local Host. The issue we had was that since our Android application was running on a virtual emulator it would not allow us to use the same IP address as the Local Host. This was solved by connecting to the IP address 10.0.2.2 .
  • Once a stable communication was achieved programmed the android app to send text commands to the server. Such as Forward , Back, Right, Left.
  • With my partner we then combined the Server and the controller. When the server receives a command it gets compared to statements and executes the correct function to control the HUBO Simulation.

Continue reading “Humanoid Sim Controller – Android App”