Skip to the content
PCBKitNew board
2 layers2 × 27.5 mmWatch, the printed circuit board in 3D

A simple, ATtiny402 powered binary wrist watch. Sponsored by PCBWay

Size
2 × 27.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
27
Nets
14
Pads
61
Tracks, vias
160, 13
Pours
1
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
24 May 2023
Updated
29 Aug 2023

Overview

Watch is an open-source printed circuit board by tux2603, from the tux2603/watch repository on GitHub. It is a 2-layer board of 2 × 27.5 mm with 27 parts on 14 nets, routed with 160 tracks and 13 vias.

It is built around the ATTINY402-SSN and BAT-HLD-001-TR. Its parts include 12 diodes, 7 resistors, 2 switches and 1 IC. It belongs with the wearables boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

2

README

README.md

Binary Watch

revision 2.0

A 12 hour wrist watch that displays the current time in BCD using LEDs. The watch is powered by a single CR2032 coin cell and uses an ATtiny402 microcontroller to keep track of time and drive the LEDs. The time can be viewed or set at any time by pressing the two buttons on the face of the watch.

PCB fabrication for this project was sponsered by PCBWay, and I would like to thank them for their support! I was very happy with the quality of the PCBs they sent me, and their staff was very easy to work with.

Assembled PCB

Fully assembled PCB, supplied by PCBWay and hand assembled by me. US penny for scale

Instructions

Viewing the time

To view the time, simply press the VIEW button on the face of the watch. This will automatically wake the microcontroller and display the current time for 10 seconds. After 10 seconds, the LEDs will be turned off and the microcontroller will go back to sleep, conserving battery life.

Setting the time

To set the time, first wake the watch from sleep by pressing the VIEW button. Once the watch is awake, press the SET button. The watch will now be in time setting mode, and the digit that is currently selected will flash once every two seconds. To change the value of the currently selected digit, press the VIEW button. Once the desired value is entered, press the SET button again to select the next digit and repeat until all digits are set. Once all digits are set, the watch will automatically return to view mode and go back to sleep after 10 seconds.

Resetting the watch

To reset the watch, first wake the watch from sleep by pressing the VIEW button. Once the watch is awake, press and hold either button for at least three seconds. The watch will save the currently set time before resetting and will automatically return to view mode after the reset is complete.

Design

Some trickery was needed to drive twelve LEDs and read two push buttons with the limited number of GPIO pins available. The LEDs are arranged in a charlieplexing matrix, allowing all twelve LEDs to be controlled with just four tri-state GPIO pins. The push buttons are then read using a small resistor ladder with a single GPIO pin. Pressing the VIEW button will pull the voltage on the pin to GND, and pressing the SET button will pull the voltage on the pin to 0.5 * Vdd. If no button is pressed, the voltage on the pin is pulled to Vdd. This way, only five GPIO pins are used and PA0 is left to function solely as the UPDI pin, allowing for easy programming of the ATtiny402.

PCB Render

Electronics BOM

DescriptionCountManufacturer Part NumberDigiKey Part NumberSubstitutions
CR2032 coin cell holder1BAT-HLD-001-TRBAT-HLD-001-TRCT-NDSubstitutions are possible, but will require traces to be re-routed
Blue LED12IN-S63BT5B1830-1068-1-NDAny other 0603 LED can be used, but if a different color is used the color will be different
47Ω 1/8W Resistor4ERJ-H3GJ470V10-ERJ-H3GJ470VCT-NDAny 0603, 47Ω resistor with a power rating of 1/8W or higher
4.7kΩ 1/8W Resistor1ERJ-H3GJ472V10-ERJ-H3GJ472VCT-NDAny 0603, 4.7kΩ resistor with a power rating of 1/8W or higher
10kΩ 1/8W Resistor2ERJ-H3GJ103V10-ERJ-H3GJ103VCT-NDAny 0603, 4.7kΩ resistor with a power rating of 1/8W or higher
Momentary switch2EVP-AA202KP13348SCT-NDSubstitutions are possible, but will require traces to be re-routed
ATtiny 402 microcontroller1ATTINY402-SSNRATTINY402-SSNRCT-NDAny ATtiny402. The ATtiny202 should also work, but has less flash and has not been tested.

Mechanical BOM

DescriptionCountSource
Watch Body1CAD file
Watch Back1CAD file
PCB1Gerber files
CR2032 coin cell1Your favorite source for watch batteries
18mm watch band1Your favorite source for watch bands

Assembly

PCB

