Skip to the content
2 layers64 × 45 mmFinal external pcb, the printed circuit board in 3D

Final external pcb

petriiar2/Stress_device

Description of a device for measuring patient's stress and pain at a dentist's appointment

Size
64 × 45 mm
Copper layers
2
Thickness
1.6 mm
Parts
19
Nets
29
Pads
101
Tracks, vias
157, 4
Pours
1
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
17 Mar 2026
Updated
17 Mar 2026

Overview

Final external pcb is an open-source printed circuit board by petriiar2, from the petriiar2/Stress_device repository on GitHub. It is a 2-layer board of 64 × 45 mm with 19 parts on 29 nets, routed with 157 tracks and 4 vias.

Its parts include 9 connectors, 4 capacitors, 4 resistors and 2 ICs. It belongs with the nRF52 and nRF5x boards of this library.

README

README.md

Physiological Monitoring System - Hardware Design & Sensor Integration

PCC1 Project | KTH Royal Institute of Technology | MSc Medical Engineering | Stockholm, 2026
This repository covers only the hardware design, sensor selection, wiring, and embedded firmware — the physical core of the system. Other aspects of the project ( software component , website ) not considered in this repository


Table of Contents

  1. Project Overview
  2. System Architecture
  3. Internal Station — Patient Side
  4. External Station — Dentist Side
  5. Sensor Reference
  6. Microcontrollers & Communication
  7. Power Supply
  8. PCB
  9. Current Limitations & Future Work
  10. Authorship & Contributions

1. Project Overview

Dental patients cannot speak during procedures. The traditional workaround — raising a hand to signal pain — forces dentists to split their attention between precise work under magnifying loupes and watching for a hand signal outside their field of view. It is also binary: the signal says stop, but conveys nothing about intensity or rising discomfort.

BM-Dentist is a Bluetooth-enabled physiological monitoring system that gives patients a richer, low-effort communication channel while providing dentists with objective, real-time data about patient comfort:

  • A squeeze ball lets the patient signal pain by squeezing harder or with squeeze patterns (1 squeeze = mild, 2 = moderate, 3+ = severe).
  • Involuntary physiological sensors (GSR + skin moisture) detect stress independently of the patient's conscious action — catching anxiety before it reaches the threshold of deliberate signalling.
  • LED ring indicators on the dentist's side are positioned within their natural visual field and communicate pain and stress levels through colour and intensity without requiring the dentist to look away.
  • A web dashboard logs all signals in real time and generates post-procedure statistics for quality improvement.

The system is designed as a prototype towards clinical use — not yet a certified medical device.


2. System Architecture

The system consists of three interconnected subsystems:

text
┌──────────────────────────────┐        BLE 5.0         ┌──────────────────────────────────────┐
│     INTERNAL STATION         │ ────────────────────►  │         EXTERNAL STATION             │
│        (Patient Side)        │                        │          (Dentist Side)              │
│                              │                        │                                      │
│  Pressure Sensor             │                        │  nRF52840 #1  ──UART──  nRF52840 #2  │
│  GSR Sensor                  │  XIAO nRF52840         │  LED Pain Ring          OLED Display │
│  Moisture Sensor             │  (BLE Peripheral)      │  LED Stress Ring        Buttons      │
│  MAX30102 (PPG)              │                        │  (BLE Central)          (BLE→USB)    │
│                              │                        │                                      │
└──────────────────────────────┘                        └──────────────┬───────────────────────┘
                                                                       │ USB Serial
                                                              ┌────────▼────────┐
                                                              │   WEB APP       │
                                                              │  (HTML/JS)      │
                                                              │  Real-time plot │
                                                              │  Post-proc stats│
                                                              └─────────────────┘

Data flow summary:

  1. Sensors → Internal XIAO nRF52840 via analog ADC / I²C
  2. Internal nRF → External nRF #1 via BLE UART (20 Hz)
  3. External nRF #1 → LED rings (pain & stress visualisation) + External nRF #2 via UART
  4. External nRF #2 → Computer via USB Serial → Web app

The web/software layer (dashboard, statistical analysis, CSV export) was developed by other team members and is referenced here for context only.


3. Internal Station — Patient Side

The internal station is the patient-held device. It houses all sensors, the microcontroller, and the BLE radio inside a custom 3D-printed enclosure designed for comfortable grip. Sensors that must contact the patient's skin (electrodes, moisture pad) exit the enclosure via JST connectors and are attached externally.

 

