BLE Pool Pressure Monitor


Created a project doc

PCB Fabrication Readiness Review

View Document

PCB Fabrication Readiness Review Decision
Do not release this PCB for prototype fabrication yet. The board is valid and the routing engine reports no fundamental routing-feasibility anomaly, but it remains essentially unrouted and two placement issues should be corrected before routing begins.
Current board state
  • Board: 28 × 90 mm, 1.30 mm thick, four copper layers.
  • Layer intent: Top signal/components, L2 solid GND, L3 power plane, Bottom signal/components.
  • Components: 96; nets: 64.
  • Placement bounding box: 26.85 × 84 mm, leaving narrow edge margins.
  • Raw footprint fill: 47.9% (medium).
  • Routing-aware occupancy with 1 mm escape allowance: 104.7% (congested/overflow estimate).
  • Unrouted connections: 174 airwires.
  • Existing vias: 4; dangling traces: 0.
Review complete: the four-layer board is routable in principle, but not ready for fabrication. Two blockers must be fixed first: L1 is about 29 mm from U2’s switching pins, and the BLE antenna needs edge placement plus an all-layer keepout; 174 airwires remain.
The complete findings and routing sequence are in PCB Fabrication Readiness Review.
Next steps
  • Re-place U2/L1 and tighten the U3 boost loop.
  • Correct U1 antenna placement and RF keepout.
  • Route power first, then analog and logic.
  • Reach zero airwires and pass final DRC before ordering.
Execution is paused because no ACUs are currently available.
No PCB changes could be applied because no ACUs are currently available.
Based on the latest verified board state, both placement and routing are needed:
  • Move L1 next to U2 to minimize the 3.3 V buck-boost switching loop.
  • Tighten the U3 boost-converter power loop.
  • Move U1 so its BLE antenna faces or overhangs the board edge.
  • Add an all-layer antenna keepout clear of copper, cells, and enclosure hardware.
  • Reflow nearby parts after these moves.
  • Route power, analog sensing, and logic; 174 airwires remain.
  • Finish with zero-airwire, DRC, antenna, and enclosure-fit checks.
The board should not be sent for prototype fabrication until those steps are completed and verified.
Refine placement first
Address power and antenna
Prepare routing plan
Check manufacturing readiness

Waiting for input


Firmware Getting Started
Toolchain
Use Nordic nRF Connect SDK / Zephyr, west, CMake, and a J-Link-compatible SWD probe for the nRF52840 in U1.
Pin Mapping

Table


GPIONet / functionNotes
P0.02 / AIN0CELL_B_TEMP_ADCScaled Cell B NTC voltage; valid while USB enables TEMP_MON_SUPPLY
P0.03 / AIN1CELL_A_TEMP_ADCScaled Cell A NTC voltage; valid while USB enables TEMP_MON_SUPPLY
P0.04 / AIN2PRESSURE_ADCPressure SAADC input
P0.05 / AIN3BATTERY_ADC1S pack voltage through 3.3 MΩ / 1 MΩ divider
P0.06SENSOR_ENActive-high 5 V sensor boost enable
P0.07CHARGE_STATUS_NU6 CHG open-drain; low while charging
P0.08UnusedFormer Hall input; intentionally no-connect
P0.12CHARGE_ENABLE_NActive low; drive high to disable charging; R34 defaults low
P0.13/P0.14/P0.15LED_RED_N / LED_GREEN_N / LED_BLUE_NActive-low PWM cathode drives for the remote common-anode RGB button LED
P0.16BUZZER_PWMPiezo tone
P0.17/P0.19/P0.20/P0.21SPI flashCS/SCK/MOSI/MISO
P0.18RESET_NReset/SWD
P1.09USB_POWER_GOOD_NU6 PGOOD open-drain; low with valid USB input
P1.08SW_IN_MCUActive-low remote momentary switch; low-power GPIO SENSE wake capable
Charging Hardware Behavior
  • U6 is autonomous and powers SYS_PWR while charging. USB input current is capped at 500 mA total; system load has priority over battery current.
  • T1 and T2 are independently interpreted by U8 hot/cold comparators. Any Cell A or Cell B hot, cold, open, or short condition pulls U6 TS below its hot threshold. Firmware cannot override an unsafe TS condition.
  • Q4/Q5 enable the NTC/comparator network only with USB_5V_FUSED present. CELL_A_TEMP_ADC and CELL_B_TEMP_ADC therefore read valid temperatures during charging/USB service and read near zero when USB is absent.
  • CHARGE_ENABLE_N is active low. Configure P0.12 high-impedance during the earliest boot stage so R34 enables normal charging; later configure output-low to allow charge or output-high to disable.
  • CHARGE_STATUS_N low means U6 reports charging. It may remain low during a TS suspension, so use pack-voltage trend, USB_POWER_GOOD_N, elapsed time, and service diagnostics rather than assuming low always means current is flowing.
  • USB_POWER_GOOD_N low means the 5 V input is valid.