Unless you're lucky enough to have PCB fabrication facilities in house, you'll need to send the Gerber files to a third-party manufacturer for fabrication. I used DKRed for my initial prototypes, but after releasing v1 PCBWay reached out to me and offered to sponsor PCB fabrication for v2. Since I had selected tolerances to work with all of the major PCB fabrication services, I was more than happy to accept their offer. Having worked with both DKRed's ENIG finish and PCBWay's HASL finish, I would definietly have to say I preffered PCBWay's HASL for hand-soldering. The HASL finish made the soldering process a little bit easier, which when you're hand soldering small SMD components is always appreciated.

The components for the watch were picked to make hand soldering possible with a decent soldering iron and a steady hand, but it should also be possible to use a reflow oven or hot plate to solder the components on the face of the PCB. The battery holder will still likely need to be soldered by hand though, but it's nice and big so it shouldn't be too difficult. For hand soldering, I used the following procedure:

  1. Solder the LEDs and 47Ω resistors to the middle section of the PCB.

    • The resistors go in the spots with the two parallel silk screen lines (1, 3, 5, and 9 in Figure 1). These resistors aren't polarized, so they can be soldered in any orientation.
    • The LEDs go in the spots with the C-shaped silk screen lines around them (2, 4, 6, 7, 8, 10, 11, 12, 13, 14, 15, and 16 in Figure 1). The LEDs are polarized, so make sure to solder them in the correct orientation. If you use the LEDs specified in the BOM, the cathode will be marked with a tiny green dot. This green dot should be facing towards the C-shaped silk screen line. This orientation is also shown in Figure 1.

    LED and resistor placement

    Figure 1: LED and resistor placement

  2. Verify that the resistors and LEDs were placed correctly

    • Apply the positive and negative connections to a 3.3V source to the pads shown in Figure 2 using the table below. If everything is soldered correctly, the corresponding
    LEDPositive padNegative pad
    212
    413
    631
    721
    832
    1041
    1114
    1223
    1342
    1424
    1543
    1634

    LED test pads

    Figure 2: LED test pads

  3. Solder the 4.7kΩ an 10kΩ resistors to the PCB

    • The 4.7kΩ resistor and two 10kΩ resistors go in the remaining spots with the two parallel silk screen lines (1, 2, and 3 in Figure 3). These resistors aren't polarized, so they can be soldered in any orientation.
      • The 4.7kΩ resistor goes in the spot with the two parallel silk screen lines in the upper-left corner of the PCB (1 in Figure 3)
      • The two 10kΩ resistors go in the spots with the two parallel silk screen lines in bottom center of the PCB (2 and 3 in Figure 3)

    remaining resistor placement

    Figure 3: Remaining resistor placement

  4. Solder the buttons to the PCB

    • The buttons go above the silk screen labels reading SW1 and SW2. The buttons aren't polarized, so they can be soldered in either direction
  5. Solder the ATtiny402 to the PCB

    • The ATtiny402 goes in the remaining spot on the front of the PCB with the small dimple or notch in the chip facing the center of the PCB
  6. Solder the battery holder to the PCB

    • Flip the PCB over and solder the battery holder to the four pads on the back

Flashing

Three solder pads, labeled VCC, GND, and UPDI, are supplied on the watch face to allow for simple programming of the ATtiny using a UPDI programmer. Any UPDI programmer should work, but I used an Arduino Uno running jtag2updi. The 4.7k series resistor required for flashing is already included on the PCB, so no external resistor is necessary.

  1. Connect the VCC, GND, and UPDI solder pads to the corresponding pins using jumper wires. These jumper wires can be soldered or clipped on, it doesn't really matter. Note that the pads and traces are very small and fragile, so be careful not to put too much stress on them or they could rip off of the PCB.

    • The VCC pad should be connected to the 5V pin on the Arduino
    • The GND pad should be connected to the GND pin on the Arduino
    • The UPDI pad should be connected to the D6 on the Arduino
  2. Hook the Arduino up to your PC and note what port it is connected to (eg, COM3, /dev/ttyACM0, /dev/ttyUSB0, etc). Set the PORT variable on line four of the Makefile to this value, replacing the default value of /dev/ttyACM0

  3. Run make flash to flash the watch. Alternatively, you can manually run the command avrdude -c jtag2updi -P <YOUR_PORT> -p attiny402 -U flash:w:bin/main.hex -U eeprom:w:bin/eeprom.hex to flash the watch.

  4. The watch should automatically enter calibration mode after flashing. If you don't want to calibrate the watch right now, just hold down the VIEW button for at least three seconds to reset the watch.

Calibration

After flashing the firmware, the watch will automatically enter one-time calibration mode. In this mode the watch will generate a square wave on the CAL solder pad, which can be measured using an oscilloscope. The period of this waveform should be as close to 468.75ms as possible, but it will initially be a good deal off from this value. To calibrate the watch, follow these steps:

  1. Connect the CAL solder pad to the positive terminal of an oscilloscope probe using a jumper wire. Connect the negative terminal of the probe to the GND solder pad.
  2. Measure the period of the generated square wave and compare it to the desired value of 468.75ms.
    • If the measured period is to high, press the VIEW button to decrease the period.
    • If the measured period is to low, press the SET button to increase the period.
  3. Repeat step 2 thirteen times. After the last repetition, the watch will automatically save the calibration value and restart into standard operation mode.