What it does

  • Reads all four sensors at 20 Hz via a continuous polling loop
  • Packages readings into a CSV string: pressure,gsr,moisture\n
  • Transmits over BLE UART to the external station
  • Performs min-max normalisation against individually calibrated baseline values
  • Drives a status LED (pin D10) to confirm active transmission

Calibration

Before a procedure, a 5-second calibration sequence is triggered from the dentist side:

PhasePatient actionWhat is recorded
RestingHold balloon without squeezingP_min — baseline pressure
Max squeezeSqueeze as hard as possibleP_max — individual squeeze ceiling
Resting (continuous)Stay relaxedGSR_baseline — calm-state conductance average

Subsequent readings are normalised as:

text
pressure_norm = (P_current - P_min) / (P_max - P_min)
stress_norm   = |GSR_current - GSR_baseline| / GSR_range

Patient gender and age category are also collected at calibration time (they affect pain thresholds), though in the current prototype the demographic adjustment coefficients are set to neutral (A=1.0, B=0.0) pending clinical data.


4. External Station — Dentist Side

The dentist-side station receives data wirelessly and translates it into immediate visual feedback — no screen-watching required.

 

Dual-microcontroller architecture

Two XIAO nRF52840 boards are connected by a UART link (TX/RX crossed: D6↔D7):

nRF52840 #1 — Signal processing & LED control

  • Acts as BLE Central: scans for and connects to the internal station ("SensorNode")
  • Parses the incoming CSV string and normalises sensor values
  • Maps normalised pain to the number of illuminated LEDs on the green pain ring
  • Maps normalised stress to the number of illuminated LEDs on the blue stress ring
  • Flips stress ring colour to red when stress normalised value > 75% (urgent alert)
  • Supports two pain-signalling modes (selectable at runtime):
    • Direct mode: squeeze force → proportional LED count
    • Pattern mode: counts squeeze edges in a sliding time window → 1 squeeze = few LEDs, 2 = moderate, 3+ = many
  • Forwards raw data to nRF #2 via UART during working mode

nRF52840 #2 — Interface & data relay

  • Drives the OLED menu display and three navigation buttons (Up / Down / Enter)
  • Sends configuration commands to nRF #1:
    • CALIB,<gender>,<age> — start calibration
    • RESET_CALIB — wipe calibration
    • WORKCFG — start working mode with selected options
    • WORK_END — stop working mode, return to sleep
  • Relays raw sensor data to the computer via BLE → USB Serial

Operating modes

ModeDescription
SleepBLE connection active, command exchange only — no data streaming or LED updates
WorkingFull data streaming at 20 Hz, LED feedback active, data sent to computer

5. Sensor Reference

5.1 Pressure Sensor — ABPDRRV060MGAA5

PropertyValue
TypeAnalog MEMS pressure sensor
InterfaceAnalog voltage → ADC pin D2
Supply3.3 V
ADC resolution12-bit (0–4095)
Physical connectionFlexible tubing → squeeze balloon (water bottle)
Sampling rate20 Hz

Purpose: The primary intentional pain-signalling channel. The patient squeezes a balloon; the pressure sensor sits inside the enclosure connected by tubing, so there is no direct electronic contact with the patient's hand. This improves hygiene and allows the balloon to be replaced/sterilised between patients.

What we get: An analogue voltage proportional to balloon pressure. After calibration, this maps linearly to a 0–100% pain scale. In pattern mode, rising edges are counted over a sliding window to detect discrete squeeze events.

Why this sensor: The specific sensor was supplied to the team and is well-matched to the use case — it captures a deliberate, high signal-to-noise signal that requires no inference to interpret.


5.2 GSR Sensor — Galvanic Skin Response

PropertyValue
TypeSkin conductance, analog
InterfaceAnalog voltage → ADC pin D0
Supply3.3 V
Electrode placementIndex finger + middle finger
Sampling rate20 Hz

Purpose: Continuous, involuntary stress monitoring. Galvanic skin response measures changes in sweat gland activity driven by the sympathetic nervous system. It captures anticipatory anxiety — the patient may start showing stress before consciously deciding to squeeze.

What we get: A slow-varying analogue voltage that rises as skin conductance increases (higher stress → more perspiration → lower resistance → higher conductance). The deviation from the calibrated calm baseline is used as the stress metric.