Firmware Charge Safety Supervisor
  1. On USB_POWER_GOOD_N falling low, start or resume a cumulative charge-session timer and log connection time, battery voltage and enclosure operating context.
  2. Sample BATTERY_ADC and both temperature ADC channels periodically while plugged in. The battery divider ratio is (3.3M + 1M) / 1M = 4.3; 4.2 V pack gives about 0.977 V at the ADC node.
  3. For each temperature channel, the ADC scale is 330k / (1M + 330k) = 0.24812. Estimate x = Vtemp_adc / (Vpack × 0.24812) and Rntc = 10k × x / (1 - x), then use the Semitec 103AT-2 table/Beta conversion. Nominal ADC/Vpack ratios are about 0.1816 at 0°C, 0.1241 at 25°C, and 0.0729 at 50°C; open approaches 0.2481 and short approaches 0.
  4. Keep charge enabled only while both measured temperatures are plausible, the hardware reports valid operation, battery voltage is plausible, and cumulative session time is below 24 hours.
  5. Drive CHARGE_ENABLE_N high and record a fault if either temperature channel is implausible/out of range, the session exceeds 24 hours, pack voltage exceeds the firmware high limit, voltage fails to rise for a defined diagnostic interval, repeated attach/detach cycling appears abnormal, or enclosure diagnostics indicate unsafe heat.
  6. Never use firmware to re-enable charging while hardware TS is faulted. Require USB removal or an explicit safe-state recovery policy after a firmware timeout.
  7. Log both cell temperatures, channel-open/short diagnostics, charge start, charge complete, timeout, power-good loss, low-battery shutdown, and protection-recovery events.
The 24-hour firmware timeout backs up the disabled internal timer but is not a substitute for hardware TS, thermal regulation, overvoltage regulation, or U7 pack protection.
Battery State and Shutdown
  • Use loaded and rested voltage plus temperature/history; voltage-only state-of-charge for Li-ion is approximate.
  • Begin low-battery warnings around 3.2 V under light load and orderly shutdown near 3.0 V. Disable U3, LED animations, buzzer and flash writes before shutdown.
  • BQ29700 hardware UVP at 2.8 V is emergency protection and should not be reached in normal firmware operation.
  • On protection cutoff/recovery, RAM and clocks are lost; ensure records and calibration metadata are transaction-safe.
Startup Sequence
  1. Set RGB off, SENSOR_EN low and buzzer low.
  2. Read reset reason, USB_POWER_GOOD_N, CHARGE_STATUS_N, BATTERY_ADC and SW_IN_MCU. If USB is present, allow the NTC network to settle and sample both cell-temperature ADC channels before permitting an extended charge session.
  3. Configure CHARGE_ENABLE_N according to persisted charge-fault state; default to enabled only when no timeout/fault is stored.
  4. Initialize RTC, SAADC, SPI flash, PWM, BLE and watchdog.
  5. Validate baseline/log metadata and enter low-power operation.
Remote Illuminated-Button UI
  • Sample pressure every 15 minutes; power the transducer only for measurement.
  • Green below +10%, yellow +10% to =+20% of baseline.
  • One one-second breathing pulse every 20 seconds; periodic buzzer only in red.
  • J8 pinout is 1 SW_IN, 2 GND/SW_RETURN, 3 LED_R, 4 LED_G, 5 LED_B, 6 LED_COMMON. The switch is normally open and closes to ground; LED_COMMON is 3V3 and the three colors are active-low.
  • Configure P1.08 with input buffer enabled, no internal pull, and low-level SENSE wake. The external R10 100 kOhm pull-up defines idle high; R51/C11 provide cable isolation and filtering. After wake, require 20-30 ms of stable low before accepting a press, 20-30 ms stable high before release, and a 150 ms refractory interval after a completed gesture. Clear the latched GPIO event before returning to System OFF.
  • Single press: wake, take a fresh pressure measurement, show one breathing status pulse, update the BLE characteristic set, and advertise the updated state.
  • Double press: two accepted presses whose falling edges are no more than 500 ms apart mute only the audible red alarm for 24 hours. Red visual indication and logging continue; automatically re-arm after 24 hours or after pressure falls below alarm hysteresis.
  • Hold 3 s: display yellow breathing/countdown while held. On release after 3 s, take several readings with pump running; accept only a stable, plausible average, save baseline plus timestamp, then show green confirmation. Reject unstable/out-of-range calibration with a red error pattern.
  • Hold 10 s: enter reset-request state, but do not erase. Require release and one additional accepted press within 5 s before clearing baseline, history and settings; timeout cancels safely.
  • Use nRF PWM hardware on P0.13/P0.14/P0.15. Initialize all three outputs high before enabling PWM. A triangular 0-to-peak-to-0 sequence over approximately 1 s preserves the 2.5% long-term peak-current factor at one pulse per 20 s. Yellow drives red and green together. Standard drive is suitable near 0.5 mA; select high-drive-low output configuration where needed for the approximately 1.2-1.7 mA red channel while preserving active-high/off state.
BLE Additions
Expose USB present, charging status, charger-timeout fault, pack voltage, estimated state of charge, low-battery state, and last charge-session timestamps. Do not expose or imply USB data functionality.
  • Toolchain

  • Pin Mapping

  • Charging Hardware Behavior

  • Firmware Charge Safety Supervisor

  • Battery State and Shutdown

  • Startup Sequence

  • Remote Illuminated-Button UI

  • BLE Additions