To prevent accidental re-calibration, the watch will only enter calibration mode immediately after flashing by default. If you want to enable entering calibration mode without flashing the watch, write the value 0x01 to EEPROM address 0x05. This will allow the watch to enter calibration mode by holding down the SET button for at least three seconds. To disable this feature again, write the value 0x00 to EEPROM address 0x05.

Customization

The functionality of the watch can be customized by modifying, compiling, and flashing the source code. For simple changes, the following configuration options can be modified in the config.h file:

OptionDescriptionDefault ValueRecommended RangeUnits
BLINK_FREQUENCYThe frequency at which the currently selected digit will blink while in time setting mode10.25 - 2Hz
DEBOUNCE_COUNTThe number of consecutive update cycles that a button state must be stable before it is considered to be pressed505 - 500update cycles
RESET_HOLD_TIMEThe number of seconds that a button must be held before the watch is reset31 - 10s
SLEEP_TIMEOUTThe number of seconds that the watch will remain awake before automatically going back to sleep101 - 60s
UPDATE_FREQUENCYThe frequency at which the LED matrix is updated and input is read from the buttons.48096 - 5000Hz

To compile the code, the avr-gcc tool chain will need to be installed with support for the ATtiny402

License

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. You are free to share, use, and modify this work for any non-commercial reasons as long as you give appropriate credit. The author grants permission for PCB and CAD design files to be sent to third-party manufacturers for fabrication as long as these fabricated parts or assemblies containing these fabricated parts are not later resold for profit.

Parts

27
QtyValueFootprintReferences
12LED_SmallLED_SMD:LED_0603_1608MetricD1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12
447 ΩResistor_SMD:R_0603_1608MetricR1, R2, R3, R4
34.7 kΩResistor_SMD:R_0603_1608MetricR5, R6, R7
2EVP-AA202KPush Button:SW_EVP-AA102K_PANSW1, SW2
2TestPointTestPoint:TestPoint_Pad_D1.0mmTP1, TP4
2TestPointTestPoint:TestPoint_Pad_1.0x1.0mmTP2, TP3
1ATtiny402-SSPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU1
1BAT-HLD-001-TRBattery Holder:BAT_BAT-HLD-001-TRBT1

Questions

How big is the Watch PCB?

It measures 2 × 27.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Watch use?

27 parts, built around the ATTINY402-SSN and BAT-HLD-001-TR. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Watch KiCad files?

From the tux2603/watch repository on GitHub, at the commit this page was made from: the board is pcb/watch.kicad_pcb and its schematic pcb/watch.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Watch design in my own project?

Its repository states no licence, so its author keeps all rights: ask tux2603 before reusing the design.

Similar boards

  • 2 layers65.4 × 62.1 mmOBJEX EHDK v1.0, the printed circuit board in 3D

    OBJEX EHDK v1.0

    salvatoreraccardi/Energy-Harvesting-DevKit

    OBJEX EHDK - Energy harvesting DevKit

    106 parts22
  • 4 layers27 × 94.5 mmSoilmoisture, the printed circuit board in 3D

    Soilmoisture

    fredriknk/SoilSense

    21 partsGPL-3.0
  • 4 layers35 × 35 mmBTZ EndDevice, the printed circuit board in 3D

    BTZ EndDevice

    GoodByte-Hardware/BTZ-EndDevice

    Low-power wireless sensor board based on the nRF54L15 for BLE Mesh, Thread/Matter and Zigbee

    56 partsMIT
  • 2 layers36 × 36 mmCAL4809, the printed circuit board in 3D

    CAL4809

    kentN/CAL4809

    ATmega4809 TimeKeeping Module with MemoryLCD

    31 partsMIT
  • 2 layers16 × 13.8 mmBattery leds, the printed circuit board in 3D

    Battery leds

    unicab369/ESP-MESS

    I am building a Wireless Bridge System that can manage multiple devices using a variety of wireless technologies.

    31 parts
  • 2 layers75.8 × 19.2 mm3S coinCellChargeController, the printed circuit board in 3D

    3S coinCellChargeController

    PocketConcepts/Pocket_PSU

    A variable current & voltage PSU with 3S lipo charging, balancing, and protection circuit using PPS.

    78 parts36
  • 2 layers72 × 47.5 mmPCB avr dx unbricker, the printed circuit board in 3D

    PCB avr dx unbricker

    k-takata/PCB_avr_dx_unbricker

    UPDI High Voltage programmer for AVR Dx/Ex series

    40 parts4