gabriel stacey-chartrand

Week 08: electronics production

Designing a wearable pomodoro timer

For this week's electronics production assignment, I wanted to design and mill a PCB that would be meaningful for my final project: a wearable pomodoro timer. The idea is a small watch-sized device that uses haptic and visual feedback to mark time intervals and be used as a focus timer.

The components I knew I wanted from the start were four 5050 NeoPixels (visual feedback to show time remaining), a 10mm flat 3V vibration motor (haptic buzz at the end of an interval), and a tactile button to start and stop the timer. The first version of the design used a CR2032 coin cell for power and an ATtiny45 microcontroller. Both were swapped out later as the design evolved.

I started with a larger board to get the components and schematic right before committing to the tight constraints of a watch form factor.

initial schematic for the pomodoro timer (using a CR2032)
running the ERC (electrical rules check)
ratsnest showing unconnected nets before routing
first PCB layout
second PCB layout iteration
DRC (design rules check) on v2
importing the traces into Illustrator
refining the traces in Illustrator
final traces of the large pomodoro timer board in Illustrator

The CR2032 turned out to be a poor fit for this circuit. It's rated 3V at around 225 mAh, but four NeoPixels at full brightness can draw up to 240 mA on their own. The cell sags immediately and the usable runtime would be measured in minutes rather than hours. I switched to a 3.7V 90 mAh LiPo, which gives roughly ten times the usable capacity in this circuit and also drives the motor a little harder at 3.7V than it would at 3V. To keep the design simple for a weekly assignment I deliberately did not include an onboard charging circuit. The LiPo unplugs from the JST-PH connector and is charged externally.

adding LiPo battery circuit to the schematic instead of the CR2032

KiCad project file of the first "larger" pomodoro timer test board

Watch-sized pomodoro board

Once the schematic was stable, I decided to redesign the board in a watch form factor. The idea was to have different layers of components embedded into a 3D print, all connecting back to the main board at the bottom of the watch body by running copper wire down "via" channels in the 3D print. Above the main board, layers of the 3D printed watch body would contain: a vibrating motor, NeoPixels, and a button (with a 10k pull-up resistor) or pressure sensor.

Wiring details that aren't obvious from the schematic

The four NeoPixels chain through their DIN/DOUT pins. The data line from PA6 connects only to the first pixel's DIN, and each pixel reads the first 24 bits of colour data, sets its own colour, then forwards the rest downstream via DOUT. VCC and GND are wired to all four pixels in parallel rather than chained.

Final bill of materials

Qty Component Value / spec
1MicrocontrollerATtiny412 (SOIC-8)
4NeoPixel5050
1Vibration motor10 mm flat, 3 V
1LiPo battery3.7 V, 90 mAh
1Battery connectorJST-PH 2-pin
1Tactile buttonSMD
1Capacitor (bulk)100 µF electrolytic
1Capacitor (decoupling)100 nF ceramic
1Resistor (button pull-up)10 kΩ
1Resistor (UPDI series)4.7 kΩ
1Programming header3-pin THT (VCC / UPDI / GND)
v1 schematic adapted to watch component set
ERC check on v1
ratsnest for v1 before routing
v1 PCB layout in KiCad

Adding the JST connector

I needed to add a JST connector for the LiPo battery. I looked up the datasheet to get the correct footprint dimensions and hole sizes, then made adjustments in KiCad.

JST connector datasheet for footprint reference
3D preview on the watch PCB using pins for the other layers of the watch
JST connector added to the schematic
restarting with a clean global delete to re-route
adding hole pads for the other layers of the watch (instead of pins)
adjusting JST hole size - before
adjusting JST hole size - after
v1 final PCB layout in KiCad
v1 3D preview in KiCad
v1 PCB - setting the pads in Illustrator
v1 PCB traces refined in Illustrator

KiCad project file of v1 of the watch pomodoro timer

Version 2: refining the design

I made a second pass at the PCB design to fix routing issues, better position the battery connector, and tighten the overall layout for the milling machine constraints (minimum trace width 0.3mm and clearance of 0.4mm).

I also switched the microcontroller from the ATtiny45 to the ATtiny412. The reason was the programming protocol: the 412 is part of Microchip's tinyAVR 1-series and uses UPDI, a single-wire programming interface. That means the programming header on the board only needs three pads (VCC, UPDI, GND) instead of the six required by ISP on the ATtiny45 family.

ATtiny412 pinout I used

