Skip to the content
PCBKitNew board
2 layers39 × 66 mmSmartwatch, the printed circuit board in 3D

An open wearable electronics project built around an ESP32 NodeMCU-32S. The project combines activity tracking, heart-rate sensing, GPS movement data, stress estimation, a rechargeable power concept, a custom PCB, and a…

Size
39 × 66 mm
Copper layers
2
Thickness
1.6 mm
Parts
8
Nets
37
Pads
61
Tracks, vias
41, 0
Pours
1
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
25 Sep 2026
Updated
25 Sep 2026

Overview

Smartwatch is an open-source printed circuit board by loueydaly, from the loueydaly/Smartwatch repository on GitHub. It is a 2-layer board of 39 × 66 mm with 8 parts on 37 nets, routed with 41 tracks and 0 vias.

It is built around the NODEMCU-32SLUA. Its parts include 4 connectors, 1 capacitor, 1 resistor, 1 IC and 1 diode. It belongs with the wearables boards and the ESP8266 boards of this library.

Main components

1

README

README.md

ESP32 Smartwatch

An open wearable electronics project built around an ESP32 NodeMCU-32S. The project combines activity tracking, heart-rate sensing, GPS movement data, stress estimation, a rechargeable power concept, a custom PCB, and a 3D-printed/mechanical smartwatch enclosure.

The repository contains three connected deliverables:

  • code_smartwatch/: PlatformIO firmware and a browser dashboard
  • conception_smartwatch/: SolidWorks mechanical and component design files
  • pcb_smartwatch/: KiCad schematic and PCB layout files

Smartwatch mechanical render

Figure 1. Mechanical render included with the smartwatch concept files.

Capabilities

The current firmware is designed to calculate and display:

  • Step count from an MPU6050 accelerometer
  • Heart rate from a MAX30102 optical pulse sensor
  • Heart-rate variability and a derived stress percentage
  • GPS latitude, longitude, speed, and accumulated distance
  • Estimated calories burned from steps and distance
  • Periodic serial telemetry for debugging and observation

The browser dashboard is prepared to display BPM, stress, steps, calories, and distance from JSON messages received over MQTT. The current ESP32 firmware prints these values to the USB serial console but does not yet publish MQTT messages; connecting the firmware telemetry to the dashboard is the next integration step.

System architecture

text
MPU6050 accelerometer ─┐
                       ├─ I2C at 400 kHz ─> ESP32 NodeMCU-32S
MAX30102 pulse sensor ─┘                       │
                                               ├─ Serial2 / GPS
                                               ├─ USB serial telemetry
                                               └─ MQTT bridge/dashboard (planned)

Battery -> power electronics -> ESP32 + sensors

Mechanical enclosure + custom KiCad PCB hold the electronics together.

Firmware

The firmware is located in code_smartwatch/ and uses PlatformIO with the Arduino framework. Its target is nodemcu-32s.

Sensors and libraries

The project configuration includes:

  • ESP32 Arduino core
  • TinyGPSPlus for GPS parsing
  • Adafruit BusIO and Adafruit Unified Sensor support
  • Adafruit MPU6050 library
  • SparkFun MAX3010x Pulse and Proximity Sensor Library

The exact dependency declarations are in code_smartwatch/platformio.ini. PlatformIO downloads dependencies into .pio, which is intentionally excluded from Git.

MPU6050 step detection

The firmware reads acceleration on a 50 ms interval. It calculates the acceleration magnitude:

text
magnitude = sqrt(ax^2 + ay^2 + az^2)

A step is counted when the magnitude exceeds MOTION_THRESHOLD and the cooldown interval has elapsed. The current defaults are:

ParameterValue
Motion threshold12000
Step cooldown250 ms
Step update interval50 ms
Accelerometer range+/-8 g
Gyroscope range+/-500 deg/s
Sensor filter bandwidth21 Hz

These values require calibration against the final enclosure orientation, wrist position, and user movement.

MAX30102 heart-rate processing

The MAX30102 is initialized on the shared I2C bus at fast speed. The firmware reads the infrared signal, detects beats using an adaptive threshold, calculates BPM from beat-to-beat intervals, and smooths the value with a ten-sample average.

The heart-rate update runs every 20 ms. Values outside the accepted 20 to 255 BPM range are ignored. The source also calculates HRV as the standard deviation of collected RR intervals and converts HRV into a heuristic stress percentage.

