Skip to the content
2 layers64.9 × 40 mmRR Lightdistance, the printed circuit board in 3D

RR Lightdistance

qrellw/RR-Laser-Circuit

Tài liệu này cung cấp các thông số kỹ thuật, nguyên lý hoạt động và hướng dẫn cấu hình phần mềm cho hệ thống thiết bị đo nhịp thở ứng dụng cảm biến quang học.

Size
64.9 × 40 mm
Copper layers
2
Thickness
1.6 mm
Parts
50
Nets
38
Pads
177
Tracks, vias
199, 634
Pours
3
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
17 Oct 2026
Updated
30 Oct 2026

Overview

RR Lightdistance is an open-source printed circuit board by qrellw, from the qrellw/RR-Laser-Circuit repository on GitHub. It is a 2-layer board of 64.9 × 40 mm with 50 parts on 38 nets, routed with 199 tracks and 634 vias.

It is built around the ADS1115IDGS, MCP6004-E/P and AP2112K-3.3, with the TP4056 and BPW34 among its other parts. Its parts include 18 capacitors, 17 resistors, 6 ICs, 4 diodes and 2 connectors. It belongs with the ESP32 and RISC-V boards of this library.

Main components

5

README

README.md

Tài liệu Kỹ thuật Dự án: Thiết bị Đo nhịp thở (RR-Laser-Circuit)

Tài liệu này cung cấp các thông số kỹ thuật, nguyên lý hoạt động và hướng dẫn cấu hình phần mềm cho hệ thống thiết bị đo nhịp thở ứng dụng cảm biến quang học.

1. Tổng quan Nguyên lý Hoạt động

Hệ thống đo nhịp thở dựa trên phương pháp đo chuyển vị quang học (Optical Displacement Sensing):

  • Khối Phát: Module Laser bán dẫn (bước sóng 650nm) chiếu tia sáng vào một gương phản xạ gắn trên lồng ngực.
  • Khối Thu: Hai photodiode (BPW34) được bố trí thành dạng bi-cell. Sự dịch chuyển của gương theo nhịp thở làm thay đổi vị trí tia phản xạ trên bề mặt bi-cell, dẫn đến sự thay đổi tương quan dòng quang điện giữa hai kênh.
  • Khối Xử lý Tín hiệu (Analog): Hai mạch Transimpedance Amplifier (TIA) sử dụng Op-amp MCP6002 chuyển đổi dòng quang điện (µA) thành điện áp (Va, Vb). Tín hiệu sau đó được đệm qua mạch Buffer để ổn định trở kháng trước khi đưa vào ADC.
  • Khối Số hóa (Digital): Vi điều khiển ESP32-C3 thu thập dữ liệu từ ADC (ADS1115) qua giao tiếp I2C, xử lý thuật toán và truyền dữ liệu qua giao thức Bluetooth Low Energy (BLE).

2. Sơ đồ Chân Vi điều khiển (Pinout)

Thiết bị sử dụng module ESP32-C3 SuperMini.

Chức năngChân GPIOTrạng thái LogicGhi chú
I2C SDAGPIO8BidirectionalGiao tiếp dữ liệu với ADS1115
I2C SCLGPIO9OutputXung nhịp I2C cho ADS1115
BOOST_ENGPIO3OutputHIGH: Bật nguồn Boost 5V cho Laser
LASER_ENGPIO4OutputHIGH: Bật công tắc MOSFET cấp dòng cho Laser
VBAT_SENSEGPIO0Analog InputĐọc điện áp Pin qua cầu phân áp (ADC1)

3. Cấu hình ADC (ADS1115) và Quy trình Lấy mẫu

  • Địa chỉ I2C (I2C Address): 0x48 (Chân ADDR nối GND).
  • Độ phân giải: 16-bit.
  • Phân bổ Kênh (Multiplexer): Mặc dù ADS1115 chỉ có một lõi ADC, bộ dồn kênh (MUX) nội bộ cho phép đọc tuần tự 3 kênh thông qua giao thức I2C:
    • AIN0 = Điện áp Va (Tín hiệu TIA kênh 1).
    • AIN1 = Điện áp Vb (Tín hiệu TIA kênh 2).
    • AIN2 = Điện áp Vbias (Mức nền tham chiếu thực tế của mạch Analog, thường ~0.23V).

