Skip to the content
2 layers142.2 × 106.7 mmSwitchFoil, the printed circuit board in 3D

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

4

README

README.md

Art 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:

text
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. test-polygon-finder.py

Based on

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

ld2450

Specs

KeyValue
Max targets3
ISM band24 GHz
Detection distance6m
Detection angle±60°
Data per targetXmm, 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

text
cd _archive/esptool
esptool.py --port /dev/cu.usbserial-02762195 erase_flash

If:

text
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:

text
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 device or three dots when hovering over project name select 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.conf file, its changes only take effect after its uploaded to the board. Right click on the pymakr.conf file > "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-0275EAB2
  • repl ~ /dev/cu.usbserial-0275EAB2
  • ctrl+x = exit
  • import os
  • os.remove("main.py")

Pymakr.conf

Example:

text
{
  "py_ignore": [
    "_archive",
    "_tools",
    "docs",
    ".DS_Store",
    ".git",
    ".gitignore",
    ".gitmodules",
    ".vscode",
    "env",
    "README.md",
    "README.pdf",
    "venv"
  ],
  "name": "Rebekkas Smart Foil Extravaganza"
}

In terminal:

text
import os
os.listdir()
os.chdir("libraries")

Interesting links from our research

Parts

31
QtyValueFootprintReferences
4MountingHoleMountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4
22k7Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR7, R9
24k7Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR8, R10
110kPotentiometer_THT:Potentiometer_Vishay_T73YP_VerticalRV1
11N4004Diode_THT:D_A-405_P7.62mm_HorizontalD5
1230 to 30VACTransformer_THT:Transformer_Myrra_EI30-5_44000_HorizontalT1
133kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR13
1AC-30-OUTTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_HorizontalJ7
1ButtonApts636:pts636SW2
1ButtonBpts636:pts636SW1
1Conn_01x03Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ10
1Conn_01x04Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ9
1FuseFuse:Fuseholder_Cylinder-5x20mm_Schurter_0031_8201_Horizontal_OpenF1
1HC-SR04Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ4
1HLK-LD2410CConnector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_VerticalJ8
1IRM-05-5Converter_ACDC:Converter_ACDC_MeanWell_IRM-05-xx_THTPS2
1Jumper_3_Bridged12Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJP1
1LD2450ld2450:ld2450U4
1LEDLED_THT:LED_D5.0mmD1
1Omron G5LE-1-ASI DC3Relay_THT:Relay_SPDT_Finder_36.11K1
1PIRConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ3
1RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1
1S9014Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalQ2
1Sparkfun ToFConnector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_VerticalJ1
1ThingPlusSparkFun-Board:ThingPlus_With_ConnectorsU1
1c8 inletc8-inlet:c8-inlet-oldJ5

Similar boards

  • 2 layers56.4 × 78.4 mmAIOsense, the printed circuit board in 3D

    AIOsense

    Schluggi/AIOsense

    ESPHome based all-in-one sensor

    25 parts162MIT
  • 2 layers99.5 × 90.5 mmMRR ESPA, the printed circuit board in 3D

    MRR ESPA

    maplerainresearch/MRR_ESPA

    A basic 3D printer control board based on ESP32

    130 parts59
  • 2 layers102 × 102 mmMRR ESPE, the printed circuit board in 3D

    MRR ESPE

    maplerainresearch/MRR_ESPE

    MRR ESPE 3D printer control board

    168 parts39
  • 2 layers88.9 × 85.5 mmDown cp, the printed circuit board in 3D

    Down cp

    xiongyumail/ESP-Debugger

    Finished

    396 parts4
  • 2 layers171 × 83.9 mmPilot6Axis v2, the printed circuit board in 3D

    Pilot6Axis v2

    X-Lemon-X/Pilot_6_axis

    DIY Remote Controler Build

    126 parts2MIT
  • 2 layers55 × 32 mmHA Sensor Node, the printed circuit board in 3D

    HA Sensor Node

    AlexD717/HA-Sensor-Node

    Sensor node featuring a temperature, humidity, and mmWave sensor

    15 parts1
  • 2 layers90 × 60 mmMixers, the printed circuit board in 3D

    Mixers

    k1zmt/SSB85MultiPCB

    WIP! Don't try repeating!

    133 parts1
  • 2 layers155.1 × 122 mmKiCad Main, the printed circuit board in 3D

    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.