Code Monkey home page Code Monkey logo

raspberry-pi-thermostat's Introduction

Raspberry Pi Thermostat interface

A responsive web interface for controlling a Raspberry Pi thermostat.

Idea

This is based on project I did back when I was in university: creating a smart thermostat that could be controlled both with a web interface and through manual controls.

The original implementation was in PHP (web interface) and C# (micro-controller) and I wasn't quite happy about it and, on top of that, it was based on a custom micro-controller which was quite expensive (but provided by the university :P ).

I decided then to reimplement what I did in PHP with Python and a Raspberry Pi.

Requirements

Hardware

  • A raspberry Pi
  • A thermistor to detect the temperature
  • Buttons*
  • A monochromatic display*

* Only if you want physical controls

Software

  • Python 3
  • pip

Once you have pip, the other requirements can be installed with pip install -r requirements.txt

Starting up

The web interface can be started by launching python3 run.py and is reachable at port 8080. Here's how it should look:

Homepage

Homepage

Control temperature

Weekly Control

Inside the code

Overview

The web interface is based on Python and web.py micro-framework. Code for the different pages is at routes/

Pages are created with Jinja2 templating engine. All pages are responsive and built with Zurb Foundation CSS Framework. There is some Javascript (jQuery) to sweeten the user experience. They are in templates/ folder.

Data is saved using a sqlite db. A sample database is already provided (thermostat.db), but one can be created with createDB.py.

The temperature reading and control is inside Thermostat.py

Status

  • The web interface is mostly OK. I wanted to implement a route (/stats) to display some historical data on graphs.
  • The temperature reading should be ok if using the thermistor. Since I am not on a budget anymore, I would buy a proper temperature sensor.
  • Setting the temperature with physical controls needs to be implemented
  • Dispaying the current temperature needs to be implemented. If you do that, you need a display to wire up on the RPi.

raspberry-pi-thermostat's People

Contributors

kwbmm avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.