RapidMiner

Heating a Vermont house with Pi and Pellets - Part 1
Community Manager Community Manager
Community Manager
4 weeks ago
4 weeks ago

Greetings Community,

  

As many of you may know, I live in a beautiful place called Vermont where the leaves are gorgeous in the fall, and there is plenty of snow and cold in the winter.  Hence the cost and logistics of heating your house is a frequent topic of conversation up here and, as an avid data geek, I am always striving to get the maximum BTUs out of my heating system.  In this series of blog posts, I am going to share my new journey of turning my heating system into a wicked-amazing IoT optimization system using a Raspberry Pi, a bunch of sensors, and of course RapidMiner to do the heavy lifting.

 

This is my house in various times of year...

Scott's house - summerScott's house - summer

Scott's house - early winterScott's house - early winter Scott's house - late winterScott's house - late winter

 

 

 

 

 

 

 

 

 

This is a "pellet stove" - basically a wood-burning stove that burns these small pellets made from sawdust...

my pellet stovemy pellet stovea handful of douglas fir wood pelletsa handful of douglas fir wood pelletspellet stove controller to be replaced by pipellet stove controller to be replaced by pipellets come down the chute via a stepper-motor controlled auger into this burn pot and are ignitedpellets come down the chute via a stepper-motor controlled auger into this burn pot and are ignitedburning pelletsburning pellets

 

 Phase 1: Setup and Data Collection

 

I get my Pi going with the standard RaspbianOS, install a MySQL database that will store sensor data, and hook up two sensors to get started: temperature (in the room) and an infrared "flame" sensor:

Pi3 and breadboardPi3 and breadboardinfrared (flame) sensorinfrared (flame) sensorcapturing data into mysql tablecapturing data into mysql table

 

 

I am probably the worst programmer on the face of the earth - thank goodness for Google.  Here's the Python code for grabbing sensor data and storing into mysql:

 

import time
import datetime
import RPi.GPIO as GPIO
import MySQLdb as mdb

GPIO.setmode(GPIO.BCM)
GPIO.setup(17,GPIO.IN)

db = mdb.connect("localhost","pisensor","<pwd>","pelletdb")
curs = db.cursor()

while 1:
	tempfile = open ("/sys/bus/w1/devices/28-051691a25bff/w1_slave")
	thetext = tempfile.read()
	tempfile.close()
	tempdata = thetext.split("\n")[1].split(" ")[9]
	temperature = float(tempdata[2:])
	temperature = temperature /1000
	flame=GPIO.input(17)
	curs.execute ("INSERT INTO pisensor VALUES (NOW(),%s,%s)",(temperature,flame))
	db.commit()
	print temperature
	print flame
	time.sleep(5)

The 5-second delay is a compromise that may need to be tweaked later...I'm worried about storage in my little Pi.  So I want to pull the data off the pi and store it in my RapidMiner local repository (actually it's a Google Drive repository that RM thinks is local).

RM process to retrieve data from Pi and store in RM local (Google Drive) repositoryRM process to retrieve data from Pi and store in RM local (Google Drive) repository

 

 

proof that things are workingproof that things are working  

 

 

 

 

 

 

 

 

 

 

That's it for now.  Next up: pull data from National Weather Service API to enrich data set....

2 Comments
Moderator
Moderator

This is a really cool application. When we install a pellet stove I'll hack this together.

Elite III

This is very cool!  It looks like you could sled off your roof in late winter :-)

I probably don't have much use for a pellet stove here in Florida, but I am very interested in learning how to connect RapidMiner to an IoT practical application.