Skip to the content
PCBKitNew board
2 layers71.5 × 23 mmRelay, the printed circuit board in 3D

Tiny C99 library which allows you to use existing audio channels for digital transmission. The project was presented and defended at the national round of the SOČ competition and at the TMR UNIZA competition.

Size
71.5 × 23 mm
Copper layers
2
Thickness
1.6 mm
Parts
23
Nets
19
Pads
62
Tracks, vias
75, 0
Pours
60
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
30 Sep 2024
Updated
10 Jun 2026

Overview

Relay is an open-source printed circuit board by Servacek, from the Servacek/tinytus repository on GitHub. It is a 2-layer board of 71.5 × 23 mm with 23 parts on 19 nets, routed with 75 tracks and 0 vias.

It is built around the ATTINY85-20PU and SRD-05VDC-SL-C. Its parts include 9 resistors, 4 capacitors, 4 diodes, 3 connectors and 1 IC. It belongs with the home automation and IoT boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

2

README

README.md

TinyTUS - Tiny Transmission Using Sound

Small, modular C99 library for transmitting digital data over acoustic channels using FSK modulation. Targets desktop (Windows, Linux), WebAssembly, and embedded platforms.


Features

  • GFSK modulation - configurable bits-per-symbol (1, 2, 4, 8), frequency range, sample rate and symbol rate
  • Reed-Solomon ECC - configurable error correction percentage per frame
  • DSS scrambling - optional data scrambling before encoding
  • AGC - automatic gain control on the receive path
  • Sync detection - marker-based start/end-of-frame detection
  • Builds as an executable, static lib, DLL, or WASM module
  • PortAudio, libusb and the WAV helper are all optional and conditionally compiled

Live Demo

Since this library is compilable also for the web (using WebAssembly), I have built a small static website which shows it's capabilities. You can check it out here: https://servacek.github.io/audiomodem/

Custom hardware

In order to use an radio transceiver for digital communication using this library a special piece of hardware has to be made, which enables the computer to control the PTT circuit of the radio. Here is the schematic of such hardware, I have designed and used during testing with my Allamat 47 handhold CB radios.

image

Note that the value of the resistor R4 depends on the specific radio type used. Or in case you need flexibility, it can be replaced with a suitable trimmer.

Building

Requirements: clang, llvm-lib (Windows), make. PortAudio and libusb prebuilt libraries are included under libs/.

sh
make run    # build and run the main executable
make lib    # build as static library  -> bin/tinytus/lib/tinytus.lib
make dll    # build as DLL             -> bin/tinytus.dll
make web    # build for WebAssembly (requires emsdk, set EMSDK_PATH in Makefile)

Compiler flags can be overridden via dev.config in the repo root (gitignored):

makefile
# dev.config
CFLAGS = -O0 -g

Tests

sh
make tests          # build and run all tests
make test <name>    # build and run one test,  e.g.  make test gfsk
make clean          # remove all build artifacts

Each test is compiled from tests/test_.c against the full source tree. Output goes directly to stdout/stderr.

Available tests:

text
make test gfsk           - full modulate/demodulate round-trip
make test ber            - BER at various SNR levels
make test fsk            - basic FSK / Goertzel demodulation
make test hamming        - Hamming ECC encode/decode
make test frame          - frame packing and unpacking
make test goertzel       - Goertzel frequency detection
make test dss            - data scrambling
make test sync_detector  - sync word detection
make test wav            - WAV file I/O
make test tlv            - modem profile TLV encode/decode
make test modem_profile  - default profile singleton and field checks

New test files dropped into tests/test_*.c are picked up automatically. See tests/helper.h for ok()/fail() helpers, ASSERT macros and section headers.


Quick Example

c
#include <tinytus.h>

void on_received(const uint8_t *bytes, uint8_t n) {
    for (uint8_t i = 0; i < n; i++) putchar(bytes[i]);
    putchar('\n');
}

int main(void) {
    start_listening(NULL, on_received);
    send_payload(NULL, (const uint8_t *)"Hello!", 6);
    while (1) {}
    stop_listening();
    return 0;
}

A more complete example is in examples/simplechat.c.


Configuration

Compile-time knobs are in src/const.h:

text
SAMPLE_BIT_DEPTH          16      sample depth (8 / 16 / 32)
SQUELCH_THRESHOLD         0.01    minimum signal power to attempt decode
MARKER_DETECTION_THRESHOLD 0.4    marker confidence threshold
LIB_PORTAUDIO_ENABLED     1       set to 0 to drop PortAudio
LIB_LIBUSB_ENABLED        1       set to 0 to drop libusb
LIB_WAV_ENABLED           1       set to 0 to drop the WAV helper

Platform Notes

  • Windows - primary target; clang + MSVC CRT linkage
  • Linux - builds with the same Makefile; linker flags may need adjustment
  • WASM - set EMSDK_PATH in Makefile and run make web; PortAudio and libusb are disabled automatically

