astra/iphone-encoder-counter
A CR2450-powered MSP430 FRAM counter combines an always-on dual-channel TMR rotation sensor, pushbutton input, and ST25DV NFC tag with an integrated tuned printed antenna and I²C/GPIO interface.
- Version
- 1.0.3
- License
- unset
- Stars
- 0
DESIGN.md
# Electrical and mechanical design
## Architecture
CR2450 → R0 current-measurement link → 3 V battery rail. U1 MSP430FR2433 stores counts in FRAM. U2 NVE ADT002-10E produces digital SIN/COS quadrature outputs continuously at low current; series 1 kΩ / 100 pF filtering feeds P1.0/P1.1. SW1 feeds active-low P2.4 with external 220 kΩ pull-up and 1 nF filter. J2 exposes GND, VTREF, SBWTDIO and SBWTCK for programming. Do not apply programmer power against an installed cell.
U3 ST25DV04KC-JF6D3 is the NFC Type 5 interface. VDCG stays on the battery rail to power its CMOS GPO. Its I²C VCC is supplied from P2.2 through 470 Ω only during access; SDA/SCL pull-ups use that switched supply. P2.3 drives LPD, P2.0 receives GPO. V_EH and the electrically floating exposed pad are not connected to the battery. Configure only the required RF_WRITE wake event to avoid field/activity wake storms.
Wake sequence: assert LPD high, enable VCC, allow settling, then deassert LPD. Sleep sequence: finish EEPROM programming, assert LPD, disable VCC, put I²C lines into high impedance. Verify supply drop through the MCU output and 470 Ω link during worst-case access. Follow ST AN5733 and the exact KC datasheet.
## Mechanical envelope
Board: 60 × 100 × 1.6 mm, rectangular, two copper layers, one assembly side. Origin is board center; +Y is the antenna end. Rotor axis is (0, −13) mm, or **30 mm from the left edge and 37 mm from the bottom edge**. CR2450 center is (0, −34) mm. SW1 center is (−15, −12) mm. No mounting holes: case retention must avoid all copper and component bodies. Allow battery insertion/removal access and holder height in the case.
Use a diametrically magnetized rotor magnet centered above U2, producing a rotating in-plane field in the ADT002's specified 3–20 mT range. Choose magnet size and air gap experimentally. An axially magnetized disk spinning about its own symmetry axis will not provide the required changing direction. Mounting magnets and phone magnets can bias the sensor; test the complete assembly through a full revolution in both directions. Direction labeling must be calibrated with the actual magnet orientation.
The 60 × 100 mm envelope and antenna location are provisional for iPhone 18. Camera clearance, case dimensions and the phone's NFC coupling location must be checked on the actual phone before committing the case tooling. No verified model-specific mechanical drawing is implied.
## NFC antenna and phone interface
L1 is a seven-turn printed top-copper spiral, nominal 0.25 mm trace/space and about 34 × 26 mm outer envelope. Its inner terminal crosses out using the lower copper layer. No ground plane is placed beneath the antenna. C9 starts at 15 pF ±1% (C441742), with approximately 3 µH as an initial inductance target. The spiral screening estimate is about 3.0 µH; neither effective RF inductance nor final resonance is measured. See ANTENNA.md and validation/antenna-audit.json.
Tune near 13.56 MHz with the final phone, case and any NFC ferrite backing installed. Ferrite may be necessary against the phone's metal; it is an external mechanical item and has not been specified or qualified. Coupling to the same phone while attached is an acceptance test, not an established result. Support iOS Core NFC ISO15693 requests; generic background NDEF reads do not by themselves guarantee a fresh live counter snapshot. See FIRMWARE.md for the proposed protocol.
## Four-year energy target
Four years at 7.2 µA average uses approximately 252.5 mAh. The CR2450's nominal 620 mAh is not all assumed usable: this budget allocates **310 mAh usable above a 2.5 V cutoff**, an assumption requiring cell/discharge testing.
| Contribution | Allocated average µA |
|---|---:|
| ADT002 sensor at 3–3.6 V maximum | 4.6 |
| MCU idle | 1.5 |
| Other leakage | 0.5 |
| Rotation processing | 0.3 |
| NFC updates | 0.1 |
| Button presses/held time | 0.2 |
| Total | 7.2 |
MCU, activity and leakage values are engineering allocations, not guaranteed system maxima. Characterize temperature, self-discharge, cell sag, frequent scans and rotation energy. Button usage assumption: at most 500 presses/day and 10 minutes/day held. That is about 730,500 presses in four years against the switch's 1,000,000-cycle rating. R7 supplies at least 11.36 µA at 2.5 V, above the switch's 10 µA minimum rating. A continuously held button adds roughly 14 µA at 3 V and invalidates the normal lifetime budget.
Store each accepted change in the FRAM journal; write NFC EEPROM only for requested snapshots. Stop counting conservatively below 2.5 V since the sensor requires at least 2.4 V. Persist and report low-battery/gap status. Final firmware must implement this behavior.
## Primary references
- [NVE ADT002](https://www.nve.com/Downloads/ADT002.pdf)
- [TI MSP430FR2433](https://www.ti.com/lit/ds/symlink/msp430fr2433.pdf)
- [ST25DV04KC](https://www.st.com/resource/en/datasheet/st25dv04kc.pdf)
- [ST AN5733 low-power interface](https://www.st.com/resource/en/application_note/an5733-using-st25dvi2c-series-for-ultralow-power-applications-stmicroelectronics.pdf)
- [ALPS SKRPANE010](https://tech.alpsalpine.com/e/products/detail/SKRPANE010/)
- [Energizer CR2450](https://data.energizer.com/pdfs/cr2450.pdf)