

SwitchFoil
This repo is using a HLK-LD2450 microwave human presence sensor and a Sparkfun Thing Plus. This uses Micropython. See below for instructions to set it up.
- Size
- 142.2 × 106.7 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 31
- Nets
- 49
- Pads
- 117
- Tracks, vias
- 264, 10
- Pours
- 1
- Routed
- Yes
- KiCad
- KiCad 7 (file 20221018)
- Created
- 7 Dec 2023
- Updated
- 12 Aug 2024
Overview
SwitchFoil is an open-source printed circuit board by falue, from the falue/rebekkaSwitchFoil repository on GitHub. It is a 2-layer board of 142.2 × 106.7 mm with 31 parts on 49 nets, routed with 264 tracks and 10 vias.
It is built around the IRM-05-5, HC-SR04 and HLK-LD2410C, with the S9014 among its other parts. Its parts include 8 connectors, 6 resistors, 3 switches, 2 ICs and 2 diodes.
Main components
4IRM-05-5
DIP,45.7x25.4mm0.1W 120V~430V 1A 200mVp-p 21.5mm 25.4mm 3kV 45.7mm 5V 5W 71% 85VAC~305VAC AC/DC-DC Short Circuit Protection、Over Current Protection、Overvoltage protection ±2.5% DIP,45.7x25.4mm Power Module/Power Supply ROHSMWAC-DC Power ModulesHC-SR04
-- Ultrasonic Receivers, Transmitters ROHSUniversal MicroelectronicsUltrasonic Receivers, TransmittersHLK-LD2410C
插件,16X22mm插件,16x22mm New Arrivals ROHSHI-LINKUncategorisedS9014
SOT-23-55℃~+150℃ 1 NPN 100mA 100nA 150MHz 200 200mW 300mV 45V 5V NPN SOT-23 Bipolar (BJT) ROHShongjiachengBipolar (BJT)
README
README.mdArt project with HLK-LD2450 Human detection sensor (Microwave-based)
This repo is using a HLK-LD2450 microwave human presence sensor and a Sparkfun Thing Plus. This uses Micropython. See below for instructions to set it up.
When at least one human being is in a pre defined target area in front of the sensor, a relay is triggered. In this application, this relay is wired to eg. a 30VAC source that switches off a PDLC foil (Polymer Dispersed Liquid Crystal) in front of a mirror.
Change the area in which the relay triggers in the main.py file:
p1 = (-66, 777)
p2 = (66, 777)
p3 = (35, 0)
p4 = (-35, 0)Points clockwise, all values in cm.
Visualized and tested with script _archive/tests/test-polygon-finder.py.

Based on
- https://github.com/christianDUCROS/ld2410-human_sensor
- https://github.com/QuirkyCort/IoTy/blob/main/public/extensions/ld2410.py
Sensor
Can be installed in case, but must have good wave transmission characteristics at 24 GHz and cannot contain metallic materials or materials that have a shielding effect on electromagnetic waves.
For example data and a lot more, check out the > HLK-LD2450-Instruction-Manual.pdf.
Sensor mounting direction

