Heating a Vermont house with Pi and Pellets - Part 1
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 - summer
Scott's house - early winter Scott's house - late winter
This is a "pellet stove" - basically a wood-burning stove that burns these small pellets made from sawdust...
my pellet stovea handful of douglas fir wood pelletspellet stove controller to be replaced by pipellets come down the chute via a stepper-motor controlled auger into this burn pot and are ignitedburning 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 breadboardinfrared (flame) sensorcapturing 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) repository
proof that things are working
That's it for now. Next up: pull data from National Weather Service API to enrich data set....
Answers
This is a really cool application. When we install a pellet stove I'll hack this together.
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.
Lindon Ventures
Data Science Consulting from Certified RapidMiner Experts
https://community.rapidminer.com/discussion/41287/heating-a-vermont-house-with-pi-and-pellets-part-2
Part 3
https://community.rapidminer.com/discussion/42235/heating-a-vermont-house-with-pi-and-pellets-part-3-getting-data-from-noaa