README.md
# nRF52810 OLED smart watch
A compact two-layer tscircuit smart-watch prototype derived from the
[`tscircuit/nrf52810`](https://github.com/tscircuit/nrf52810) BLE tracker. It
combines the nRF52810 radio core with a folded-over EastRising 0.96-inch OLED,
USB-C power, protected 1-cell LiPo charging, and two side buttons.


## Hardware
- 34 mm x 34 mm, 1.0 mm thick, two-layer PCB with 7 mm rounded corners and
0.3 mm through-via drills with 0.6 mm pads
- Single-sided assembly: every board-mounted component is on the top side,
including the low-profile parts beneath the folded-over OLED
- Nordic `NRF52810-QFAA-R` Bluetooth Low Energy SoC
- EastRising `ER-OLED0.96-1.3W`, 128 x 64 white SSD1306 OLED
- EastRising `ER-CON30HT-1`, 30-position 0.5 mm top-contact FPC connector
- Two active-low, side-actuated user buttons
- HRO `TYPE-C-31-M-12` USB-C receptacle for 5 V power (USB data is not wired)
- Microchip `MCP73831` single-cell LiPo charger, set to approximately 100 mA
- Top-mounted JST-GH `SM02B-GHS-TB` protected 1S LiPo connector
- Schottky power selection and an `MCP1700-3302` 3.3 V regulator
- 32 MHz HFXO; the compact build uses the nRF52810 internal LFRC for LFCLK
- Walsin `RFANT3216120A5T` 2.4 GHz chip antenna and matching network
- JST `SM05B-SRSS-TB(LF)(SN)` 5-pin side-entry JST-SH connector for SWD
programming and rail reference
The source is [`index.circuit.tsx`](./index.circuit.tsx). Imported component
models are in [`imports/`](./imports/), and [`BOM.csv`](./BOM.csv) lists the
design parts.
## OLED assembly and interface
The selected `.3W` display is a bare, white, top-contact FPC part without a pin
header. `J1` is centered horizontally near the top edge, and the 26.70 x 19.26
x 1.45 mm panel folds back toward the board center over the populated PCB
instead of requiring a blank PCB extension. Power and OLED support passives
share the top assembly side beneath the display, while the LiPo pouch cell
belongs below the board. The footprint implements the manufacturer's 0.5
mm-pitch connector land pattern and marks the panel and 21.744 x 10.864 mm
active-area outlines. Its 3D preview uses the dimensionally matched
`AFC07-S30ECA-00` as a visual connector proxy; the PCB copper remains the
EastRising land pattern.
| Function | OLED / connector pins | nRF52810 or rail |
| --------------------------- | ---------------------------- | ------------------------ |
| I2C SDA | 19 `SDA_IN` + 20 `SDA_OUT` | `P0.00` |
| I2C SCL | 18 `SCL` | `P0.01` |
| Reset | 14 `RES` | `P0.27`, 10 kohm pull-up |
| Logic and charge-pump input | 6 `OLED_VBAT`, 9 `VDD` | `V3V3` |
| I2C address select | 15 `SA0` | Ground (`0x3C`) |
| I2C mode straps | 10 `BS0`, 11 `BS1`, 12 `BS2` | Ground, `V3V3`, Ground |
`R_I2C_SCL` and `R_I2C_SDA` are 4.7 kohm pull-ups. `C15`-`C20` and
`R_OLED_IREF` implement the SSD1306 internal-charge-pump reference circuit:
1 uF flying capacitors, 1 uF input decoupling, 2.2 uF `VCOMH`, 4.7 uF `VCC`,
and 390 kohm `IREF`. Parallel/data-bus pins not used in I2C mode are strapped
as shown by EastRising's reference design.
Manufacturer references:
- [ER-OLED0.96-1.3W product page](https://www.buydisplay.com/128x64-oled-i2c-0-96-display-white-color-connector-fpc-ssd1306)
- [ER-OLED0.96-1 series datasheet](https://www.buydisplay.com/download/manual/ER-OLED0.96-1_Series_Datasheet.pdf)
- [ER-OLED0.96 series interfacing reference](https://www.buydisplay.com/download/interfacing/ER-OLED0.96_Series_Interfacing.pdf)
- [ER-CON30HT-1 connector drawing](https://www.buydisplay.com/download/connector/ER-CON30HT-1.pdf)
## User controls
| Control | nRF52810 pin | Electrical behavior |
| ----------- | ------------ | ------------------------------------------- |
| `SW_UP` | `P0.03` | Active-low; enable the MCU internal pull-up |
| `SW_SELECT` | `P0.04` | Active-low; enable the MCU internal pull-up |
The switch footprint is a generic 3.5 x 2.8 mm side-actuated pattern. Confirm
the pad geometry against the chosen switch before manufacturing.
## SWD programming connector
`J4` is a side-entry 1.0 mm-pitch JST-SH connector at the board edge. It
provides the complete programming interface through a custom cable from a
J-Link, Nordic DK, or another 3.3 V-compatible SWD probe. There are no separate
programming test pads; reset, clock, data, target reference, and ground are all
carried by this connector.
| J4 pin | Signal | Connection |
| ------ | ------- | ------------------------------ |
| 1 | `RESET` | nRF52810 `nRESET` |
| 2 | `SWCLK` | nRF52810 `SWDCLK` |
| 3 | `SWDIO` | nRF52810 `SWDIO` |
| 4 | `VREF` | Board `V3V3` reference/sense |
| 5 | `GND` | Ground |
This is a project-specific cable pinout rather than the standard 10-pin Arm
debug connector. Treat `VREF` as the probe's target-voltage reference unless
the selected probe and power setup explicitly support powering the target.
## USB-C and rechargeable power
`J2` is a power-only USB-C sink. `CC1` and `CC2` each have a 5.1 kohm pull-down;
the USB 2 data and SBU pins are intentionally unconnected. USB VBUS feeds both
the charger and the system through `D_USB`. The protected LiPo at `J3` feeds
`BAT_RAW` and the system through `D_BAT`, so USB powers the watch while the
charger works on the battery. This is a simple Schottky-OR power path, not a
full ideal-diode power-path controller.
`R_CHG_PROG = 10 kohm` sets the `MCP73831` charge current to approximately
100 mA. Use only a protected 3.7 V nominal (4.2 V charge) single-cell LiPo that
is rated for that charge current. `J3` pin 1 is `BAT+` and pin 2 is ground;
verify the lead polarity of the chosen battery before plugging it in because
prewired battery connectors are not universally polarized the same way.
The `MCP1700-3302` generates `V3V3` from the selected raw source. On battery,
the Schottky drop plus LDO dropout means the rail will fall below 3.3 V late in
the discharge curve. Characterize the chosen cell, OLED brownout behavior, and
the desired low-battery cutoff before treating this as a production design.
The charger's open-drain `STAT` signal is available on `P0.28`; enable the MCU
pull-up to read low while charging.
## Build
Install Bun, then run:
```sh
bun install
bun run typecheck
bun run build -- --all-images
```
Generated circuit data and PCB, schematic, and 3D previews are written to
`dist/index/`.
## Firmware notes
- Initialize the display as SSD1306 I2C address `0x3C`.
- Drive `P0.27` low to reset the OLED, then release it high.
- A monochrome 128 x 64 framebuffer consumes 1 KiB of RAM.
- Configure `P0.03` and `P0.04` as inputs with pull-ups and active-low sense.
- Configure `P0.28` with a pull-up to read the charger `STAT` output.
- The first image must be programmed through SWD using a J-Link or Nordic DK.
## RF and production warning
The display stops at the upper boundary of the right-edge antenna keep-clear;
do not extend its metal backing into that region. Keep enclosure hardware and
the user's body away from the antenna. The feed and matching values remain a
starting point; tune the complete assembled product with a VNA and the final
enclosure.
This is a prototype, not production sign-off. Verify connector polarity, the
flex fold, button footprint, charging thermals, battery protection and behavior,
RF tuning, EMC, Bluetooth qualification, mechanical fit, and regional safety
requirements before manufacture or sale.