Skip to the content
2 layers65.4 × 40.6 mmTrigger, the printed circuit board in 3D

Attempt on some eggish automation.

Size
65.4 × 40.6 mm
Copper layers
2
Thickness
1.6 mm
Parts
39
Nets
36
Pads
117
Tracks, vias
185, 64
Pours
5
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
26 Sep 2025
Updated
3 Nov 2026

Overview

Trigger is an open-source printed circuit board by ondrejh, from the ondrejh/kwokhaus repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 65.4 × 40.6 mm with 39 parts on 36 nets, routed with 185 tracks and 64 vias.

It is built around the DMG4800LK3-13-VB. Its parts include 17 resistors, 12 capacitors, 3 diodes, 3 connectors and 2 ICs. It belongs with the RP2040 boards of this library.

Main components

1

README

README.md

Kwokhaus

Attempt on some eggish automation.

Configuring (door)

Door firmware (fw/src_door) keeps its configuration in the last flash sector, so it survives firmware updates (only full flash erase wipes it). When no valid config is stored, defaults from config.h are used (name KWOK, broadcast period 30 min).

Configure over USB serial only (not over the Meshtastic UART), one command per line:

commandanswerdescription
CFG?CFG: NAME=KWOK BRPER=1800 CNT=0show config (CNT = flash save counter)
NAME=<name>CFG: NAME=<name>device name used in messages, 1-16 chars A-Z a-z 0-9 _ -
BRPER=<s>CFG: BRPER=<s>status broadcast period in seconds (10 .. 86400), 0 = no periodic broadcast (status is still sent on change and on ?)

Invalid value is answered with CFG: ERR .... Changes are applied immediately and saved to flash when the motor is stopped (CFG: saved (cnt N), or CFG: save skipped (same as stored)).

Config tool

Easiest way is fw/test/door_config.py (needs pyserial, see fw/test/requirements.txt). It reads the config, asks whether to change it, asks for the values (Enter keeps current one), shows the changes and writes them after confirmation. Then it waits for the flash save and reads the config back to verify.

text
cd fw/test
./door_config.py                      # default port /dev/ttyACM0
./door_config.py --port /dev/ttyACM1

Options: --port, --timeout (answer timeout, default 2 s), --save-timeout (wait for flash save, default 30 s - save waits while motor runs).

Manually (second door example): connect USB, open terminal (e.g. picocom /dev/ttyACM0), type NAME=KMUT, check with CFG?.

Note: when config_t layout changes, increase CONF_VERSION in nvdata.h (and migrate old data in load_config()), otherwise the stored config falls back to defaults.

ToDo

  • remote setting
  • non volatile config (not hard coded) - door: name, broadcast period

Kwokhaus

  • door motor controll
  • remote connection with Meshtastic (encrypted LoRa)
  • Home Assistant integration

Kwakhaus

Lock

Simple lock controll with serial connection to Meshtastic.

Source directory fw/src_lock

  • clear project (remove display and rtc)

  • check lock / unlock response

  • create unlock trigger (remote only)

  • repeat status message every half an hour

  • connect meshtastic message to home assistant

  • find out how to send messages from home assistant

  • light with dimmer

  • return more info on status (voltage, temperature, ect.)

