A Watch for Nerds: the Binary Watch
by NewsonsElectronics in Circuits > Arduino
44 Views, 0 Favorites, 0 Comments
A Watch for Nerds: the Binary Watch
Have you ever wanted to impress your friends? Now you can build your very own binary watch and read the time in binary code.
Link to the full build video : https://youtu.be/bifUcp3U8ec
Supplies
Here is a list of the main components for this PCB binary watch build.
Main Components
- 1 × ATMEGA328P-AU — U1
- 1 × DS3231MZ RTC — U2
- 1 × CH340C USB-to-Serial IC — U3
- 1 × TP4056-42-ESOP8 LiPo Charger IC — U4
- 1 × CSTCE16M0V53-R0 16 MHz Resonator — Y1
LEDs
- 18 × WS2812B-V6 Addressable RGB LEDs — D1–D18
- 1 × PMEG4010BEA Schottky Diode — D19
- 1 × KT-0805G Green LED — D20
- 1 × KT-0805R Red LED — D21
Resistors
- 1 × 1.2 kΩ Resistor — BAT1
- 4 × 4.7 kΩ Resistors — R2–R5
- 1 × 10 kΩ Resistor — R6
- 2 × 1 kΩ Resistors — R7–R8
- 1 × 2.7 kΩ Resistor — R9
Capacitors
- 4 × 0.1 µF (100 nF) Capacitors — C1–C4
Connectors & Controls
- 1 × USB-C 16-Pin Receptacle (USB 2.0) — J2
- 2 × EVQPUJ02K Tactile Push Buttons — SW1–SW2
- 1 × LiPo Battery — BT1
PCB Board Manufacturing
I had the PCB manufactured by JLCPCB, a company I have used both in Canada and China. Their website is very user-friendly, and they offer a wide range of services, including PCB manufacturing, SMT assembly, and PCB stencils.
I have uploaded all of the Gerber files needed to manufacture the PCB. I have also included the BOM (Bill of Materials) and component placement/position files if you would like JLCPCB to assemble the components for you. JLCPCB allows you to upload the BOM and placement files directly when ordering PCB assembly.
JLCPCB Website:
Downloads
PCB Assembly
First, follow the schematic to determine the correct component placements. I used liquid solder flux on the pads first, then carefully placed each component in the correct location using tweezers.
Note that the microchips have a white dot on the silkscreen indicating the location of Pin 1. Be sure to orient the chips correctly before soldering.
Once all the components were correctly positioned, I used a hot-air rework gun to heat the solder and solder the components into place.
Uploading the Code
Once all the components are soldered onto the board, we can program the watch using the Arduino IDE.
Important: Because I am repurposing the USB-C port for multiple functions, there is only one correct way to connect the USB-C cable to the board for programming.
First, make sure the CH340C USB-to-serial drivers are installed on your computer. You can download the official Windows driver here: CH340/CH341 Windows Driver — WCH
Once the drivers are installed, connect the USB-C cable in the correct orientation. Windows should play its connection sound, indicating that it has successfully detected the CH340C USB-to-serial (TTL) chip.
You can then open the Arduino IDE, select the appropriate board and COM port, and upload the following code to the watch.
Note!: Before uploading the code, install the following libraries through the Arduino IDE Library Manager:
- RTClib — by Adafruit
- Adafruit NeoPixel — by Adafruit
How the Watch Works
The watch is controlled using the two push buttons on the right side.
Turning the Watch On and Off
The top button turns the watch on. To put the watch into sleep mode, press and hold the top button for approximately 1 second.
Setting the Time
To set the time, press and hold the bottom button for 1 second. The watch will begin flashing the row that is currently being edited:
- 1st row: Seconds
- 2nd row: Minutes
- 3rd row: Hours
Press the top button to increment the value for the selected row.
Once the correct time has been set, press and hold the bottom button for 1 second to save the time and return to normal watch mode.
Adjusting LED Brightness
While in normal watch mode, quickly press both buttons at the same time. Each press will increase the LED brightness. Once the maximum brightness is reached, the setting will loop back around to the dimmest level.
Low Battery Indicator
Each time the watch enters sleep mode, it checks the voltage of the LiPo battery.
If the battery voltage is detected to be too low, a blue LED in the top-left corner of the watch will turn on to indicate that the battery needs to be recharged.
How to Read the Time?
How to Read the Time
Each row of the watch represents one part of the time: seconds, minutes, and hours. Each row contains 6 LEDs, with each LED representing a binary value. Since the values are 1, 2, 4, 8, 16, and 32, the maximum value a row can display is 63.
To determine the number displayed in a row, add together the values of all the illuminated LEDs.
Example: If the LEDs showing 1 + 4 + 8 = 13, that row represents 13.
So, for example, if the watch displays 13 on the first row, 42 on the second row, and 18 on the third row, the time is 18:42:13.
Hope you enjoyed this project! I’m planning to develop a revised version of this clock design. It will utilise the internal 8 MHz oscillator and power MOSFETs to further cut quiescent current, extending battery life. If you have any ideas or feedback, feel free to send me a message.