Skip to content

An Arduino-compatible alarm clock with multiple configurable alarms and a UART / Serial API

License

Notifications You must be signed in to change notification settings

ondras12345/AlarmClock

Repository files navigation

AlarmClock

An Arduino-compatible alarm clock with multiple configurable alarms

Hardware design files are available in a separate repository: AlarmClock-hardware

Front side of AlarmClock in a wooden enclosure Back side of AlarmClock in a wooden enclosure

Features

  • 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)
    Example LCD content for alarm configuration
  • 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)
    Ambient LED control within Home Assistant
  • a web-based configuration interface (runs on PC, requires the MQTT adapter to be set up)
    Web configuration of AlarmClock

Building

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.

Testing

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

Documentation

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.

About

An Arduino-compatible alarm clock with multiple configurable alarms and a UART / Serial API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published