MoiturizeMe

by mikeghen in Living > Gardening

1526 Views, 6 Favorites, 0 Comments

MoiturizeMe

IMG_0091.JPG

MoisturizeMe makes the effects of your daily activity, or lack thereof, more immediate by using your Fitbit data to determine how much care your plants get.

Most of us don't realize the long term effects of sedentary lifestyles because our bodies react very slowly. By connecting a fitness tracker such as Fitbit to your house plants you will see the effects of a sedentary lifestyle reflected in the health of the plant, with monitors that alert you to the plants soil moisture levels.

Laying Out the Innards

IMG_0086.JPG

For this project we'll need an Edison board, Grove Starter Kit and Grove Environmental Kit. You'll use the Edison, shield, moisture sensor, RGB LCD screen and jumper wire. water pump and relay. Not pictured is a plant, water containers, grow lights and a computer to run the Intel IoT XDK.

Now that you have the guts of your project splayed out on the table, you're ready to flash your Edison (but not like that, weirdo.)

Setting Up the Board, Etc.

IMG_0085.JPG

Plug the Edison into your computer and connect via serial. Once you get in (and you'll probably need the guys from Intel to help you -- we did anyway), start by installing the packages we'll need for this project: mail, crontab, and pip. Next, set up wifi using the configure_edison --wifi command.

Set Up Python-fitbit

You will need to install python-fitbit to be able to pull data from Fitbit. You will need to authorize your application using Fitbit and OAuth. Then you'll need to write a program to go and get the data. The core peice of code you will use will look like this:

fb = fitbit.Fitbit(CONSUMER_KEY, CONSUMER_SECRET, resource_owner_key=TOKEN, resource_owner_secret=TOKEN_SECRET)
data = fb.time_series('activities/steps',period='1d')

Once you have this program working, use crontab to set it up to run periodically.

Upload the Main Program to the Edison

While the processing for getting the data from Fitbit is done using a python script running on the board, all the sensors and controls for the project were programmed using Node.js. Using the Intel XDK, we uploaded our Javascript to the Edison.

Wiring Up the Sensor and Controls

You will need to wire up relays to control the lights and the water pumps. The moisture sensor and RGB LCD screen can be plugged directly into the board.