Giter Club home page Giter Club logo

room-sensors's Introduction

room-sensors

Project Explaination

There are 4 sensors connected to an Arduino, the readings from these sensors are then parsed and written to the serial port. The Raspberry Pi reads from the serial port every 30 minutes, and stores the data into a MySQL database. A websocket server and web page is hosted on the Raspberry Pi. The websocket server will pass the sensor data to the web page, and the web page contains a chart of the data.

Packages

  • Python27:
    • pyserial
    • MySQL-python
    • SimpleWebSocketServer sudo pip install git+https://github.com/dpallot/simple-websocket-server.git
    • platformio
  • MySQL
  • python-devel
  • lighttpd
  • git

Sensors

  • DHT11 - Digital PWM Pin 3
  • LM36 - Analog Pin 1
  • Sound Sensor - Analog Pin 2
  • Photocell - Analog Pin 0

Serial Port Protocol

Start sending multiple sensors data: < Start sending a sensor reading: < Sensor indicator: 3 chars indicating sensor XXX Unit indicator: 1 char indicating unit of data C/F/% Sensor value numbers(any length): ## Finish sending a sensor reading: > Finish sending multiple sensor data: >

Example: <<DHT##C><TMP##C>>

The Raspberry Pi will know when a new full set of readings occur when sees << and >>

Install Script

This is to be ran on the Raspberry Pi connected to an Arduino.

Before installing, you have to modify the defined variables in the beginning of the script.

This script will:

  1. clone entire project from the git repo
  2. make needed scripts executable
  3. modify needed scripts with provided information at the top of the install script
  4. push the arduino code
  5. create needed database and tables
  6. copy the web pages to /var/www/html
  7. create an startup script for the wbesocket server
  8. create a cron job for reading from the arduino

Chart Output

alt text alt text

room-sensors's People

Contributors

sdelcore avatar

Watchers

 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.