Parts

23
QtyValueFootprintReferences
2100nFCapacitor_THT:C_Disc_D3.0mm_W2.0mm_P2.50mmC1, C3
23V6Diode_THT:D_DO-41_SOD81_P7.62mm_HorizontalD1, D2
268RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_VerticalR3, R5
110KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1
110KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_VerticalR6
110KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P5.08mm_VerticalR7
110uFCapacitor_THT:C_Disc_D3.0mm_W2.0mm_P2.50mmC2
112KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_VerticalR4
11K5Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR2
11K5Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_VerticalR9
11N5819Diode_THT:D_DO-41_SOD81_P10.16mm_HorizontalD5
11uFCapacitor_THT:C_Disc_D3.0mm_W2.0mm_P2.50mmC5
1220RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P5.08mm_VerticalR8
12N7000Package_TO_SOT_THT:TO-92_InlineQ1
1ATtiny85-20PPackage_DIP:DIP-8_W7.62mm_SocketU1
1LEDLED_THT:LED_D5.0mmD6
1SRD-05VDC-SL-CProjectSpecific:RELAYK1
1USB-A SamecProjectSpecific:USB-A-2.0J1
1VstupProjectSpecific:AudioJackPort3.5mmStereoJ3
1VýstupProjectSpecific:AudioJackPort3.5mmStereoJ2

Questions

How big is the Relay PCB?

It measures 71.5 × 23 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Relay use?

23 parts, built around the ATTINY85-20PU and SRD-05VDC-SL-C. 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 Relay KiCad files?

From the Servacek/tinytus repository on GitHub, at the commit this page was made from: the board is hardware/usb-relay-audio-switch/rev00/relay.kicad_pcb and its schematic hardware/usb-adc-dac-converter-switch/tinnitus.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Relay design in my own project?

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

More from Servacek/tinytus

2
  • 2 layers71.5 × 23 mmRelay, the printed circuit board in 3D

    Relay

    Servacek/tinytus

    Tiny C99 library which allows you to use existing audio channels for digital transmission. The project was presented and defended at the national round of the SOČ competition and at the TMR UNIZA competition.

    22 parts
  • 2 layersTinnitus, the printed circuit board in 3D

    Tinnitus

    Servacek/tinytus

    Tiny C99 library which allows you to use existing audio channels for digital transmission. The project was presented and defended at the national round of the SOČ competition and at the TMR UNIZA competition.

    10 parts

Similar boards

  • 2 layers87 × 71 mmSocket, the printed circuit board in 3D

    Socket

    eddyem/STM8_samples

    Some code samples and ready projects based on STM8 (deprecated)

    89 parts80
  • 2 layers23.2 × 52.1 mmOpenC64Saver, the printed circuit board in 3D

    OpenC64Saver

    SukkoPera/OpenC64Saver

    Protect your Commodore 64 from killer power supplies!

    17 parts79
  • 2 layersApollo, the printed circuit board in 3D

    Apollo

    rigidus/rigidus.ru

    Contacts: email: i.am.rigidus טּ gmail.com jabber: rigidus@jabber.ru

    111 parts20AGPL-3.0
  • 2 layers172.1 × 143.5 mmAcCCS, the printed circuit board in 3D

    AcCCS

    IdahoLabResearch/AcCCS

    A collection of tools and scripts used to communicate and emulate Electric Vehicle Communication Controllers (EVCC) and Supply Equipment Communication Controllers (SECC).

    111 parts19MIT
  • 2 layers98 × 83.8 mmProjeto placa, the printed circuit board in 3D

    Projeto placa

    phfbertoleti/placa_lorawan

    Repositório oficial da placa LoRaWAN, um kit de desenvolvimento para protótipos IoT.

    39 parts19MIT
  • 4 layers97.5 × 99.9 mmEsp32 wled controller, the printed circuit board in 3D

    Esp32 wled controller

    fellettigiacomo/esp32-WLED-4ch-controller

    Open source 4 Channel esp32-powered WLED controller with 4 relays and built in level shifter

    100 parts16CERN-OHL-S-2.0
  • 2 layers65 × 56 mmPrinter HAT, the printed circuit board in 3D

    Printer HAT

    mikenorgate/3d-printer-power-hat

    A Raspberry PI HAT for controlling power to your 3D printer

    38 parts10
  • 2 layers201.3 × 152.1 mmDC DC CONVERTER, the printed circuit board in 3D

    DC DC CONVERTER

    William-Souza-Santos/ADAPTIVE_FUZZY_LOGIC_CONTROL_FOUR_SWITCH_BIDIRECTIONAL_BUCK_BOOST_DC_DC_CONVERTER

    Final Year Project by Electronic Engineering

    95 parts6