Raspberry Pi Thermostat Part 3: Software Release

Raspberry Pi Home Automation Termostate Software

(I found this article at The Nooganeer and publish it here with his permission)

I’ve finally found the time to release my software.  However… I am extraordinarily busy with Georgia Tech’s OMSCS program, so I will not have time for now to write a tutorial on using the source code.  This is my very first web development project.  Since its inception I have already learned enough to know that there are some things that could be done better–it is my goal to improve the code as I have time.

If you are an experienced web developer, you will most likely laugh at what you see.  Rather than be hateful, please feel free to fork the repo, make my idea better, and submit a pull request.

Whether you are a web developer or not, rest assured that this code base has been running my thermostat for 3 months at the date of this post with exactly zero failures.

SOFTWARE OVERVIEW

To begin, the software consists of four major components which will run on 3 separate pieces of hardware.
  • MySQL Database — Runs on the web server but could run on separate machine
    • The whole system is driven by the database, which should make it easy to expand control methods beyond just the web application.
    • Contains sensor data and HVAC status logs
  • Flask Web App — Runs on web server
    • Displays statuses and plots data from database
    • Allows user to manipulate the state of the thermostat
    • Contains url scheme to add sensor data to the MySQL database when GET request is received from a Spark Core
  • Thermostat Control Daemon — Runs on Raspberry Pi
    • Controls the HVAC system itself and updates the system status on the MySQL database
    • Also acts as a temperature sensor and inserts data into the database
  • Remote Sensor Daemon — Runs on Spark Core
    • Reads data from DALLAS TEMP SENSOR, and sends a GET request containing the sensor ID and temperature reading to the Flask app.

Eventually, I will create posts for how to set up each piece of hardware, but for now, you’re stuck with the README files in the Bitbucket repos.

Feel free to contact me with any troubles you have and I will try to assist you. Eventually I may have some real issue tracking set up.

Raspberry Pi Thermostat Part 2: Hardware Overview

Raspberry Pi Home Automation Thermostate  HardwareCover

(I found this article at The Nooganeer and publish it here with his permission)

THIS IS A LIVING POST ABOUT THE HARDWARE I AM USING FOR MY THERMOSTAT PROJECT.  THE HARDWARE LISTED HERE MAY CHANGE AS I IMPROVE MY SYSTEM.

 Hardware “BOM”

  • Raspberry Pi with 1000mA Power Supply and Wifi Dongle
    • All pure “thermostat” logic runs on the Pi
  • Makeatronics Solid State Relay Board (More on this later)
    • Allows the Pi to switch the 24v AC signals for the HVAC system
    • I found that a 330Ω resistor behaves better in place of the 560Ω resistors.  Possibly because for my heatpump system, I sometimes have to drive all three circuits at once.
  • iPhone 4 and 3D printed wall dock (optional)
    • Mounts in place of the old thermostat to allow for “normal” interaction with the thermostat (for guests, etc.)
  • Spark Core Wifi enabled microcontroller (optional)
    • Remote wireless sensors
  • DS18B20 One-Wire temperature sensor (at least one, but the more the better!)
    • Pair one with your Pi, and then one per Spark Core.
    • I got the enclosed waterproof type which was probably unnecessary
  • Web Server
    • I used an old computer to host the web app and MySQL database locally, but it should work just as well on a cloud server
  • Wall Access Panel
    • Due to my Mechanical Engineerness, my electronics hardware work should be hidden from the light of day.
  • Jumper wires, resistors, etc.

Continue reading Raspberry Pi Thermostat Part 2: Hardware Overview

Raspberry Pi Thermostat Part 1: System Overview

Raspberry Pi Home Automation Thermostat Demo Fig1

(I found this article at The Nooganeer and publish it here with his permission)

THIS IS AN OVERVIEW OF THE ENTIRE PROJECT.  AS I HAVE TIME I WILL RELEASE MORE IN-DEPTH TUTORIALS AND THE SOURCE CODE.  STAY TUNED!

Home automation has always been a fascination of mine.  How much time and irritation would I save if I didn’t have to worry about turning things on and off, or wonder in which state they were left?  How much more efficient would my home be?  Wouldn’t it be cool to always know the state of every power consumer in my home, and then be able to record and analyze that data as well?  With my brain nearly exploding with dreams of home automation, my wife and I bought our first home in May 2014.

The starting point for my home automation system (which of course will be DIY and open source) is a thermostat.  I needed to control the biggest energy hog in my house first!  I had a  Raspberry Pi laying around that I had done some tinkering with, and after some Googling, I decided it would be the perfect brain for my project.

I used http://makeatronics.blogspot.com/ and http://wyattwinters.com/rubustat-the-raspberry-pi-thermostat.html as a springboard to get started.

Why Am I Doing This?

Besides that I love automation and efficiency, I think this project could be a contributor to the “good” part of the Internet of Things revolution.  It is amazing how technology has brought us to the point that we are able to connect almost anything to the internet and access it from anywhere in the world.  In my eyes, one of the most valuable components of this technological advancement is the data.  Unfortunately, if you decide to purchase an IOT device, you may not be the owner of all/any of the data that device is generating.  There may be restrictions on how you can view/analyze the data, and it may be difficult or impossible to get to it in a raw form. Continue reading Raspberry Pi Thermostat Part 1: System Overview