Quy trình lấy mẫu (Sampling Sequence): Để triệt tiêu nhiễu môi trường và tối ưu hóa năng lượng, phần mềm cần thực hiện chu kỳ lấy mẫu theo trình tự nghiêm ngặt sau:

  1. Đặt BOOST_EN = HIGH (Khởi động mạch Boost).
  2. Trễ (Delay) 10ms để điện áp 5V ổn định.
  3. Đặt LASER_EN = HIGH (Laser phát sáng).
  4. Trễ 50ms để mạch lọc RC (fc ≈ 15Hz) xác lập giá trị (Settling time).
  5. Đọc giá trị ADC tại AIN0, AIN1 và AIN2 (Lưu vào biến Va_on, Vb_on, Vbias).
  6. Đặt LASER_EN = LOW (Tắt Laser).
  7. Trễ 50ms.
  8. Đọc giá trị ADC tại AIN0, AIN1 (Lưu vào biến Va_off, Vb_off).
  9. Đặt BOOST_EN = LOW (Tắt mạch Boost để tiết kiệm pin).

4. Công thức Tính toán Tín hiệu

Mức nền thực tế (Vbias) được đọc từ AIN2 giúp bù trừ sai số do nhiệt độ và dung sai linh kiện. Phần mềm cần thực hiện các bước tính toán sau:

  1. Trích xuất dòng quang điện (tỉ lệ với điện áp):

    • $I_a = V_{a_on} - V_{a_off}$
    • $I_b = V_{b_on} - V_{b_off}$ (Việc trừ mẫu sáng cho mẫu tối giúp triệt tiêu hoàn toàn mức nền Vbias và ánh sáng môi trường).
  2. Tính tỉ số vị trí (Position Ratio - r): $r = \frac{I_a - k \cdot I_b}{I_a + k \cdot I_b}$

    • Trong đó: k là hệ số bù sai lệch giữa hai kênh (được xác định thực nghiệm). Giá trị r dao động từ -1 đến 1, phản ánh chính xác vị trí dịch chuyển của tia Laser.

5. Quản lý Năng lượng và Cảnh báo Phần cứng

  • Nguồn cấp: Pin Lithium-Ion 3.7V (có mạch bảo vệ PCM).
  • Sạc: IC TP4056 (giới hạn dòng sạc ~120mA qua trở PROG 10kΩ).
  • Đo Pin: Điện áp Pin được chia áp 1:2 qua cầu trở 100kΩ trước khi vào GPIO0. Công thức quy đổi: V_pin = ADC_Value * 2. Cảnh báo pin yếu nên được thiết lập ở ngưỡng 3.5V.
  • Cảnh báo Phần cứng: Cổng USB trên module ESP32-C3 chỉ dùng để nạp firmware (đã ngắt kết nối nguồn 5V từ USB vào LDO nội bộ để tránh xung đột với mạch nguồn ngoài). Do đó, không thực hiện đo nhịp thở trong quá trình đang sạc pin.

6. Ghi chú Phát triển Firmware

  • Thư viện đề xuất: Adafruit_ADS1X15 (đọc ADC), NimBLE-Arduino (giao tiếp BLE).
  • Xử lý tín hiệu số (DSP): Tín hiệu r thô chứa nhiễu tần số thấp. Cần áp dụng bộ lọc thông dải (Bandpass Filter) trong dải tần 0.05 Hz đến 1 Hz để tách xuất tín hiệu nhịp thở. Khuyến nghị sử dụng thuật toán lọc trung bình trượt (Moving Average) hoặc bộ lọc IIR (Infinite Impulse Response).
  • Chu kỳ lấy mẫu: Tần số lấy mẫu khuyến nghị từ 10Hz - 20Hz để đảm bảo độ phân giải cho tín hiệu nhịp thở (0.2 - 0.3Hz) mà không gây quá tải bộ nhớ.

Parts

