Coder Social home page Coder Social logo

interval's Introduction

interval

This is a project for a class at the University of Applied Sciences Potsdam. The goal was to create an IoT-Device, preferably with NodeJS and Johnny Five. The two-week long class was supervised by Fabian Morón Zirfas.

Interval is a sleep tracker that grabs values from an accelerometer (in this case the MPU6050) and visualizes movement throughout the night. Tracking can be started and ended via a website that runs on NodeJS, which is also the place where the visualization happens.

Hardware

For this project, I’ve used a Raspberry Pi A+ hooked up with an Edimax WiFi USB Adapter. The accelerometer in use is the MPU-6050. See the Fritzing Sketch for correct installation.

I attached the accelerometer to a wooden board for more accurate tracking and placed it next to my pillow. See the prototype below:

The final product would be invisible and hidden underneath the sheets/bed.

Software

NodeJS and MongoDB is running on the Raspberry Pi. I get the accelerometer data through the (specific) mpu6050 module. For installation instructions I collected some helpful links below.

I set up forever on my Raspberry Pi so that my server is always up and running. Otherwise just use npm start to start. Make sure that the database is running (sudo mongod start or sudo /etc/init.d/mongod start).

Communication between frontend and backend happens either via AJAX (for data) or socket.io (for starting/ending tracking).

If you want to change the styling of the page please use Compass via the comapass watch command in the root of the project. The stylesheets can be found in the /sass directory. Output is in /public/css.

For templating Jade is used, the views are located in /views.

Also, run bower install to get all frontend components (located in /public/components)!

Screenshot

As stated before, tracking can be started and ended on the website. The visualization also happens there. The higher the values, the lighter is the sleep at that time. Low values indicate a deep sleep phase.

Concerns and Outlook

Unfortunately the visualization and tracking of the accelerometer data is not as accuate and unambiguous as I’ve hoped, so there is definitely some work to do.

I could imagine interesting addtions to the hardware, such as sensors for air quality, temperature, brightness, or even more accelerometers that are attached to the body. Autonomous starting and ending of the tracking could be a cool feature on the software side.

Helpful Links

License

The MIT License (MIT)

Copyright (c) 2015 Fabian Schultz

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

interval's People

Contributors

fabe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

sandorex thegeett

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.