Raspberry Pi-powered smart alarm clock. A RGB Light Strip, loud buzzer, bed shaker, web app, geo-location knowledge, and Character LCD display
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
- Update README - note: install local express-users with
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.
The prototype alarm
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.
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.
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.
The web app
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.
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.
cd PiAlarm/Python
python modules/TM1637.py
# There should be a few statements printed and you can press enter to confirm each test