50
QtyValueFootprintReferences
5100nCapacitor_SMD:C_0603_1608MetricC4, C6, C14, C21, C24
510uCapacitor_SMD:C_0805_2012MetricC3, C7, C15, C16, C18
44.7kResistor_SMD:R_0603_1608MetricR5, R6, R7, R8
3100kResistor_SMD:R_0603_1608MetricR14, R15, R16
310kResistor_SMD:R_0603_1608MetricR1, R2, R9
31uCapacitor_SMD:C_0603_1608MetricC11, C17, C19
21kResistor_SMD:R_0603_1608MetricR10, R17
22.2uCapacitor_SMD:C_0603_1608MetricC8, C9
2470nCapacitor_SMD:C_0603_1608MetricC1, C2
2BPW34OptoDevice:Osram_BPW34S-SMDD1, D2
2Conn_01x04Connector_JST:JST_SH_BM04B-SRSS-TB_1x04-1MP_P1.00mm_Verticalanalog1, analog2
2LEDLED_SMD:LED_0805_2012MetricD4, D5
10Resistor_SMD:R_0805_2012MetricR18
110RResistor_SMD:R_0603_1608MetricR11
127kResistor_SMD:R_0603_1608MetricR4
12N7002Package_TO_SOT_SMD:SOT-23Q1
12kResistor_SMD:R_0603_1608MetricR3
147RResistor_SMD:R_0603_1608MetricR20
147uCapacitor_SMD:C_0805_2012MetricC12
1ADS1115IDGSPackage_SO:TSSOP-10_3x3mm_P0.5mmU3
1AP2112K-3.3Package_TO_SOT_SMD:SOT-23-5U5
1ESP32-C3_SUPERMINI_THESP32-C3_SUPERMINI_TH:MODULE_ESP32-C3_SUPERMINI_THU8
1LaserConnector_JST:JST_SH_BM02B-SRSS-TB_1x02-1MP_P1.00mm_VerticalJ1
1MCP1700x-330xxTTPackage_TO_SOT_SMD:SOT-23U7
1MCP6004Package_SO:SOIC-14_3.9x8.7mm_P1.27mmU6
1TP4056Package_SO:SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.3mm_ThermalViasU4
1~Connector_JST:JST_SH_BM02B-SRSS-TB_1x02-1MP_P1.00mm_VerticalJ3

Similar boards

  • 2 layers100 × 100 mmEnvcity aqm v2, the printed circuit board in 3D

    Envcity aqm v2

    MateusMaruzka/aqm_envcity_hw

    138 parts2
  • 2 layers52.8 × 71.8 mmESPBoosted, the printed circuit board in 3D

    ESPBoosted

    schoolllex/ESPBoosted

    A custom, feature-rich ESP32-WROOM-32 development board featuring built-in environmental sensors, power management, and expansion interfaces.

    51 parts
  • 2 layers158.5 × 87.4 mmVive sensors tr 2hp, the printed circuit board in 3D

    Vive sensors tr 2hp

    Roboy/HTC_Vive_Sensors

    Schematics and PCB designs for our custom Vive sensors based on a quad op-amp chip rather than discrete transistors.

    372 parts23
  • 4 layers49.6 × 40 mmFsoc rx, the printed circuit board in 3D

    Fsoc rx

    SharbelMarshi/txrx-optical-communication-kicad

    A Free-Space Optical Communication link KiCad project

    62 parts1
  • 2 layers110 × 70 mmPinaBiosensor Mini, the printed circuit board in 3D

    PinaBiosensor Mini

    AlejandroPina/PinaBioHw

    Non-medical biofeedback PCB: GSR, PPG/HRV, skin temperature, lab ECG, and two resistive breath belts on a Seeed XIAO ESP32-S3.

    55 parts
  • 2 layers70 × 120 mmMultimetre V2, the printed circuit board in 3D

    Multimetre V2

    hilham1990/Multimetre

    AkademiUsta Multimetre: ATmega328P + 16 bit ADS1115 ADC, OLED ekran ve Li-ion pil ile açık kaynak el multimetresi. KiCad 10 dosyaları, Gerber ve LCSC kodlu BOM. Kart henüz üretilmedi.

    86 parts
  • 2 layers248.9 × 120.7 mm16nx, the printed circuit board in 3D

    16nx

    16n-faderbank/16nx

    16nx is a controller for musical instruments. Sixteen faders,MIDI over USB and jack, CV out, and I2C out. Based around RP2040.

    171 parts76
  • 4 layers102 × 108 mmRools core, the printed circuit board in 3D

    Rools core

    amorwilliams/Rools

    10HP Eurorack 多功能可视化 DSP 模块 · Daisy Seed 固件 · 横屏频谱/示波/效果器单 App 平台

    148 parts

Questions

How big is the RR Lightdistance PCB?

It measures 64.9 × 40 mm and has 2 copper layers, 1.6 mm thick.

What parts does the RR Lightdistance use?

50 parts, built around the ADS1115IDGS, MCP6004-E/P, AP2112K-3.3 and TP4056. 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 RR Lightdistance KiCad files?

From the qrellw/RR-Laser-Circuit repository on GitHub, at the commit this page was made from: the board is RR_Lightdistance/RR_Lightdistance.kicad_pcb and its schematic RR_Lightdistance/RR_Lightdistance.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the RR Lightdistance design in my own project?

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