Debut: True Binary Clock With NTP Sync

A accurate binary time displays the time of day American Samoa a sum of binary fractions of a full day, as opposed to a longstanding "multiple clock" that displays sentence as binary-encoded denary digits corresponding to the hours/transactions/seconds. Traditional "binary clocks" are really victimization positional representation system-encoded-decimal-encoded-sexagesimal. What a mess! True binary clocks simplify things immensely.

In a true multiple clock, the best digit tells you is the half day, the second digit is a quarter day, the tertiary digit is an ordinal of a daylight, etc. Information technology can be read to whatever resolution very quickly (with apply of course). The first digit effectively encodes AM versus Prime Minister, the second digit encodes whether IT's archeozoic AM/PM or late AM/PM, and thusly on.

In designing my dependable binary time, I victimised twelve digits of answer, so the day is divided into 2^12=4096 parts (each increment is approximately 20 seconds). Instead of keeping all the digits in a transmission line, the 12 digits were apart into 3 rows of 4 digits. Though the true binary digits are unchanged, this allows the clock to comprise show as 3 binary-encoded hex digits, the maiden note showing 16ths of a Clarence Day (1.5hrs), the second line showing 256ths of day (~5 proceedings), and the third line showing 4096ths of a day (~20seconds).

The clock is synced to NTP (Network Time Protocol) using an ESP8266. The ESP8266 is configured and then that, on inauguration, pressing a button on the clock will send it into settings mode. In settings mode, the clock will create a WiFi network that serves up a webpage that can be used to enter your possess wifi settings, NTP waiter, and timezone. This selective information is stored in the EEPROM of the ESP8266 and is read when the clock starts up in clock mode so that information technology can connect to internet and retrieve the time.

Supplies

  • NodeMCU ESP8266
  • WS2812B LED denude
  • Pushbutton
  • 470 Ohm resistor
  • 10K Ohm resistor
  • 470 uF capacitor
  • Popsicle sticks
  • Marbles
  • Wood (Beaver State other sheet of material) for the case

Step 1: Electrical circuit

In order to have a display, this design uses a RGB led strip arranged in 3 rows. I cut 3 strips of 8 leds from the strip of WS2812B leds and soldered them together. (They are fragile and soldering the small pads can be difficult. I wrapped the soldered ends in electrical tape so as to insulate them from any bending.) Even though I only needed 4 leds per row, I cut out strips of 8 and then that I could have greater spatial arrangement 'tween the lights by only using every new light-emitting diode. These strips were past stuck to a flat base successful of popsicle sticks. In between each row, a double layer of popsicle sticks provides the profile so that the fore face can be stuck against the exclusive of the shell of the clock (visit photograph).

The led strip is powered from the VU and GND of the NodeMCU. VU is major power coming (almost) directly from the USB, soh IT provides 5V to the WS2812B LEDs regular though the ESP8266 whole works at 3.3V. I located a 470 uF capacitor crossways the power for the WS2812B strip to protect the leds. Data for the light-emitting diode strip is connected to the D3 pin of the NodeMCU via the 470 Ohm resistor. Refer to this instructable for more information on how to assure WS2812B leds with the ESP8266. The electrical circuit was soldered onto early-board with whatever male-to-female headers for the NodeMCU.

A pushbutton was likewise attached to D6 of the NodeMCU. This pushbutton can be pressed patc the time is opening up to send back it into settings mode (in which WLAN settings, NTP server, and timezone preferences can be modified). On one closing the pushbutton is connected to D6 and too to GND via a 10K Ohm resistor and on the past end it is connected to power. When the button is unpressed, D6 reads low; when it is ironed, D6 reads high.

Mistreat 2: Software

The software system for the ESP8266 was written victimization Arduino code. The LEDs are handled using the FastLED library and NTP syncing is cooked by the NTPClient depository library. Time is synced aside NTP every hour.

At the start of the frame-up subprogram, the program checks to catch if the clitoris connected to D6 is pressed. If it is, the ESP8266 creates a WiF network (the SSID and password can buoy be changed in the code, default SSID is "TrueBinary" and password is "thepoweroftwo"). Link to this mesh from any device and navigate to 192.168.1.1. The ESP8266 bequeath serve up a web page with forms where you can stimulus your wifi SSID and password, preferred NTP server, and timezone set off from UTC. Later these forms are submitted to the ESP8266, it will save the info to its intrinsical EEPROM storage.

If the button is not pressed, the clock starts up normally, reads the settings from EEPROM, connects to wifi to use NTP, and starts displaying the time.

NOTE: the social function setDisplay(int index) takes the dactyl issue from 0-11 where 0 is the first digit (the half day) and 11 is the hold out (1/4096 of a day) and turns on the corresponding LED using the "leds" set out. This function has to make up filled in according to how you designed the display. My commented out example corresponds to how I soldered the rows in a zig-zag fashion rather than end-to-end and skipped every other LED.

Step 3: Housing

To theater the clock, I used an angle of painted Mrs. Henry Wood I happened to have. On peerless outer expression, I drilled 12 holes in a grid corresponding to the positions of the LEDs. I and so stuck the LEDs to the indoors of the lean against by gluing the raised faces of the popsicle sticks middle the rows to the wood (as shown). To diffuse the flimsy from the LEDs, I cragfast glass wits on top of the holes. I accomplished this by dipping the bottom half of each marble in epoxy resin resin and then placing them in the holes. The NodeMCU and proto-board were screwed into the other inside face of the lean on. The sides were covered using gnomish triangles of wood, attached with Grant Wood glue. Single of the sides has a hole for the micro USB port of the NodeMCU and a cut in the nook for the pushbutton.

Step 4: Done!

Our true binary time is finished! To set it raised, keep the button pressed while plugging it in to put information technology in settings mode so enter the WiFi credentials on its webpage. Once put up, the clock can be plugged in anywhere and will automatically connect to the cyberspace and begin displaying the time in positional representation system.

It takes a spot of practice to read metre in true binary format, just it's a fun exercise and after a while it becomes a quick way to get the time with only a glance!

Glucinium the Original to Ploughshare

Recommendations

  • Anything Goes Repugn 2022

    Anything Goes Contest 2022