This is an educational signal-processing implementation, not a medical device. Optical readings depend strongly on fit, skin contact, ambient light, movement, sensor placement, and calibration.

GPS tracking

GPS is connected to Serial2 with:

SettingValue
RX pinGPIO16
TX pinGPIO17
Baud rate9600
Update interval1000 ms

TinyGPSPlus parses incoming NMEA data. When a valid location is available, the firmware stores latitude, longitude, speed in km/h, and accumulated distance. Distance is calculated using the haversine formula with an Earth radius of 6,371,000 m, and movements below one meter are ignored.

Calories and stress

Calories are estimated from two simple models:

text
step_calories     = step_count * 0.04
distance_calories = distance_km * user_weight_kg * 1.036
calories_burned   = max(step_calories, distance_calories)

The current user weight is 70 kg. Stress is derived from HRV using piecewise linear mapping. Both outputs are estimates for prototyping and should not be interpreted as clinical measurements.

Firmware timing

The main loop schedules independent update tasks:

  • Steps every 50 ms
  • Heart rate and stress every 20 ms
  • GPS and calorie calculation every 1000 ms
  • Serial summary every 1000 ms
  • Sleep after 300,000 ms of inactivity

The current inactivity timer is initialized at startup but is not refreshed by sensor activity in the checked-in code. The sleep path should be completed before relying on battery-saving behavior.

Serial output

Open a monitor at 115200 baud to see startup status and periodic data similar to:

text
============================
     Smartwatch Data
============================
Steps:        42 steps
Heart Rate:   78 BPM
Distance:     0.12 km
Calories:     4.8 kcal
Stress Level: 35.0%
GPS:          36.000000, 10.000000
Speed:        2.5 km/h
============================

The GPS lines appear only after TinyGPSPlus reports a valid location.

Dashboard

code_smartwatch/dashboard/index.html is a static browser dashboard with cards for:

  • BPM
  • Stress percentage
  • Step count
  • Calories
  • Distance

It uses the browser MQTT client library and currently connects to:

text
wss://test.mosquitto.org:8081

The expected MQTT topic is smartwatch/parameters and the expected JSON shape is:

json
{
  "bpm": 78,
  "stress": 35,
  "steps": 42,
  "calories": 4.8,
  "distance": 0.12
}

The public broker and topic are demonstration defaults. Configure a private broker and authentication before using real personal data. A firmware MQTT client or a host-side serial-to-MQTT bridge must be added to connect the ESP32 serial output to this dashboard.

Hardware design

Mechanical conception

conception_smartwatch/ contains the mechanical assembly and component models, including:

  • Smartwatch assembly
  • ESP32-WROOM-32S module model
  • MAX30102 pulse sensor card
  • NEO-6M GPS module with antenna
  • 3.3 V 500 mAh battery model
  • MT3608 converter assembly
  • Enclosure and mechanical parts

These files are intended for SolidWorks. Keep the assembly references together when opening the main smartwatch assembly.

PCB design

pcb_smartwatch/ contains the KiCad project:

  • smartwatch.kicad_pro: project settings
  • smartwatch.kicad_sch: schematic
  • smartwatch.kicad_pcb: PCB layout
  • test/: separate test-board schematic and layout

The local KiCad plot/session files and backup directories are excluded from version control. Before manufacturing, run an electrical rules check, verify footprints and connector pinouts, review power and charging safety, and generate fresh fabrication outputs from the KiCad project.

Build and upload with PlatformIO

  1. Install VS Code with PlatformIO, or install the PlatformIO CLI.
  2. Open code_smartwatch/ as the PlatformIO project directory.
  3. Connect the ESP32 NodeMCU-32S over USB.
  4. Build the firmware:
bash
pio run
  1. Upload it to the board:
bash
pio run --target upload
  1. Open the serial monitor:
bash
pio device monitor -b 115200

The upload port may need to be selected explicitly with upload_port or the PlatformIO device menu.

First hardware test

  1. Assemble the ESP32 and MPU6050 on the 3.3 V supply.
  2. Confirm I2C wiring and verify that the MPU6050 is detected.
  3. Add the MAX30102 and verify optical sensor initialization.
  4. Connect the GPS to GPIO16/GPIO17 and test outdoors with a clear sky view.
  5. Confirm stable serial output before installing the electronics in the enclosure.
  6. Test the dashboard only after choosing a controlled MQTT broker.
  7. Validate step count, BPM, GPS distance, and battery behavior independently.