Communication protocol
functioncommandanswerexample
get statusNAME ?NAME: LODKED/UNLOCKEDRX: ``KWAK ?```
TX: KWAK: LOCKED/UNLOCKED
unlockNAME UNLOCKRX: KWAK UNLOCK
status changeNAME LOCKED/UNLOCKEDTX: KWAK: LOCKED/UNLOCKED
Building, flashing

From source directory fw run ./rebuild_lock.sh. Reset the board to bootloader by ./utils/reset.sh, flash it by ./utils/flash.sh.

Connecting MQTT to HA

Let there be mqtt.yaml file in your config. And let there be in you configuration.yaml file line mqtt: !include mqtt.yaml. Than, somewhere it the file there shoul be:

text
  - name: "MediumFast Last Message"
    unique_id: "mediumfast_last_message"
    state_topic: !secret meshtastic_mediumfast_topic
    value_template: >-
      {% if value_json.payload.text is defined %}
        {{ (value_json.payload.text) }}
      {% else %}
        {{ this.state }}
      {% endif %}

Note that, you also need to have secret definition in your secret.yaml file. This is how HA works. Love it or hate it.

From now on, youre having last MediumFast message in sensor.medium_fast_message entity. One can probably imagine how to change this for his own secret channel. Cause the otherone can probably imagine, its not a good idea to have LOCK driver connected to the public channel.

Key

Dedicated Meshtastic connected device, monitoring Lock status. It has an RGB led to indicate whether lock is locked or unlocked. It also has the button to unlock it remotelly.

ToDo
  • chatch lock unlock messages, display
  • detect button press, send unlock message
  • send status request when no status update
Technical
  • wifi, mqtt reconnecting
  • mqtt dedicated files (not to plague main)
Features
  • button
    • to unlock remote lock
  • rgb led
    • to indicate remote lock status
  • mqtt connection
    • bridge between secret Meshtastic channel and MQTT
    • backup channel for HA, in case main transceiver doesn't work
Prototype

KwakKey prototype with ohM3 meshtastic modem


Obsolette

Idea (not to forget)

  • rubber duck splash screen

Siple tasks

  • trigger by pushbutton (test)
  • trigger on time
  • send status on idle (every 15 minutes)
  • send status on event
  • draw display function chart
  • create and test function to store data in flash (or find lib)
    • improve nvdata.c/h
  • parse incoming messages
    • reply on ?
    • T to set time
    • Z to set zone
    • U to set unlock time
  • simple pushbutton (any bool input) filtering
  • measure trigger charge voltage

Hardware needed

  • rtc module
  • display
  • communication port (uart)
  • charge pump
    • to charge trigger from lower voltage (single lipo)

Functionality and features

  • filter incoming messages
  • show time
  • set time
  • set trigger time
  • set time, trigger and zone localy (button, display)
  • trigger on time
  • showing status on display (unlocked, locked, next unlock in ..)
  • remote addministration by com. port

Communication protocol (so far)

functioncommandanswerexample
get statusNAME ?NAME LODKED/UNLOCKED Uhh:mm Thh:mm(z)RX: KWAK ?
TX: KWAK: LOCKED U11:03 T10:08(+2)
set local timeNAME Thh:mmNAME: Thh:mmRX: KWAK T12:00
TX: KWAK: T12:00
set unlock time (local)NAME Uhh:mmNAME: Uhh:mmRX: KWAK U12:01
TX: KWAK: U12:01
set zoneNAME Z+/-zNAME: Z+/-zRX: KWAK Z+1
TX: KWAK: Z+1

Parts

39
QtyValueFootprintReferences
6100RResistor_SMD:R_0603_1608MetricR3, R11, R12, R13, R14, R15
6100nCapacitor_SMD:C_0603_1608MetricC4, C5, C8, C9, C10, C12
310kResistor_SMD:R_0603_1608MetricR2, R16, R17
310mF/25VmyLibrary:C_36x18C1, C2, C3
31k0Resistor_SMD:R_0603_1608MetricR6, R9, R10
24k7Resistor_SMD:R_0603_1608MetricR7, R8
1100R/2WResistor_THT:R_Axial_DIN0414_L11.9mm_D4.5mm_P15.24mm_HorizontalR1
1100kResistor_SMD:R_0603_1608MetricR5
110nCapacitor_SMD:C_0603_1608MetricC7
11M0Resistor_SMD:R_0603_1608MetricR4
1470u/25VCapacitor_THT:CP_Radial_D8.0mm_P3.50mmC6
14u7Capacitor_SMD:C_1206_3216MetricC11
15V0 step downmyLibrary:Untitled_3IC2
1Conn_01x04_PinmyLibrary:Solder_Terminal_4pJ4
1Conn_01x05_PinmyLibrary:Solder_Terminal_5pJ2
1Conn_01x06_SocketmyLibrary:Solder_Terminal_6pJ1
1DMG4800LK3-13Package_TO_SOT_SMD:TO-252-3_TabPin2Q1
1D_SchottkyDiode_SMD:D_SOD-123FD3
1LED_GREENLED_SMD:LED_0805_2012MetricD2
1LED_REDLED_SMD:LED_0805_2012MetricD1
1RP2040_ZEROmyLibrary:RP2040_ZEROIC1
1SW_PushButton_Switch_SMD:SW_SPST_SKQG_WithStemSW1

More from ondrejh/kwokhaus

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

    Motor

    ondrejh/kwokhaus

    Attempt on some eggish automation.

    45 partsGPL-3.0

Similar boards

  • 2 layers24.4 × 24.4 mmOSO SWAT B1, the printed circuit board in 3D

    OSO SWAT B1

    joeycastillo/Sensor-Watch

    A board replacement for the classic Casio F-91W wristwatch

    39 parts2.1k
  • 2 layers33 × 26 mmVL53L1x pwm, the printed circuit board in 3D

    VL53L1x pwm

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    39 parts915
  • 2 layers43.4 × 18.8 mmUsb sniffer lite, the printed circuit board in 3D

    Usb sniffer lite

    ataradov/usb-sniffer-lite

    A simple USB sniffer based on Raspberry Pi RP2040

    39 parts706BSD-3-Clause
  • 2 layers40 × 20 mmESP8266, the printed circuit board in 3D

    ESP8266

    windowsair/wireless-esp8266-dap

    CMSIS-DAP compatible wireless debugger for ESP8266/ESP32/ESP32C3/ESP32S3. Optional 40MHz SPI acceleration, etc. 适配多种ESP芯片的无线调试器

    39 parts690MIT
  • 2 layers100 × 70.3 mmModulAdapterMagnet, the printed circuit board in 3D

    ModulAdapterMagnet

    GaudiLabs/OpenDrop

    Open Source Digital Microfluidics Bio Lab

    39 parts492GPL-3.0
  • 2 layers81.3 × 53.3 mmRGB LED 1.4, the printed circuit board in 3D

    RGB LED 1.4

    lachlanA/eagle-to-kicad

    Eagle SCH/LIB to KiCad SCH/LIB ULP conversion script

    39 parts429GPL-2.0

Questions

How big is the Trigger PCB?

It measures 65.4 × 40.6 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Trigger use?

39 parts, built around the DMG4800LK3-13-VB. 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 Trigger KiCad files?

From the ondrejh/kwokhaus repository on GitHub, at the commit this page was made from: the board is schema/trigger/trigger.kicad_pcb and its schematic schema/motor/motor.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Trigger design in my own project?

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