An Arduino-compatible alarm clock with multiple configurable alarms
Hardware design files are available in a separate repository: AlarmClock-hardware
- configurable number (default 6, max 16) of configurable alarms
- snooze feature with configurable time and count
- a different ringing tone when snooze cannot be used (last ringing)
- an LED that slowly lights up before the alarm sounds (ambient)
- 2 separate buttons (snooze and stop). Stop can be installed further away from the bed, so that the user cannot reach it while still laying.
- a 16x2 character LCD with a rotary encoder for configuration
(GUI)
- an easy to parse serial port (UART) text-based configuration interface (CLI)
- a Python library and MQTT adapter for easy control from a PC
and automation (device needs to be connected to a server / PC via UART)
- a web-based configuration interface (runs on PC, requires
the MQTT adapter to be set up)
Use PlatformIO to build the firmware. It will handle the dependencies automatically.
Upload to an Arduino UNO development board via UART:
# update libraries
make update
# compile
make
# upload via UART
make upload
Upload to the AlarmClock-hardware board using USBasp:
# update libraries
make update
# compile
make ENVIRONMENT=atmega328p
# burn fuses and bootloader
make bootloader ENVIRONMENT=atmega328p
# upload using USBasp ICSP programmer
make upload ENVIRONMENT=atmega328p
For more information, type make help
.
Building with Arduino IDE should be possible, but you might need to create a few symlinks. I use PlatformIO exclusively for my testing, so Arduino IDE should be considered unsupported.
Static code analysis is performed on the computer used for development using
cppcheck
.
Native unit tests run natively on the computer used for development.
Not everything can be tested that way, so additional tests were written that need to run on the target microcontroller (embedded device). A new firmware is uploaded to the device and test results are received through UART.
# run static code analysis:
make check
# run native tests:
make test
# run tests on embedded device:
make test_embedded
See the manual.
You can generate documentation for the source code using doxygen
.
Just type make docs
.
I also published comprehensive documentation of the development process, but it is only available in Czech.