Go Down

Topic: Wemos D1 WiFi alarm clock - work in progress (Read 376 times) previous topic - next topic

ericBcreator

May 13, 2019, 06:35 pm Last Edit: May 21, 2019, 01:15 pm by ericBcreator
Edit: the project page is now live over here: https://www.hackster.io/ericBcreator/programmable-multi-alarm-clock-with-web-interface-75dc6a

Here is a new project I'm working on, a Wemos D1 WiFi enabled alarm clock:



For now, it uses the D1, a (nice green) 4x8x8 LED matrix display, a rotary encoder and a buzzer. On startup it connects to Wifi, reads the current time, determines DST and goes into the main loop mode, displaying the time and full date and time alternatively. The alarm can bet set on or off with the encoder and it can also be used to set the alarm time. The alarm settings are stored in EEPROM so will be reread after a power failure.

It is still a work in progress and I'm looking at ways to expand the functionality, maybe a webinterface for setting alarms and options, maybe the latest news and weather forecast after the alarm went off (I did something similar in a previous project, a LED matrix message Board).

Here is a video here with the current progress:https://youtu.be/yKT92kumzJc

Any suggestions?

zoomx

If you want to show more information maybe you should use an SPI TFT LCD screen.
You can add a light intensity sensor for automatic screen brightness.

ericBcreator

If you want to show more information maybe you should use an SPI TFT LCD screen.
You can add a light intensity sensor for automatic screen brightness.
Hey, thanks for your feedback. The light sensor is a good idea.
I think it would need covering up the led matrix with a dark shade foil because I have the brightness set to a minimum as default already because otherwise I find it too bright in a dark room.
Another thought would be a PIR sensor so the display would switch off after a couple of minutes with no motion and on again when you wave your hand (etc). And of course also when the alarm is triggered.

The LCD would be nice and I did consider a nice color screen. It would take a pretty large screen to be able to read it from a distance though. And that would draw quote some power, not so suitable for battery power. Maybe a Nextion display would do but it is slow to update, scrolling text cold be an issue. Therefore I figured the led matrix seemed the best fitting for this project, for now.

An addition I already did was unlimited (well, limited to the EEPROM size) alarms with optional text messages to display as the alarm triggers (so like Feed the dog at 12:00 every day). I also added day, week of the day, weekdays, weekend days and month options.
Another thought in progress is to add actions to the alarm, like triggering GPIO pins to (de)activate other devices.
A final thought is recurring alarms, like every 15 minutes, a beep every hour or whatever.


zoomx

If you want to go on battery ESP8266 isn't a good choise. I use ESP8266 for the same reason, NTP time set, but, maybe you can use an Arduino pro mini (with some modifications), an DS3231 RTC and an ESP8266 as a WiFi shield that you turn on only when you need set time. There is a sketch for ESP8266 so it became a WiFi shield or it can be done with a sketch that, when the ESP8266 is turned on get NTP time and print it on serial. You can turn on ESP8266 once a day.

You have to remove all small leds in RTC module and Arduino.

ericBcreator

If you want to go on battery ESP8266 isn't a good choise. I use ESP8266 for the same reason, NTP time set, but, maybe you can use an Arduino pro mini (with some modifications), an DS3231 RTC and an ESP8266 as a WiFi shield that you turn on only when you need set time. There is a sketch for ESP8266 so it became a WiFi shield or it can be done with a sketch that, when the ESP8266 is turned on get NTP time and print it on serial. You can turn on ESP8266 once a day.

You have to remove all small leds in RTC module and Arduino.

Yes, chosing for battery power with max battery life will mean making some choices for the setup and coding.
I'll give it some thought.

As of today, I finished the recurring alarms from seconds to months.
The next challenge will be the webinterface. Besides hardcoding HTML (and maybe javascript) I don't have a smart and easy solution for that yet.

ericBcreator

#5
May 19, 2019, 06:51 pm Last Edit: May 20, 2019, 04:23 pm by ericBcreator
Update: I added a web interface, multiple alarms, actions (setting GPIO pins on/off), etc.



Here is a video: https://youtu.be/pX5fLL93xyc

zoomx



zoomx

Maybe an interface like the one used by smartphone alarm clock where you can add rules.

ericBcreator

#9
May 20, 2019, 04:22 pm Last Edit: May 20, 2019, 04:25 pm by ericBcreator
Maybe an interface like the one used by smartphone alarm clock where you can add rules.
The webinterface resizes dynamically to fit desktop, tablet and smartphone screens:



Quick tip: a soft ap needs a password with at least 8 characters or it won't update.
That had me headscratching for quite a while!

ericBcreator

#10
May 21, 2019, 01:15 pm Last Edit: May 21, 2019, 07:50 pm by ericBcreator

zoomx


ericBcreator

#12
May 21, 2019, 07:49 pm Last Edit: May 21, 2019, 07:53 pm by ericBcreator
Great! Thanks for sharing!!!
No problem!

It took some time but I just finished adding a web interface for setting up the WiFi credentials (so no need for hard coding them):



It is pretty easy to add this WiFi setup to other projects as well, maybe I'll create a library for it.

zoomx

There is already a library for this: WiFiManager!
Anyway well done!

ericBcreator

#14
May 21, 2019, 10:16 pm Last Edit: May 21, 2019, 10:18 pm by ericBcreator
There is already a library for this: WiFiManager!
Anyway well done!
Yeah, I tried it and it works fine...but not with the ESPUI library, it was either one or the other.
Now I have both :-)

Go Up