Why this sensor: GSR is a well-established proxy for sympathetic arousal. Practical alternatives (e.g., dedicated EDA modules) had longer delivery times; the chosen module was available immediately and is straightforward to integrate with a single ADC pin.

Wiring: Two finger-clip electrodes connect to the sensor module via wires that exit the enclosure through a JST socket. The module output goes to pin D0.


5.3 Moisture Sensor — Adafruit STEMMA

PropertyValue
TypeCapacitive soil moisture sensor (repurposed)
InterfaceAnalog voltage → ADC pin D1
Supply3.3 V
PlacementPalm contact (external, JST connector)
Sampling rate20 Hz

Purpose: Secondary stress indicator via perspiration. Stress-induced sweating changes the dielectric properties of the skin surface, which the capacitive sensor detects as a change in output voltage.

What we get: An analogue voltage that varies with surface moisture. In our pilot validation, moisture features showed near-complete binary separation between no-stress and stress conditions (AUC ≈ 0.02–0.035, Cliff's δ ≈ −0.93 to −0.96 — moisture decreases in our sensor's output with higher sweat, reflecting sensor polarity).

Important caveat: This sensor is designed for soil, not human skin. Its readings are highly sensitive to contact area and the rigid structure makes consistent placement difficult. It is treated as an exploratory channel in the current prototype. A future iteration should replace it with a skin-validated conductance or hydration sensor.

Wiring: The sensor pad exits the enclosure via JST connector and is held against the patient's palm.


5.4 PPG Sensor — MAX30102

PropertyValue
TypePhotoplethysmographic (optical heart rate + SpO₂)
InterfaceI²C → pins D4 (SDA) / D5 (SCL)
Supply3.3 V
Interrupt pinD3 (INT, optional)

Purpose: Heart rate and pulse-related metrics are strong indicators of physiological stress. HRV (heart rate variability) in particular is sensitive to autonomic nervous system state.

Current status: ⚠️ Not used in the current validated prototype. One of the two purchased modules was defective (internal short). The second produced unstable readings. The JST connector and I²C lines remain present on the PCB for future integration. Results in this report do not rely on PPG data.

Why this sensor: Selected primarily on cost, feature set, and community support under a limited budget. A future iteration should source a verified module or use an alternative such as the MAX86150.


6. Microcontrollers & Communication

Seeed Studio XIAO nRF52840

Used for all three microcontroller roles (internal station + both external boards).

SpecValue
CPUARM Cortex-M4 @ 64 MHz
BLE5.0 integrated
ADC12-bit, 6 analog pins
Size20 × 17.5 mm
Supply3.3 V logic; powered via VBUS (5 V)
I²CHardware I²C on D4/D5
UARTHardware Serial1 on D6/D7

BLE Configuration

  • Internal board advertises as peripheral under name "SensorNode"
  • External board #1 acts as central, scans and connects to "SensorNode"
  • BLE UART service emulates serial over Bluetooth
  • Data transmitted at 20 Hz; format: "pressure,gsr,moisture\n"
  • ADC resolution set explicitly: analogReadResolution(12)

