Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/christoph-d/esp8266-wakelight
An alarm clock with light instead of sound
https://github.com/christoph-d/esp8266-wakelight
alarm-clock esp8266 leds nodemcu
Last synced: 9 days ago
JSON representation
An alarm clock with light instead of sound
- Host: GitHub
- URL: https://github.com/christoph-d/esp8266-wakelight
- Owner: Christoph-D
- License: gpl-2.0
- Created: 2016-05-13T16:40:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-05-15T15:49:05.000Z (over 8 years ago)
- Last Synced: 2024-11-27T12:21:10.076Z (2 months ago)
- Topics: alarm-clock, esp8266, leds, nodemcu
- Language: JavaScript
- Size: 140 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
esp8266-wakelight
=================An alarm clock with light instead of sound, simulating a sunrise, with
NTP time synchronization, and with programmable alarm times for each
day of the week.This code works on the esp8266 wifi module with the nodemcu firmware.
It was successfully tested on an ESP-01 and an ESP-12E.Web Interface
-------------Click on this image to the web interface in action:
[![screenshot](https://raw.github.com/Christoph-D/esp8266-wakelight/master/webinterface.png)](https://raw.github.com/Christoph-D/esp8266-wakelight/master/webinterface.mp4)
For no good reason, the interface is partly in Japanese (月曜日 is
"Monday", etc.).The "Toggle" button toggles the time zone between CET and CEST.
Setting different time zones amounts to changing the offsets in
`src/time.lua`.Eventually daylight saving time (DST) should toggle automatically
based on the time zone, but this would require keeping track of the
date, which is not implemented yet. The wakelight remembers the
status of daylight saving time after power loss, as well as the alarm
times.Hardware
--------Any esp8266 module will do, even the cheap ESP-01 ($1-$2 on
aliexpress). First you need to flash it with a recent nodemcu
firmware. Don't use prebuilt firmwares, those are far too old and
won't work. Either
[compile your own](https://hub.docker.com/r/marcelstoer/nodemcu-build/)
or use http://nodemcu-build.com/ to get a recent firmware. You need
to enable at least the following modules: file, gpio, net, node,
rtcmem, rtctime, sntp, tmr, uart, wifi, ws2812.The LEDs must be WS2812B modules. You can change the number of LEDs
in `globals.lua`. The default for `NUM_LEDS` is 144, which is the
number of LEDs on a common high density 1m strip. For increased
brightness, you can connect multiple strips in parallel without
changing `NUM_LEDS`, or concatenate them and increase `NUM_LEDS` (I
would recommend the former because the timing of these LEDs strains
the ESP chip). I would say that two 1m strips (144 LED/m), a total of
288 LEDs, are the minimum for adequate brightness. Unfortunately the
WS2812B LEDs are not very efficient compared to modern LED bulbs.Please be aware that driving the LEDs requires quite a lot of power
(>25W for 144 LEDs). A 5V cellphone charger or a computer USB port
will not work.The LEDs must be connected to pin 4 of the ESP chip. The ws2812
module in nodemcu only works on the serial transmitter pin, which
happens to be pin 4.You may also need a level shifter between the LEDs and the ESP because
the ESP is 3.3V but the WS2812B LEDs are 5V. In my case it also
worked without a level shifter, but adding one reduced glitches on the
LED strips.OTA Upload
----------The wakelight accepts over-the-air updates of lua files from the
script `ota_upload.sh`. There is currently no authentication.Schematic
----------![schematic](https://raw.github.com/Christoph-D/esp8266-wakelight/master/schematic/wakelight_schematic.png)
The schematic uses the ESP components from
https://github.com/jdunmire/kicad-ESP8266 .Because I could not readily find a level shifter component in kicad, I
omitted that part in the schematic. The actual hardware has a
TXS0108E between pin 4 of the ESP chip and the WS2812B LED input.Mood Light
----------There is also a very simple mood light feature that you can
enable/disable manually from the web interface. This is mostly an
experiment and serves no purpose. Currently implemented is red, green
and white light. Edit the file `src/mood.lua` if you would like to
implement more complex lighting scenarios.