Skip to the content
2 layers50 × 53 mmKha remote, the printed circuit board in 3D

Kha remote

kiu/kha5

Overengineered Modular RS-485 Multi-Master 19" Subrack Home Automation / Control

Size
50 × 53 mm
Copper layers
2
Thickness
1.6 mm
Parts
29
Nets
42
Pads
125
Tracks, vias
205, 24
Pours
2
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
16 Apr 2023
Updated
1 Nov 2026

Overview

Kha remote is an open-source printed circuit board by kiu, from the kiu/kha repository on GitHub. It is a 2-layer board of 50 × 53 mm with 29 parts on 42 nets, routed with 205 tracks and 24 vias.

It is built around the AVR64DD32-I/PT, AP63205WU and SP481ECN, with the MIC5504-3.3YM5 and DMG2301L among its other parts. Its parts include 10 capacitors, 5 connectors, 4 resistors, 4 ICs and 2 transistors. It belongs with the interfaces and adapters boards of this library.

Main components

5

README

README.md

kha

Overengineered Modular RS-485 Multi-Master 19" Subrack Home Control

Repository

Hint: "bgt" is German for Baugruppenträger translating to subrack assembly

Protocol

RS-485 at 500 kbaud (8N1), half duplex, every node may send. Commands, addresses and registers are listed in kha-protocol.ods.

Frame

text
0x42 0x99 <len> <from> <to> <cmd> <payload ...> <crc>
  • 0x42 0x99 starts a frame. Inside a frame every 0x42 is followed by an extra 0x66, so 0x42 0x99 is always a start. The escape bytes are not counted and not part of the CRC.
  • len counts len, from, to, cmd, payload and crc: 5 + payload, payload up to 67 bytes.
  • CRC-8 (polynomial 0x31, init 0xFF, no final XOR) over all bytes from len to the last byte before the CRC.

Bus access

  • The stack counts 100 µs ticks on TCB2, which is reserved for the stack. Every falling edge on RX resets the count.
  • A node sends once the bus has been quiet for 10 + its own address ticks (1 ms + address × 100 µs). Addresses are unique, so no two nodes wait for the same slot.
  • After sending, a node waits once for the longest slot (10 + 0xF0 ticks), so the others get their turn first.
  • The bootloader commands F9–FC skip the slot wait to keep flashing fast: send TX off (F0) to the other nodes before flashing.

Firmware

  • Flash: bootloader at 0x0000–0x3FFF, app at 0x4000–0xFFFF. At every boot a node computes a CRC-32 over 0x4000–0xFFFF (without the final XOR) and reports it with the boot and app versions in its UP (E2) and ident (E1).
  • Bootloader: after a reset it waits 4 s for bootloader commands (FD keeps it there), then starts the app. Brown-out detection at 2.85 V. No lock bits, so UPDI can read and write a node.
  • Flashing over the bus: kha_fw.py; via UPDI: kha_updi.py.

Bus health page

kha-web shows the state of every node on a static web page: missing nodes, error counters, days since the last reboot, and whether nodes of the same board type run the same firmware. A collector follows the gateway's log passively, keeps the state in SQLite and exports a JSON file for the page. Screenshot with mock data:

Videos

Two hour deep dive lecture style video on youtube: https://youtu.be/BUSnTUGKZzc

kha on youtube

Photos

Misc

  • All PCBs use eAVR as connector for AVR flashing
  • It all started simple with lightdesk

Todo

  • Node: LED marquee node
  • Node: IrDA bridge (bridging the bus through a window)
  • Stack: Combine queued TX commands into single burst?
  • Stack: Merge similiar queued TX commands into single command?
  • Stack: Process TX commands as incoming RX commands?

Regrets

  • Terrible collision detection / avoidance
  • Buck converter capacitor generates audible noise

License

This project is licensed under the Creative Commons Attribution-NonCommercial 3.0 Unported (CC BY-NC 3.0) license.

Parts

29
QtyValueFootprintReferences
4RResistor_SMD:R_0805_2012MetricR1, R2, R3, R4
3100nFCapacitor_SMD:C_0805_2012MetricC2, C3, C5
21uFCapacitor_SMD:C_0805_2012MetricC9, C10
2DMG2301LPackage_TO_SOT_SMD:SOT-23Q1, Q2
2MountingHoleMountingHole:MountingHole_3.2mm_M3_DIN965H1, H2
2RJ45_Shieldedkiu-footprints:GDLX-S-88KJ4, J5
110nFCapacitor_SMD:C_0805_2012MetricC1
110uFCapacitor_SMD:C_0805_2012MetricC6
1220uFCapacitor_Tantalum_SMD:CP_EIA-6032-28_Kemet-CC8
14.7uHInductor_SMD:L_1210_3225MetricL1
1470uFCapacitor_SMD:CP_Elec_6.3x7.7C4
147uFCapacitor_SMD:C_1210_3225MetricC7
1AP63205WUPackage_TO_SOT_SMD:TSOT-23-6U3
1AVR-UPDI-6eAVR:eAVR6-UPDI-FJ3
1AVR64DD32Package_QFP:TQFP-32_7x7mm_P0.8mmU1
1Conn_01x03TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3-5.08_1x03_P5.08mm_HorizontalJ1
1Conn_01x04Connector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_VerticalJ2
1MIC5504-3.3YM5Package_TO_SOT_SMD:SOT-23-5U4
1PolyfuseFuse:Fuse_0805_2012MetricF1
1SP481EPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU2

