Skip to the content
2 layersLocket, the printed circuit board in 3D

ESP32-C3 based two-node BLE proximity detection system with custom PCB, RSSI-based distance estimation, and proximity alerting.

Copper layers
2
Thickness
1.6 mm
Parts
18
Nets
38
Pads
106
Tracks, vias
245, 38
Pours
2
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
10 Aug 2026
Updated
12 Aug 2026

Overview

Locket is an open-source printed circuit board by Mikoyan707, from the Mikoyan707/BLE-Proximity-Device repository on GitHub, published under the MIT licence. It is a 2-layer board with 18 parts on 38 nets, routed with 245 tracks and 38 vias.

It is built around the ESP32-C3-MINI-1-N4 and AP2112K-3.3. Its parts include 5 capacitors, 5 resistors, 2 ICs, 2 switches and 1 diode. It belongs with the radio and wireless boards and the ESP32 and RISC-V boards of this library.

Main components

2

README

README.md

ESP32-C3 BLE Proximity Device

A two-node Bluetooth Low Energy (BLE) proximity detection system based on the ESP32-C3, designed to detect when two dedicated devices come within a defined proximity range.

The project combines a custom-designed PCB with ESP32-C3 BLE communication and an RSSI-based proximity detection algorithm. Each device continuously scans for its counterpart and uses the received BLE signal strength to determine whether the other device has entered the configured proximity region.

Project Status: Hardware design completed. Firmware development, RSSI calibration, and physical testing are in progress.


Overview

The system consists of two identical BLE-enabled devices.

Each device:

  1. Advertises its BLE identity.
  2. Continuously scans for the corresponding device.
  3. Detects the other device when its BLE advertisement is received.
  4. Measures the received signal strength indicator (RSSI).
  5. Filters the RSSI measurements to reduce short-term fluctuations.
  6. Applies a configurable proximity threshold.
  7. Activates the local output when the other device enters the defined proximity region.

The system is intended to operate without requiring a smartphone or external gateway.

Basic Concept

text
             BLE Proximity Link

        Device A                 Device B
     ┌─────────────┐          ┌─────────────┐
     │ ESP32-C3    │          │ ESP32-C3    │
     │             │          │             │
     │ Advertise   │◄────────►│ Advertise   │
     │ Scan        │   BLE    │ Scan        │
     │ RSSI        │          │ RSSI        │
     │ Processing  │          │ Processing  │
     └──────┬──────┘          └──────┬──────┘
            │                        │
            ▼                        ▼
         Output                   Output

Key Features

  • Two-node standalone BLE proximity system
  • ESP32-C3 based design
  • BLE advertising and scanning
  • Dedicated device identification
  • RSSI-based proximity estimation
  • RSSI filtering for improved stability
  • Configurable proximity threshold
  • Hysteresis-based proximity decision
  • Custom PCB designed in KiCad
  • CR2032 battery-powered hardware design
  • 3.3 V regulated power supply
  • Local LED/output indication
  • Firmware structured for future expansion

Hardware

The custom PCB is built around the ESP32-C3-MINI-1-N4 module.

Main Hardware

ComponentFunction
ESP32-C3-MINI-1-N4Main MCU and BLE controller
CR2032Battery supply
AP2112K-3.33.3 V voltage regulator
LEDProximity/status indication
Transistor stageLED/output driving
Push buttonsUser/control input
Decoupling capacitorsPower supply stabilization
ResistorsPull-ups, current limiting and transistor drive

The complete schematic and PCB design are available in the hardware directory.


Hardware Design

Schematic

The complete KiCad schematic is available at:

text
hardware/schematic/

The repository will contain both the editable KiCad schematic and an exported version for easy viewing.

PCB

The PCB has been designed specifically for the ESP32-C3 based proximity device.

text
hardware/pcb/

The directory contains the editable PCB design and exported PCB views.

3D Design

3D renders of the PCB are provided in:

text
hardware/3d/

These views are intended to document the physical board layout and component placement.


