Skip to content

Commit b6c9181

Browse files
committed
More readme/instructions; LED->backlight (w/untested non-PWM support)
1 parent 87b828a commit b6c9181

File tree

12 files changed

+144
-130
lines changed

12 files changed

+144
-130
lines changed

INSTRUCTIONS.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Your clock has four main functions: [time of day](#time-of-day), [calendar](#cal
44

55
To set anything, simply hold **Select** until the display blinks; use **Up/Down** to set, and **Select** to save.
66

7-
Additional settings are available in the [settings menu](#settings-menu). If you have a Wi-Fi-enabled clock, you can configure these settings (and more) on the [settings webpage](#wi-fi-support), where you can also configure the clock to set itself.
7+
Additional settings are available in the [settings menu](#settings-menu). If you have a Wi-Fi-enabled clock, you can configure these settings (and more) on the [settings page](#wi-fi-support), where you can also configure the clock to set itself.
88

99
## Time of day
1010

@@ -74,7 +74,7 @@ If your clock has _neither_ a switch signal nor [Wi-Fi support](#wi-fi-support),
7474
* To enter the settings menu, hold **Select** for 3 seconds until the hour displays `1`. This indicates option number 1.
7575
* Use **Up/Down** to go to the option number you want to set (see table below); press **Select** to open it for setting (display will blink); use **Up/Down** to set; and **Select** to save.
7676
* When all done, hold **Select** to exit the menu.
77-
* If you have a Wi-Fi-enabled clock, you can configure these settings (and more) on the [settings webpage](#wi-fi-support).
77+
* If you have a Wi-Fi-enabled clock, you can configure these settings (and more) on the [settings page](#wi-fi-support).
7878

7979
| | Option | Settings |
8080
| --- | --- | --- |
@@ -121,19 +121,21 @@ To reset the clock to “factory” settings, hold **Select** for 15 seconds whi
121121

122122
## Wi-Fi support
123123

124-
If your clock is Wi-Fi-enabled, it provides a settings webpage that duplicates the settings menu above (and more), and it can set itself by synchronizing to an [NTP time server](https://en.wikipedia.org/wiki/Time_server). To use NTP sync, use the webpage to supply the credentials for your Wi-Fi network.
124+
If your clock is Wi-Fi-enabled, it offers a settings webpage that duplicates the menu above (and more), and can set itself by synchronizing to an [NTP time server](https://en.wikipedia.org/wiki/Time_server).
125125

126-
To access the settings webpage, grab a device with a web browser, and briefly hold **Alt**.
126+
To access the settings page, grab a device with a web browser, and briefly hold **Alt**.
127127

128128
* If the clock **is not** connected to Wi-Fi, it will display `7777`.
129-
* This indicates the clock is broadcasting a Wi-Fi access point called “Clock”. Connect your device to “Clock” and browse to [7.7.7.7](http://7.7.7.7).
129+
* This indicates it is broadcasting a Wi-Fi network called “Clock.” Connect your device to “Clock” and browse to [7.7.7.7](http://7.7.7.7).
130130

131131
* If the clock **is** connected to Wi-Fi, it will flash its IP address (as a series of four numbers).
132-
* Connect your device to the same Wi-Fi network, and browse to that IP address.
133-
* If you don't know what Wi-Fi network the clock is connected to, hold **Alt** for 10 seconds. It will disconnect from that network and broadcast the “Clock” access point, as above.
132+
* Connect your device to the same Wi-Fi network as the clock, and browse to that IP address.
133+
* If you dont know what Wi-Fi network the clock is connected to, hold **Alt** for 10 seconds. It will disconnect from that network and broadcast the “Clock” access point, as above.
134134

135-
For security, the clock will stop serving the settings page (and “Clock” access point, if applicable) after two minutes of inactivity.
135+
If you change the Wi-Fi settings, the clock will immediately attempt to (re)connect, and will display its IP address if successful, or `7777` if not. To continue configuring the clock, reconnect to it as above.
136136

137-
When NTP sync is enabled, the clock will attempt to synchronize itself every hour (at minute 59). The settings webpage will indicate how recently the clock was last synced.
137+
For security, the settings page (and “Clock” network if applicable) will stop after two minutes of inactivity.
138138

139-
**If the clock displays the time without seconds,** this indicates it was unable to sync in the last 24 hours. Check to make sure the clock is connected to Wi-Fi and configured to use a valid NTP server, and try a manual sync. If no Wi-Fi is available or you're unable to sync for other reasons (such as network limitations), disable Wi-Fi or NTP sync to restore the seconds display.
139+
When NTP sync is enabled, the clock will attempt to synchronize every hour (at minute 59). The settings page will indicate how recently the clock was last synced.
140+
141+
**If the clock displays the time without seconds,** this indicates it was unable to sync in the last 24 hours. Check to make sure the clock is connected to Wi-Fi and configured to use a valid NTP server, and try a manual sync. If no Wi-Fi is available or you’re unable to sync for other reasons (such as network limitations), disable Wi-Fi or NTP sync to restore the seconds display.

README.md

Lines changed: 29 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,69 +4,55 @@
44

55
## Operating instructions
66

7-
[The latest operating instructions (v2.0+) can be found here.](https://github.com/clockspot/arduino-clock/releases)
7+
[The latest operating instructions (v2.0+) can be found here.](https://github.com/clockspot/arduino-clock/blob/master/INSTRUCTIONS.md)
88

9-
[Instructions for earlier versions are here.](https://github.com/clockspot/arduino-nixie/releases)
9+
[Instructions for earlier versions are here.](https://github.com/clockspot/arduino-clock/releases)
1010

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

1313
## About
1414

15-
**A universal digital clock codebase for Arduino.**
15+
**A universal digital clock codebase for Arduino,** maintained by [Luke](https://theclockspot.com).
1616

17-
* Time of day with automatic DST change, display shutoff, and chimes.
17+
* Time of day with automatic DST change and chimes.
1818
* Perpetual calendar with day counter and local sunrise/sunset times.
19-
* Alarm with snooze and automatic weekday/weekend skipping.
20-
* Chronograph and timer with interval and reset options.
21-
* Signals via piezo beeper, switch (appliance timer), pulse (bell ringer), and switchable backlighting.
22-
* Supports Nixie displays of four/six digits, multiplexed in pairs via two SN74141 driver chips.
23-
* Supports LED displays of three or four MAX7219 chips (via SPI) driving 8x8 LED matrices (example).
19+
* Daily alarm with snooze and automatic weekday/weekend skipping.
20+
* Chronograph and timer with reset/interval options.
21+
* Simple control via three/four buttons, a rotary encoder, and/or an [IMU](https://en.wikipedia.org/wiki/Inertial_measurement_unit) (tilt control).
22+
* Signals via piezo beeper, switch (e.g. appliance timer), and/or pulse (e.g. bell ringer).
23+
* Supports Nixie displays of two SN74141 chips driving four/six tubes, with anti-cathode poisoning.
24+
* Supports LED displays of three/four MAX7219 chips (via SPI) driving 8x8 LED matrices ([example](https://www.amazon.com/HiLetgo-MAX7219-Arduino-Microcontroller-Display/dp/B07FFV537V/)).
25+
* Supports scheduled display dim/shutoff and switchable backlighting with optional PWM fade.
2426
* Timekeeping can be internal, or based on a DS3231 RTC (via I2C) for reliability/accuracy.
2527
* Supports both AVR and SAMD Arduinos (tested on Arduino Nano and Nano 33 IoT).
26-
* On Nano 33 IoT, supports Wi-Fi connectivity with web-based config and NTP sync.
28+
* On Nano 33 IoT, supports Wi-Fi connectivity with web-based config and automatic NTP sync.
2729

28-
Originally written for [RLB Designs’](http://rlb-designs.com/) Universal Nixie Driver Board (UNDB):
30+
Written to support [RLB Designs’](http://rlb-designs.com/) Universal Nixie Driver Board (UNDB):
2931

3032
* Backlighting (PWM LED) supported on UNDB v8+
3133
* Switch and pulse signals supported on UNDB v9+
3234
* Nano 33 IoT support coming on future versions
3335

34-
[The latest release can be downloaded here.](https://github.com/clockspot/arduino-nixie/releases/latest)
36+
[The latest release can be downloaded here.](https://github.com/clockspot/arduino-clock/releases/latest)
3537

36-
# Hardware configuration
38+
# Configuration, compilation, and upload
3739

38-
A number of hardware-related settings are specified in a config file, so you can easily maintain multiple hardware profiles in their own config files, and include the relevant config at the top of the sketch before compiling.
40+
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 multiple configs for various clock hardware profiles, and simply include the relevant config at the top of the `.ino` before compiling. Several [example configs](https://github.com/clockspot/arduino-clock/tree/master/arduino-clock/configs) are provided, and [`~sample.h`](https://github.com/clockspot/arduino-clock/blob/master/arduino-clock/configs/%7Esample.h) includes all possible options with detailed comments.
3941

40-
These settings include:
42+
You may also wish to adjust the defaults for the clock’s user-configurable values, to best suit its intended use; these defaults are currently specified in the main code (`optsDef[]` for [settings](https://github.com/clockspot/arduino-clock/blob/master/INSTRUCTIONS.md#settings-menu) and `initEEPROM()` for other values).
4143

42-
* **Number of digits** in the display module. Default is 6; small display adjustments are made for 4-tube clocks.
43-
* **Which functions** are enabled (calendar, alarm, etc).
44-
* **Which pins** are associated with the inputs (controls) and outputs (displays and signals).
45-
* If your clock includes LED backlighting (e.g. UNDB v8+), specifying an LED pin will enable the LED-related options in the options menu. LEDs should be connected to a PWM pin.
46-
* **What type of Up/Down controls** are equipped: pushbuttons (default) or rotary encoder (TBD).
47-
* **What type of signal outputs** are equipped: a piezo beeper (default) and/or a relay.
48-
* **Signal duration** (default 3min) and **piezo pulse duration** (default 500ms)
49-
* If your clock includes a relay (e.g. UNDB v9+), specifying a relay pin will enable the relay-related options in the options menu. You can also specify the **relay mode**:
50-
* In switched mode (default), the relay will be switched to control an appliance like a radio or lamp. If used with timer, it will switch on while timer is running (like the “sleep” function on a clock radio). If used with alarm, it will switch on when alarm trips and stay on for **relay switch duration** (default 2 hours). In this case, the **Alt** button (if equipped) will shut it off immediately, skipping snooze. This mode also enables the option for the LED backlighting, if equipped, to switch with the relay (great for a radio!).
51-
* In pulse mode, the relay will be pulsed, like the beeper is, to control an intermittent signaling device like a solenoid or indicator lamp; specify **relay pulse duration** (default 200ms).
52-
* **Soft alarm switch** enabled: default is yes; it is switched with **Up** (on) and **Down** (off) while viewing the alarm time. Change to no if the signal output/appliance has its own switch on this relay circuit; the software alarm will be permanently on.
53-
* **Soft power switch** enabled (switched relay only): default is yes; appliance can be toggled on/off with **Alt**. Change to no if the appliance has its own power switch (independent of this relay circuit) or does not need to be manually switched. (If set to no, or not using a switched relay, **Alt** acts as a function preset, as above.)
54-
* **Various other durations** for things like scrolling speed, set function/display timeouts, short and long button holds, “hold to set faster” thresholds, etc.
44+
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.
5545

56-
You can also set the **defaults for the options menu** (in main code, currently) to better suit the clock’s intended use.
46+
* EEPROM (Arduino) for AVR Arduinos (e.g. original Nano)
47+
* SPI (Arduino) and [LedControl](http://wayoda.github.io/LedControl) for MAX7219-based displays
48+
* [Encoder](https://github.com/PaulStoffregen/Encoder) if rotary encoder is used for Up/Down inputs
49+
* Arduino_LSM6DS3 (Arduino) if using Nano 33 IoT’s IMU for inputs
50+
* WiFiNINA and WiFiUdp (Arduino) for Wi-Fi and NTP sync support on Nano 33 IoT
51+
* Wire (Arduino) and [DS3231](https://github.com/NorthernWidget/DS3231) if using DS3231 RTC (via I2C)
52+
* [Dusk2Dawn](https://github.com/dmkishi/Dusk2Dawn) if sunrise/sunset display is enabled
53+
* Note: At this writing, for Nano 33 IoT, it’s necessary to download this library as .ZIP and [add manually](https://www.arduino.cc/en/guide/libraries#toc4), as the version in the Library Manager [is old](https://forum.arduino.cc/index.php?topic=479550.msg3852574#msg3852574) and, in my experience, will not compile for SAMD.
5754

58-
## Compiling the sketch
55+
Before compiling and uploading, you will need to select the correct board, port, and (for AVR) processor in the IDE’s Tools menu.
5956

60-
The author uses the Arduino IDE to compile, due to the use of various Arduino and Arduino-oriented libraries. Install them via the Library Manager as applicable (except where indicated otherwise).
61-
62-
* Wire (Arduino)
63-
* EEPROM (Arduino) - for AVR-based Arduinos
64-
* SPI (Arduino) and [LedControl](http://wayoda.github.io/LedControl) by Eberhard Farle - for MAX7219-based displays
65-
* Arduino_LSM6DS3 (Arduino) - if using Nano 33 IoT's IMU (Inertial Measurement Unit) for inputs
66-
* WiFiNINA and WiFiUdp (Arduino) - for Nano 33 IoT Wi-Fi and NTP sync support
67-
* [DS3231](https://github.com/NorthernWidget/DS3231) by NorthernWidget - if using DS3231 for timekeeping
68-
* [Dusk2Dawn](https://github.com/dmkishi/Dusk2Dawn) by DM Kishi - if sunrise/sunset display is enabled
69-
* Note: For Nano 33 IoT, it seems necessary to download the library from source as .ZIP and [add manually](https://www.arduino.cc/en/guide/libraries#toc4), rather than add directly via the Library Manager.
70-
* [Encoder](https://github.com/PaulStoffregen/Encoder) by Paul Stoffregen - if rotary encoder is used for Up/Down inputs
71-
72-
**To upload the sketch to your clock,** if it doesn’t appear in the IDE’s Ports menu (as a USB port), your UNDB may be equipped with an Arduino clone that requires [drivers for the CH340 chipset](https://sparks.gogo.co.nz/ch340.html).
57+
* If your Arduino does not appear as a port option, you may have a clone that requires [drivers for the CH340 chipset](https://sparks.gogo.co.nz/ch340.html).
58+
* If upload fails for an ATMega328P Arduino (e.g. original Nano), try selecting/unselecting “Old Bootloader” in the processor menu.

0 commit comments

Comments
 (0)