UART Between External Boards

  • Pins: D6(#1) → D7(#2), D7(#1) → D6(#2) (TX/RX crossed)
  • Baud rate: 115200
  • Commands flow #2 → #1; raw data flows #1 → #2
  • In sleep mode: command exchange only. In working mode: full 20 Hz data stream.

7. Power Supply

MB102 Breadboard Power Module

Used on both internal and external stations.

OutputUsed for
5 VXIAO VBUS pin, LED rings (5 V NeoPixel-type)
3.3 VAll sensors (pressure, GSR, moisture, PPG)
  • Each XIAO board provides its own 3.3 V rail from its onboard regulator — two separate 3.3 V rails on the external station to distribute load.
  • All boards and sensors share a common ground.
  • MB102 includes overcharge/overdischarge protection.

8. PCB

PCB Design

Schematics and PCB layouts were designed in KiCad. Key design decisions:

  • JST connectors used extensively throughout — sensors on the internal board and interface elements on the external board are all physically external to the PCB, so connectors allow clean cable management and easy swapping.
  • PCB fabrication within university facilities was not feasible in the project timeline, so components were soldered onto prototyping (perfboard) boards following the KiCad layout.

KiCad project files are included in /internal/ or /external/ .


9. Current Limitations & Future Work

AreaCurrent statePlanned improvement
PPG (heart rate)Unstable — excluded from prototypeSource verified MAX30102 or MAX86150; repeat validation
Moisture sensorExploratory — not skin-specificReplace with validated skin conductance/hydration sensor
Demographic calibrationCoefficients set to neutral (A=1, B=0)Add clinically derived thresholds per gender/age group
Clinical validationSimulated stress (video induction), 1 subjectEthically approved trials with real dental patients
EnclosureInternal box only printedPrint external box; ergonomic redesign for sterile grip
AccessibilityHand squeeze onlyAdd foot-operated or capacitive-touch alternative inputs
SterilisationNot yet validatedMaterial selection and sterilisation protocol testing

10. Authorship & Contributions

The hardware design presented in this repository — including sensor selection and wiring, PCB schematics, microcontroller configuration, BLE/UART communication architecture, and embedded firmware for data acquisition and LED control — was designed and implemented by Iaroslav Petrishchev.

The following parts of the system are the work of other team members and are therefore not covered in this repository:

  • Web application & real-time dashboard (HTML/JS, Chart.js, Web Serial API) — Naya Nasr & Yanzi Yu
  • Post-procedure statistical analysis & CSV export — Naya Nasr & Yanzi Yu
  • Clinical research, sensor rationale & validation study — Naya Nasr & Yanzi Yu

Full project report available upon request.

Parts

19
QtyValueFootprintReferences
4Conn_01x02_SocketConnector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_VerticalJ2, J3, J4, J6
30.1 nFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC1, C2, C3
310k RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1, R2, R3
3Conn_01x03_SocketConnector_JST:JST_XH_B3B-XH-A_1x03_P2.50mm_VerticalJ5, J8, J9
2XIAO-nRF52840-DIPSeeed Studio XIAO Series Library:XIAO-nRF52840-DIPU1, U2-Int
11000uFCapacitor_THT:CP_Radial_D10.0mm_P5.00mmC4
1220 RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR4
1Conn_01x04_SocketConnector_JST:JST_XH_B4B-XH-A_1x04_P2.50mm_VerticalJ7
1Conn_01x08_SocketConnector_JST:JST_XH_B8B-XH-A_1x08_P2.50mm_VerticalJ1

More from petriiar2/Stress_device

1
  • 2 layers37 × 33 mmFinal internal pcb, the printed circuit board in 3D

    Final internal pcb

    petriiar2/Stress_device

    Description of a device for measuring patient's stress and pain at a dentist's appointment

    8 parts

Similar boards

  • 2 layers43.9 × 27.7 mmTcd1304-4v, the printed circuit board in 3D

    Tcd1304-4v

    OpnTec/open-spectrometer-hardware

    Open source VIS spectrometer

    19 parts1.5k
  • 2 layers50 × 60 mmDebate Device, the printed circuit board in 3D

    Debate Device

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    19 parts915
  • 2 layers102.9 × 96.7 mmISA adapter, the printed circuit board in 3D

    ISA adapter

    polpo/picogus

    Emulation of ISA sound cards and CD-ROM on Raspberry Pi Pico (GUS, SB/Adlib, MPU-401, Tandy, CMS, Panasonic CD-ROM) with USB mouse/joystick support

    19 parts805
  • 2 layers60 × 39 mmPs2usb, the printed circuit board in 3D

    Ps2usb

    rasteri/HIDman

    Adapting USB devices to work on old computers

    19 parts432
  • 2 layers70.1 × 43.2 mmIaq device, the printed circuit board in 3D

    Iaq device

    nkitanov/iaq_board

    IAQ Board is a DIY (Do-It-Yourself) device for measuring internal air quality

    19 parts396
  • 2 layers80 × 80 mmGB BRK CPU G1, the printed circuit board in 3D

    GB BRK CPU G1

    Gekkio/gb-hardware

    Game Boy -related custom hardware by gekkio

    19 parts379CC-BY-4.0
  • 2 layers25.4 × 25.4 mmIna169, the printed circuit board in 3D

    Ina169

    Ardumower/ardumower

    Develop an open source robotic lawn mower (HW+SW reference platform)

    19 parts282
  • 2 layers58.4 × 28.6 mmNew rele, the printed circuit board in 3D

    New rele

    zmaker/arduino_cookbook

    gli sketch del nuovo progetto Arduino Cookbook e dei video di YouTube

    19 parts269

Questions

How big is the Final external pcb PCB?

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

What parts does the Final external pcb use?

19 parts. 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 Final external pcb KiCad files?

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

Can I use the Final external pcb design in my own project?

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