Proximity Detection

The system uses BLE RSSI as an indicator of relative proximity.

A simplified detection pipeline is:

text
BLE Advertisement
        │
        ▼
Device Identification
        │
        ▼
RSSI Measurement
        │
        ▼
RSSI Filtering
        │
        ▼
Proximity Decision
        │
    ┌───┴───┐
    ▼       ▼
   NEAR     FAR
    │       │
    ▼       ▼
 Output   Output
   ON       OFF

RSSI is not treated as an exact distance measurement because it is affected by antenna orientation, obstacles, multipath propagation, human-body absorption, and the surrounding environment.

Therefore, the project will use experimental calibration to determine a suitable operating threshold for the intended application.


Firmware

Firmware development is currently in progress.

The planned firmware architecture consists of separate modules for:

text
firmware/
├── src/
│   ├── main.cpp
│   ├── ble_proximity.cpp
│   ├── ble_proximity.h
│   ├── proximity.cpp
│   ├── proximity.h
│   ├── led.cpp
│   ├── led.h
│   └── config.h
│
└── platformio.ini

The firmware will progressively implement:

  • GPIO initialization
  • Output/LED control
  • BLE advertising
  • BLE scanning
  • Device identification
  • RSSI acquisition
  • RSSI filtering
  • Proximity state detection
  • Hysteresis
  • Timing/debounce logic
  • Final proximity indication

RSSI Filtering

Raw RSSI measurements can fluctuate considerably even when two devices remain stationary.

For this reason, the firmware will process multiple RSSI measurements rather than making a proximity decision from a single sample.

The planned processing chain is:

text
Raw RSSI
   │
   ▼
Filtering
   │
   ▼
Filtered RSSI
   │
   ▼
Threshold + Hysteresis
   │
   ▼
Proximity State

The filtering method and threshold values will be finalized after measurements are collected from the actual hardware.


Calibration

The proximity threshold will be experimentally determined using the completed devices.

Measurements will be collected at different physical separations and under different orientations.

Example measurement format:

DistanceRSSI
0.5 mTBD
1.0 mTBD
1.5 mTBD
2.0 mTBD
3.0 mTBD
4.0 mTBD

These values will be replaced with measurements from the physical hardware.

Detailed calibration results will be documented in:

text
documentation/RSSI_calibration.md

Repository Structure

text
ESP32-C3-BLE-Proximity/
│
├── README.md
├── LICENSE
│
├── hardware/
│   ├── schematic/
│   ├── pcb/
│   ├── 3d/
│   └── fabrication/
│
├── firmware/
│   ├── src/
│   └── test/
│
├── documentation/
│
├── images/
│
└── results/

Development Roadmap

Hardware

  • Schematic design
  • PCB layout
  • 3D PCB design/review
  • PCB fabrication
  • Physical hardware assembly
  • Hardware validation

Firmware

  • GPIO test
  • BLE advertising
  • BLE scanning
  • Device identification
  • RSSI measurement
  • RSSI filtering
  • Proximity threshold
  • Hysteresis
  • LED/output control
  • Two-device testing
  • Final firmware optimization

Documentation

  • Initial hardware documentation
  • Firmware architecture
  • BLE protocol documentation
  • RSSI calibration
  • Experimental results
  • Final performance analysis

Limitations

The primary proximity estimation method is based on BLE RSSI.

RSSI-based proximity estimation does not provide a universally accurate physical distance because the measured signal strength depends on the environment and device orientation.

Potential sources of variation include:

  • Antenna orientation
  • Obstacles
  • Human-body effects
  • Multipath propagation
  • Reflections
  • Transmit power
  • Device-to-device orientation
  • Environmental RF interference

The final operating threshold will therefore be selected experimentally rather than assuming a fixed RSSI-to-distance relationship.


Future Improvements