Specs
| Key | Value |
|---|---|
| Max targets | 3 |
| ISM band | 24 GHz |
| Detection distance | 6m |
| Detection angle | ±60° |
| Data per target | Xmm, Ymm, Speed mm/s |
Attention:
- Do not install multiple sensor directly opposite to each other to avoid mutual interference
- Install 150cm to 200cm from floor
SOFTWARE
Micropython
Firmware - once per device
Get https://github.com/espressif/esptool
First, erase flash memory from dir esptool-maser
cd _archive/esptool
esptool.py --port /dev/cu.usbserial-02762195 erase_flashIf:
A fatal error occurred: Could not open /dev/cu.usbserial-02762195, the port is busy or doesn't exist.
([Errno 16] could not open port /dev/cu.usbserial-02762195: [Errno 16] Resource busy: '/dev/cu.usbserial-02762195')Unconnect & reconnect, immedietly run the command above again
Download generic firmware esp wroom:
Eg. v1.23.0 (2024-06-02) .bin
Flash firmware:
esptool.py --chip esp32 --port /dev/cu.usbserial-02762195 --baud 460800 write_flash -z 0x1000 ESP32_GENERIC-20240602-v1.23.0.bin To upload code
For vscode:
- pymakr extension install
- "new project" from sidebar
connect deviceor three dots when hovering over project nameselect devices- Click on the bolt on the device (if greyed out, right click three dots
stop script) - To upload click on "upload cloud" when hovering over device name
- After upload, three dots on device,
hard reset device
Attention
- When changing the
pymakr.conffile, its changes only take effect after its uploaded to the board. Right click on thepymakr.conffile > "pymakr" > "upload to device" before you upload the whole thing- When using "Development mode" (auto-upload files after each change), folders, subfolders and their content (like the
libraries) do not get uploaded
When in death loop
Delete main file directly on the flash memory:
- pip install oder so rshell & repl
rshell --port /dev/cu.usbserial-0275EAB2repl ~ /dev/cu.usbserial-0275EAB2ctrl+x = exitimport osos.remove("main.py")
Pymakr.conf
Example:
{
"py_ignore": [
"_archive",
"_tools",
"docs",
".DS_Store",
".git",
".gitignore",
".gitmodules",
".vscode",
"env",
"README.md",
"README.pdf",
"venv"
],
"name": "Rebekkas Smart Foil Extravaganza"
}In terminal:
import os
os.listdir()
os.chdir("libraries")Interesting links from our research
- Library taken from https://github.com/QuirkyCort/IoTy/blob/main/public/extensions/ld2410.py
- Alternatively this french guy is using a similar or the same library:
- Arduino edition: https://github.com/0ingchun/arduino-lib_HLK-LD2450_Radar
Parts
31| Qty | Value | Footprint | References |
|---|---|---|---|
| 4 | MountingHole | MountingHole:MountingHole_3.2mm_M3 | H1, H2, H3, H4 |
| 2 | 2k7 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R7, R9 |
| 2 | 4k7 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R8, R10 |
| 1 | 10k | Potentiometer_THT:Potentiometer_Vishay_T73YP_Vertical | RV1 |
| 1 | 1N4004 | Diode_THT:D_A-405_P7.62mm_Horizontal | D5 |
| 1 | 230 to 30VAC | Transformer_THT:Transformer_Myrra_EI30-5_44000_Horizontal | T1 |
| 1 | 33k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R13 |
| 1 | AC-30-OUT | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_Horizontal | J7 |
| 1 | ButtonA | pts636:pts636 | SW2 |
| 1 | ButtonB | pts636:pts636 | SW1 |
| 1 | Conn_01x03 | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J10 |
| 1 | Conn_01x04 | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J9 |
| 1 | Fuse | Fuse:Fuseholder_Cylinder-5x20mm_Schurter_0031_8201_Horizontal_Open | F1 |
| 1 | HC-SR04 | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J4 |
| 1 | HLK-LD2410C | Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_Vertical | J8 |
| 1 | IRM-05-5 | Converter_ACDC:Converter_ACDC_MeanWell_IRM-05-xx_THT | PS2 |
| 1 | Jumper_3_Bridged12 | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | JP1 |
| 1 | LD2450 | ld2450:ld2450 | U4 |
| 1 | LED | LED_THT:LED_D5.0mm | D1 |
| 1 | Omron G5LE-1-ASI DC3 | Relay_THT:Relay_SPDT_Finder_36.11 | K1 |
| 1 | PIR | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J3 |
| 1 | R | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R1 |
| 1 | S9014 | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | Q2 |
| 1 | Sparkfun ToF | Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical | J1 |
| 1 | ThingPlus | SparkFun-Board:ThingPlus_With_Connectors | U1 |
| 1 | c8 inlet | c8-inlet:c8-inlet-old | J5 |
Similar boards
- 2 layers56.4 × 78.4 mm

- 2 layers99.5 × 90.5 mm

- 2 layers102 × 102 mm

- 2 layers88.9 × 85.5 mm

- 2 layers171 × 83.9 mm

- 2 layers55 × 32 mm

HA Sensor Node
AlexD717/HA-Sensor-Node
Sensor node featuring a temperature, humidity, and mmWave sensor
15 parts1 - 2 layers90 × 60 mm

- 2 layers155.1 × 122 mm

KiCad Main
mgiesen/Magic-Tabmount
Der "Magic Tabmount" ist eine smarte Wandhalterung für das iPad (Generation 5 bis 9). Durch ein integriertes Magnetsystem kann das iPad mit einem Handgriff an der Wand befestigt oder wieder entfernt werden.
55 parts1
Questions
How big is the SwitchFoil PCB?
It measures 142.2 × 106.7 mm and has 2 copper layers, 1.6 mm thick.
What parts does the SwitchFoil use?
31 parts, built around the IRM-05-5, HC-SR04, HLK-LD2410C and S9014. 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 SwitchFoil KiCad files?
From the falue/rebekkaSwitchFoil repository on GitHub, at the commit this page was made from: the board is docs/pcb/SwitchFoil.kicad_pcb and its schematic docs/pcb/SwitchFoil.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the SwitchFoil design in my own project?
Its repository states no licence, so its author keeps all rights: ask falue before reusing the design.