Coder Social home page Coder Social logo

xeyvezy / pialarm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kyleking/pialarm

0.0 1.0 0.0 22.2 MB

Node, React, a Huge LED Strip, Mini Bed Shaker, and boring buzzer - all on a Pi

License: MIT License

Python 62.55% JavaScript 30.58% Shell 0.94% HTML 5.93%

pialarm's Introduction

PiAlarm

Raspberry Pi-powered smart alarm clock. A RGB Light Strip, loud buzzer, bed shaker, web app, geo-location knowledge, and Character LCD display

WIP

Action Items:

  • Weather display doesn't update
  • LCD wrap text is broken...
  • Add simply.js to modify alarms from watch: http://simplyjs.io/
  • Configure router with InternalPort:8000 / ServicePort:80 (this way port isn't needed in URL)
  • Rebuild alarm housing
    • Re-solder the speaker to a 5V line rather than the current 3V
    • Add a longer light strip!
    • Capture a better image of the alarm clock assembly then label everything in Sketch
  • From TODO.txt
    • Update README - note: install local express-users with npm i ../Pull Requests/express-users
    • Update the wiring diagram

The Alarm

I'm a heavy sleeper, so I designed the alarm clock to go from pleasant to effective. When the alarm starts, a RGB LED strip lights up and gently increases in brightness. The second stage starts a buzzer and increase the LED strips brightness. The third stage initiates the bed shaker, buzzer, and fades the RGB LED strip between color values at full brightness. At any point, I can press the push button button and turn off the alarm.

above view

The prototype alarm

Display

The current display is a simple character LCD that I had lying around. I'm working on replacing it with a 4 custom RGB LED digits. I'm using shift registers to control the insane number of pins necessary to set each LED individually. I'll update the progress on the new display sometime soon.

Location Smarts

Using If This Then That (IFTTT), I setup a recipe that makes a web request when I'm away to turn off the alarm and when I return to activate the alarm. This way, the alarm won't run unless I'm present.

Web app

Using react and socket.io, I built a simple web app accessible anywhere. Once in the app, new alarms can be set using basic cron syntax. The back end of the app handles scheduling, starting, and deleting alarms as I modify the database of alarms.

web app

The web app

How to run your own version

First, check the pins.ini file in the Python/ directory, then proceed the test of each hardware before booting the web application for the first time.

Initialization

You will need a secret.ini file in the Python/ directory:

[IFTTT]
key = <>

[WU]
info = Weather Underground API
apikey = <>
lat = <>
lon = <>

Python packages and other libraries installed, see the script ./Python/requirements.sh

and Node modules: cd PiAlarm; npm install

There are likely other bugs, so open an issue if you run into any trouble. This app really isn't built for distribution and is only a personal side-project.

Hardware Test: TM1637 7-Digit Display

cd PiAlarm/Python
python modules/TM1637.py
# There should be a few statements printed and you can press enter to confirm each test

Acknowledgments

Web app based on React example apps published by Twilio

Made by

Kyle King

pialarm's People

Contributors

kyleking avatar

Watchers

James Cloos 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.