Repository layout

text
code_smartwatch/
  platformio.ini       PlatformIO target and library dependencies
  src/main.cpp         Sensor initialization and scheduling loop
  src/functions.cpp    Step, heart-rate, GPS, HRV, stress, and calorie logic
  dashboard/index.html MQTT-backed browser dashboard
conception_smartwatch/
  SolidWorks assemblies and component models
pcb_smartwatch/
  KiCad schematic, PCB, and test-board projects
README.md              Project description and setup guide

Limitations and next steps

  • The firmware currently reports through USB serial; MQTT publishing is not implemented on the ESP32.
  • spo2 exists in the data structure but is not calculated.
  • Heart-rate, stress, calorie, and step algorithms are prototypes and need validation.
  • GPS distance can drift when position fixes are noisy.
  • The inactivity sleep function is declared but not implemented in the checked-in source.
  • Sensor initialization failure currently stops in an infinite loop.
  • The dashboard uses a public demo MQTT broker and should be secured for real use.
  • The power/charging design must be reviewed for battery protection and safe charging before assembly.

License

No separate project license has been added. Add an appropriate license before distributing or publishing the repository.

Parts

8
QtyValueFootprintReferences
3Conn_01x04Connector_JST:JST_XH_B4B-XH-AM_1x04_P2.50mm_VerticalJ1, J4, J5
1C_PolarizedCapacitor_THT:CP_Radial_D5.0mm_P2.50mmC1
1LEDLED_THT:LED_D3.0mmD1
1NODEMCU-32Sesp32 node mcu:MODULE_NODEMCU-32SU1
1RResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P2.54mm_VerticalR1
1Screw_Terminal_01x02TerminalBlock:TerminalBlock_Altech_AK300-2_P5.00mmJ3

Questions

How big is the Smartwatch PCB?

It measures 39 × 66 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Smartwatch use?

8 parts, built around the NODEMCU-32SLUA. 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 Smartwatch KiCad files?

From the loueydaly/Smartwatch repository on GitHub, at the commit this page was made from: the board is pcb_smartwatch/smartwatch.kicad_pcb and its schematic pcb_smartwatch/smartwatch.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Smartwatch design in my own project?

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

Similar boards

  • 2 layers50 × 100 mmCorrector de postura, the printed circuit board in 3D

    Corrector de postura

    agustin-arg/Posture

    Dispositivo electrónico de corrección de postura corporal

    23 parts5
  • 2 layers30.5 × 77.5 mmProyecto sensor temperatura, the printed circuit board in 3D

    Proyecto sensor temperatura

    unla-investigacion-desarrollo/ecosistema-iot

    Antes de desarrollar el sistema final, realizamos una etapa de exploración donde investigamos y experimentamos con las siguientes tecnologías:

    8 parts5
  • 2 layers91.4 × 76.2 mmArm pcb, the printed circuit board in 3D

    Arm pcb

    AashishKanted/Kratos_Arm

    2023-24 Code base for the robotic arm of the kratos rover

    24 parts2
  • 2 layers64.1 × 98.3 mmLora life jacket, the printed circuit board in 3D

    Lora life jacket

    bytecod3/lora-life-jacket

    Electronic device for life jackets with LORA data transmission

    17 parts2Apache-2.0
  • 2 layers65.5 × 51.8 mmIOT, the printed circuit board in 3D

    IOT

    hopkinskong/eie553-iot-hardware

    ESP32 IOT Smart Lock Device Hardware Schematic and PCB used in the course "EIE553 Security in Data Communication".

    14 parts2
  • 2 layers80 × 100 mmPcb v3, the printed circuit board in 3D

    Pcb v3

    2026MakerClub/PCB

    projects with pcb, custom and commonly used schemes, footprints...etc.

    21 parts1
  • 2 layers169 × 87 mmThermostat v2, the printed circuit board in 3D

    Thermostat v2

    ANTzacalie/termo-pro-esp32

    Full-featured smart thermostat built on the ESP32 platform.

    26 parts1CERN-OHL-P-2.0
  • 2 layers41.5 × 85 mmBase station, the printed circuit board in 3D

    Base station

    bytecod3/ear-tag

    Ear tag with LORA

    4 parts1MIT