ATtiny 412 pinout datasheet for reference
checking battery placement
v2 initial PCB routing
v2 3D preview - view 01
v2 3D preview - view 02
catching a forgotten ground connection
adjusting M2.5 mounting hole size to 2.75mm for a bit more clearance
neopixel layer positioning for the watch face
measuring components for designing the layers of the watch body

Adjusting JST pads and exporting for milling

Before milling I needed to fix the JST pad footprint and export the traces, holes, and edge cuts as separate PNGs through the MODs project workflow.

JST pads before adjustment
JST pads after adjustment - made larger for ease of soldering
traces layer exported to MODs project
holes layer exported to MODs project
edge cut layer exported to MODs project
PNG export settings at 1000 DPI for milling

Milling v2

Using the Roland SRM-20 with the MODs project workflow. Settings: speed 2 mm/s, traces at 1/64" bit, outline and holes at 1/32" bit, origin at 0,0,0. The trace layer exports as white on black (white = keep, black = cut away), negative plot.

milling v2 on the Roland SRM-20
v2 traces
milling in progress
completed milling - v2
v2 milled result
component layout reference for soldering

Programming the ATtiny412 happens through that 3-pin UPDI header on the board. UPDI is a single-wire interface, so the programmer's TX and RX both share the same UPDI line, and the 4.7 kΩ series resistor on the board protects PA0 from the two lines fighting each other. The header pinout is VCC / UPDI / GND, with pin 1 marked on the silkscreen so the programmer always plugs in the right way around. Before milling the watch board I soldered up a small UPDI programmer board to use with it. It was good practice on a simpler board.

soldering practice on the UPDI programming board
pad lift on v2 - the first (of many) ruined boards

Designing the watch case

In parallel with refining the PCB, I modelled a 3D printed watch case with lugs. The goal is to have a fully integrated device where the PCB sits flush inside the printed shell.

modelling the watch lugs - sketch
modelling the watch lugs - cutting away with extrude
watch case design render - view 01
watch case design render - view 02

3D printing and testing

I printed the v2 case and ran some illumination tests to see how light would diffuse through the case material.

neopixel illumination test through printed case - view 01
neopixel illumination test through printed case - view 02
slice of the neopixel layer position inside the case
v2 printed case - view 01
v2 printed case - view 02
v2 PCB and LiPo fit test inside the printed case

Version 2: final design documentation

v2 final board design in Illustrator
v2 final PCB layout in KiCad

KiCad project file of v2 of the watch pomodoro timer

Version 3: making space for the battery

I decided to redesign the board once again. This time, I wanted to move the bulky electrolytic capacitor out of the way to make more room for sliding the LiPo into the watch case. I also repositioned the JST connector for the LiPo.

In order to make even more space, I also dropped one of the mounting holes. One would be enough, since the board fits snuggly into the watch housing.

v3 final board design in Illustrator
v3 final PCB layout in KiCad
v3 3D view in KiCad

Version 3 fit test

After updating updating the design, I milled the v3 PCB and ran another fit test. It proved to be a bit too tight with the JST connector placement.

v3 PCB fit test - view 01
v3 PCB fit test - view 02

KiCad project file of v3 of the watch pomodoro timer

Version 4: making even more space

For the final version of my board, I reoriented the JST connector once again by rotating it 90 degrees and running the traces again. This time, there was enough space to slide the battery into the watch housing as to not put any strain on the connector.

v4 final board design in Illustrator
v4 final PCB layout in KiCad
v4 3D view in KiCad

KiCad project file of v4 of the watch pomodoro timer

Production issues on v4

The first pad lift

First came a pad lift issue, from applying too much heat. My attempt to fix it with a copper wire was unsuccesful.

pad lift on v4 - first occurrence
attempting to fix the pad lift with a copper wire

Milling depth inconsistencies

Then came a strange milling depth inconsistency. It was probably due to an issue when setting the z-height on the Roland, although I didn't notice making a mistake in the procedure.

milling depth inconsistency - view 01
milling depth inconsistency - view 02

The second pad lift...

This one was due to my attempt to remove the plastic sleeves from the pins, in order to be able to have more depth (or length) on the connectors.

pad lift on v4 - second occurrence

The third pad lift.....

It was succesfully fixed by using soldering wick to connect the pad to ground (under the electrolytic capacitor).

fixed with soldering wick instead

Final board

final v4 board - view 01
final v4 board - view 02

I had incorrectly believed that a 4.9k resitor could be placed between the UPDI programming connector pin and the pin of the ATtiny412. I had to swap it out for a 0ohm resistor.

swapping a resistor on the final board - before
swapping a resistor on the final board - after
Group page for week 08
Country roads...