Coder Social home page Coder Social logo

clockspot / arduino-clock Goto Github PK

View Code? Open in Web Editor NEW
24.0 2.0 1.0 1.33 MB

Digital clock code for Arduino Nano and Nano 33 IoT, to drive nixie or LED matrix displays

License: GNU Lesser General Public License v2.1

C++ 81.06% C 18.94%
digital-clock alarm alarm-clock nixie nixie-tubes nixie-clock led-matrix sn74141 max7219 max7219-clock

arduino-clock's Introduction

Universal Arduino Digital Clock

Arduino clocks

Operating instructions

The latest operating instructions (v2.0+) can be found here.

Instructions for earlier versions are here.

To see your clock’s software version, hold Select briefly while powering up the clock.

About

A universal digital clock codebase for Arduino, maintained by Luke.

  • Time of day with automatic DST change and chimes.
  • Perpetual calendar with day counter and local sunrise/sunset times.
  • Alarm with snooze and automatic weekday/weekend skipping.
  • Chronograph and timer with reset/interval options.
  • Runs on both classic Arduino Nano (AVR) and Nano 33 IoT (SAMD21).
  • Supports web-based config and NTP sync over Wi-Fi on Nano 33 IoT.
  • Simple control via three/four buttons, a rotary encoder, and/or Nano 33 IoT’s IMU (tilt control).
  • Signals via piezo beeper, switch (e.g. appliance timer), and/or pulse (e.g. bell ringer).
  • Supports Nixie displays of two SN74141 chips driving four/six tubes, with anti-cathode poisoning.
  • Supports LED displays of three/four MAX7219 chips (via SPI) driving 8x8 LED matrices (example).
  • Scheduled nightly/weekly display dim/shutoff and switchable backlighting with optional PWM fade.
  • Timekeeping can be internal, or based on a DS3231 RTC (via I2C) for reliability/accuracy.
  • Settings stored persistently in case of power loss, and mirrored in RAM in case of EEPROM/flash failure.

Written to support RLB Designs’ Universal Nixie Driver Board (UNDB):

  • Backlighting (PWM LED) supported on UNDB v8+
  • Switch and pulse signals supported on UNDB v9+
  • Nano 33 IoT support coming on future versions

The latest release can be downloaded here. Please note known bugs and to-dos.

Configuration, compilation, and upload

Various options, such as enabled functionality, RTC, display, I/O pins, timeouts, and control behaviors, are specified in a config file. This allows you to maintain configs for multiple clock hardware profiles, and simply include the relevant config at the top of arduino-clock.h before compiling. Several example configs are provided, and ~sample.h includes all possible options with detailed comments.

You may also wish to adjust the defaults for the clock’s user-configurable values to best suit its intended use, in case the user performs a hard reset. Some of these are specified in the config; others, for now, are hardcoded in arduino-clock.ino (optsDef[] for settings and initEEPROM() for other values).

I use the Arduino IDE to compile and upload, due to the use of various Arduino and Arduino-oriented libraries. Make sure the relevant libraries are installed in the Library Manager, per the config in use.

  • EEPROM (Arduino) for AVR Arduinos (e.g. classic Nano)
  • SPI (Arduino) and LedControl for MAX7219-based displays
  • Encoder if rotary encoder is used for Up/Down inputs
  • Arduino_LSM6DS3 (Arduino) if using Nano 33 IoT’s IMU for inputs
  • WiFiNINA and WiFiUdp (Arduino) for Wi-Fi and NTP sync support on Nano 33 IoT
  • FlashStorage for persistent storage on Nano 33 IoT
  • Wire (Arduino) and DS3231 if using DS3231 RTC (via I2C)
  • Dusk2Dawn if sunrise/sunset display is enabled
    • Note: At this writing, for Nano 33 IoT, it’s necessary to download this library as .ZIP and add manually, as the version in the Library Manager is old and, in my experience, will not compile for SAMD.

Before compiling and uploading, you will need to select the correct board, port, and (for AVR) processor in the IDE’s Tools menu.

  • If your Arduino does not appear as a port option, you may have a clone that requires drivers for the CH340 chipset.
  • If upload fails for an ATMega328P Arduino (e.g. classic Nano), try selecting/unselecting “Old Bootloader” in the processor menu.

arduino-clock's People

Contributors

clockspot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

pmns

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.