More from kiu/kha

12
  • 2 layers240 × 100 mmKha bgt extend, the printed circuit board in 3D

    Kha bgt extend

    kiu/kha

    Overengineered Modular RS-485 Multi-Master 19" Subrack Home Automation / Control

    69 parts5
  • 2 layers425.5 × 128.3 mmKha bgt backplane, the printed circuit board in 3D

    Kha bgt backplane

    kiu/kha

    Overengineered Modular RS-485 Multi-Master 19" Subrack Home Automation / Control

    67 parts5
  • 2 layers426.7 × 128.3 mmKha bgt backplane, the printed circuit board in 3D

    Kha bgt backplane

    kiu/kha

    Overengineered Modular RS-485 Multi-Master 19" Subrack Home Automation / Control

    67 parts5
  • 2 layers70 × 58 mmKha led ikea node, the printed circuit board in 3D

    Kha led ikea node

    kiu/kha

    Overengineered Modular RS-485 Multi-Master 19" Subrack Home Automation / Control

    33 parts5
  • 2 layers320 × 11 mmKha led ikea kallax, the printed circuit board in 3D

    Kha led ikea kallax

    kiu/kha

    Overengineered Modular RS-485 Multi-Master 19" Subrack Home Automation / Control

    32 parts5
  • 2 layers48 × 50 mmKha led ikea node, the printed circuit board in 3D

    Kha led ikea node

    kiu/kha

    Overengineered Modular RS-485 Multi-Master 19" Subrack Home Automation / Control

    31 parts5
  • 2 layers160 × 100 mmKha bgt generic base, the printed circuit board in 3D

    Kha bgt generic base

    kiu/kha

    Overengineered Modular RS-485 Multi-Master 19" Subrack Home Automation / Control

    30 parts5
  • 2 layers350 × 33 mmKha led ikea oxberg40, the printed circuit board in 3D

    Kha led ikea oxberg40

    kiu/kha

    Overengineered Modular RS-485 Multi-Master 19" Subrack Home Automation / Control

    30 parts5
  • 2 layers50 × 50 mmKha led ikea node, the printed circuit board in 3D

    Kha led ikea node

    kiu/kha

    Overengineered Modular RS-485 Multi-Master 19" Subrack Home Automation / Control

    30 parts5
  • 2 layers48 × 50 mmKha led ikea node, the printed circuit board in 3D

    Kha led ikea node

    kiu/kha

    Overengineered Modular RS-485 Multi-Master 19" Subrack Home Automation / Control

    28 parts5
  • 2 layers200 × 10.2 mmKha led ikea rx4, the printed circuit board in 3D

    Kha led ikea rx4

    kiu/kha

    Overengineered Modular RS-485 Multi-Master 19" Subrack Home Automation / Control

    28 parts5
  • 2 layers160 × 100 mmKha bgt audio base, the printed circuit board in 3D

    Kha bgt audio base

    kiu/kha

    Overengineered Modular RS-485 Multi-Master 19" Subrack Home Automation / Control

    25 parts5

Similar boards

  • 2 layers86.4 × 61 mmTalking counter, the printed circuit board in 3D

    Talking counter

    swharden/USB-Counter

    Open-source USB frequency counter

    60 parts25MIT
  • 2 layers18 × 43 mmNano DD32, the printed circuit board in 3D

    Nano DD32

    akouz/HBnode

    Microcontroller boards for HBus

    22 partsMIT
  • 2 layers40.6 × 63.5 mmPressureSensor, the printed circuit board in 3D

    PressureSensor

    swharden/PressureSensor

    Minimal complexity standalone digital pressure sensor

    25 partsMIT
  • 4 layers50 × 100 mmCRVFCU, the printed circuit board in 3D

    CRVFCU

    Kev1n8088/CRVFCU

    161 parts
  • 4 layers92.5 × 101.6 mmVCU, the printed circuit board in 3D

    VCU

    formulaslug/fs-4-schematics

    Electrical Design Repository for fs-4 schematics and PCBs

    225 parts7
  • 2 layers167.8 × 115 mmSubmarine PCB, the printed circuit board in 3D

    Submarine PCB

    RoanB14/Underwater-ROV

    Designed a custom STM32-based tethered ROV control system with a KiCad PCB integrating power regulation, motor driver interfaces, and an MPU-6050 IMU.

    62 parts
  • 4 layers70 × 72 mmSPINC AA Charger, the printed circuit board in 3D

    SPINC AA Charger

    CoretechR/SPINC

    DIY Automatic Battery Charger Using RP2040

    101 parts467GPL-3.0
  • 4 layers70 × 54 mmPicoLab, the printed circuit board in 3D

    PicoLab

    CoretechR/PicoLab

    Web-GUI Embedded Multitool

    285 parts327GPL-3.0

Questions

How big is the Kha remote PCB?

It measures 50 × 53 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Kha remote use?

29 parts, built around the AVR64DD32-I/PT, AP63205WU, SP481ECN and MIC5504-3.3YM5. 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 Kha remote KiCad files?

From the kiu/kha repository on GitHub, at the commit this page was made from: the board is kha-nodes/kha-remote/kicad/kha-remote.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Kha remote design in my own project?

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