Potential future developments include:

  • Improved RSSI filtering
  • Adaptive proximity thresholds
  • Low-power BLE operation
  • Battery-life optimization
  • Improved proximity-state stability
  • Additional user feedback mechanisms
  • Enclosure design
  • More extensive environmental testing
  • Multiple proximity zones
  • Improved ranging techniques beyond basic RSSI

Tools Used

  • KiCad — Schematic and PCB design
  • ESP32-C3 — Embedded controller and BLE
  • PlatformIO / Arduino framework — firmware development
  • Git / GitHub — Version control and project documentation

Project Status

This project is under active development.

The custom hardware design is being documented first, followed by firmware implementation, RSSI calibration, physical testing, and final performance evaluation.


License

This project is released under the MIT License.

See LICENSE for details.

Parts

18
QtyValueFootprintReferences
410kohmResistor_SMD:R_0805_2012MetricR1, R2, R4, R5
21uFCapacitor_SMD:C_0805_2012MetricC4, C5
2SW_PushButton_Switch_SMD:SW_Push_1P1T_XKB_TS-1187ASW1, SW2
10.1uFCapacitor_SMD:C_0805_2012MetricC3
110uFCapacitor_SMD:C_0805_2012MetricC2
1330ohmResistor_SMD:R_0805_2012MetricR3
147uFCapacitor_SMD:C_1206_3216MetricC1
1AP2112K-3.3Package_TO_SOT_SMD:SOT-23-5U1
1ESP32-C3-MINI-1-N4ESP32-C3-MINI-1-N4_custom:XCVR_ESP32-C3-MINI-1-N4U2
1LEDLED_SMD:LED_0805_2012MetricD1
1LIR2032Battery:BatteryHolder_Keystone_3034_1x20mmBT1
1~Package_TO_SOT_SMD:SOT-23Q1
1~Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ1

Similar boards

  • 2 layers50 × 50 mmNoisemeter, the printed circuit board in 3D

    Noisemeter

    CivicTechTO/tRacket-sensor

    Design files and source code for the tRacket noise sensor

    32 parts11
  • 2 layers43 × 20 mmEdge detector, the printed circuit board in 3D

    Edge detector

    itstoomuchbutter/edge_detector

    50 parts1
  • 2 layers99.7 × 35 mmPocket lightning detector, the printed circuit board in 3D

    Pocket lightning detector

    Matyas604/Pocket-lightning-detector

    A lightning detector that runs on a battery and fits in your pocket. It records the distance, energy and current time of a lightning strike, and you can then view this data via Bluetooth in mobile app.

    74 parts1GPL-3.0
  • 2 layers43.9 × 45.2 mmGps tracker, the printed circuit board in 3D

    Gps tracker

    joshitha-c/gps-tracker

    A compact GPS tracker designed in KiCad, built around the ESP32-C3 microcontroller and u-blox MAX-M10S GNSS receiver.

    38 parts
  • 2 layers45 × 45 mmAeroq Hardware v3, the printed circuit board in 3D

    Aeroq Hardware v3

    EnriqueNeyra/Aeroq

    An Indoor Air Quality Monitor Powered by ESP32, SCD40, and SEN54

    56 parts130
  • 2 layers35 × 45 mmAether, the printed circuit board in 3D

    Aether

    EnriqueNeyra/aether

    All-in-one home air quality monitor measuring Temp, Humidity, CO2, VOCs, Particulate Matter, and NOx. Powered by ESP32-C3 running esphome, and built with Home Assistant integration

    57 parts129
  • 2 layers58 × 38.3 mmEsp32-caliper, the printed circuit board in 3D

    Esp32-caliper

    Mew463/esp32-caliper

    It features a built in 150mAh battery and a USB C interface for charging/uploading code.

    44 parts59

Questions

What parts does the Locket use?

18 parts, built around the ESP32-C3-MINI-1-N4 and AP2112K-3.3. 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 Locket KiCad files?

From the Mikoyan707/BLE-Proximity-Device repository on GitHub, at the commit this page was made from: the board is hardware/pcb/locket.kicad_pcb and its schematic hardware/schematic/locket.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Locket design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).