Embedded Alarm Clock
Requirements
The perfect alarm clock should have the following features
- A nice looking display which is visible both in bright daylight and in complete darkness (like Echo Show)
- Automatic backlight control where the brightness is manually adjustable. Possibly different brightness setting for day and night.
- It shall have 2+ independent alarms
- It shall have 1 timer alarm
- It shall be super simple to set alarm, timer, snooze, turn on/off alarm and set time manually
- It shall have high quality buttons which are easy to press
- It should have automatic time adjustment according to time zone (either radio controlled or via WiFi)
- It shall be mains connected and not include any batteries. Battery backup for settings is however preferred.
Bonus
- Buttons may trigger smart home events
- Simple date on display
- Weather
Modes
NORMAL
- Time and alarm on/off state and possible timer state is visibleSET_ALARM_1
- Change alarm 1SET_ALARM_2
- Change alarm 2SET_TIMER
- Change timer. Timer start directly after it is setSET_BRIGHTNESS
- Change brightness levelSET_TIME
- Set timeSET_DAYLIGHT
- Change daylights saving on/off (alt: 2)WIFI_SETUP
- Go to soft-AP mode and present a configuration web page for SSID, password configuration. Manual wifi setup should also be possible.
Buttons
-
SET (S)
- Iterate between different settings- Short press - Next setting
- Short press - Switch views between timer / clock when timer active
- Long press - Exit setting
- Exit setting after inactivity period
-
UP (+)
/DOWN (-)
- Modify setting (alt: 1)- Short press - Increase/decrease by one
- Long press - Increase/decrease automatically with increasing speed
- Advantage: valid also for brightness
-
HOUR (+)
/MINUTE (-)
- Modify time setting (alt: 2)- Short press - Increase hour/minute
- Advantage: simple to switch time zone
-
MODE
- Set primary modeTIME
,AL 1
,AL 2
,TIMER
(does not support combinations) -
SNOOZE
- Delay active alarmN
minutes -
ALARM_OFF
- Turn off active alarm (possibly combined with other key). Also switchON
/OFF
in set modes
Using rotary encoder
Possibly mode selection, time setting could be selected using a rotary encoder knob.
Suitable hardware for this solution could be a nRF52840 Dongle which includes hardware support for Quadrature decoders.
State diagrams
Preferred state diagram only using a SET
button and a rotary UP/DOWN
button.
An alternative state diagram.
A simplified state diagram
Wifi provisioning
- User enter wifi settings on the provisioning server
- User setup predefined open hotspot on a phone
- Device connect over predefined hotspot
- Communicate a common device identity between cloud service and device
- Device display a short and short lived ID on display which the user enter on the web page
- User is presented with a short lived ID allocated from provisioning server which is entered to device e.g. using rotary controller
- Device has a GUID printed on the device which the user enter on the provisioning web page
- Device download provisioning information associated with common identity
Physical layout
References
- esplruino seems very simple to use.
- ESP8266 is very cabable, power efficient and cheap (5 euro).
- Lua for ESP8266
- Getting Started with ESP8266
- ESP8266 troubleshooting
- HCMS-2963
- HDLY-2416
- esp-open-sdk
- DS3232 - Maxim RTC including crystal
- 16x2 arduino clock
- 2x2 characters on 2x16 displays
- The best alarm clocks of 2019 - still not very nice except possibly the smart displays
- displays, Green Color Backlight LCD Display, similar, OLED variant
- CNC Rotary Encoder