Skip to the content
2 layersRelayctl hat, the printed circuit board in 3D

Simple shell scripts to control relays connected to your raspberry pi with a via CLI, cron like scheduler, external switches, REST API and Web-UI.

Copper layers
2
Thickness
1.6 mm
Parts
44
Nets
70
Pads
154
Tracks, vias
232, 5
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
28 Dec 2021
Updated
24 Apr 2022

Overview

Relayctl hat is an open-source printed circuit board by ReinierNel, from the ReinierNel/relayctl repository on GitHub, published under the MIT licence. It is a 2-layer board with 44 parts on 70 nets, routed with 232 tracks and 5 vias.

It is built around the BC548. Its parts include 14 connectors, 12 diodes, 6 resistors, 6 transistors and 6 switches. It belongs with the home automation and IoT boards of this library.

Main components

1

README

README.md

relayctl

text
██████╗ ███████╗██╗      █████╗ ██╗   ██╗ ██████╗████████╗██╗     
██╔══██╗██╔════╝██║     ██╔══██╗╚██╗ ██╔╝██╔════╝╚══██╔══╝██║     
██████╔╝█████╗  ██║     ███████║ ╚████╔╝ ██║        ██║   ██║     
██╔══██╗██╔══╝  ██║     ██╔══██║  ╚██╔╝  ██║        ██║   ██║     
██║  ██║███████╗███████╗██║  ██║   ██║   ╚██████╗   ██║   ███████╗
╚═╝  ╚═╝╚══════╝╚══════╝╚═╝  ╚═╝   ╚═╝    ╚═════╝   ╚═╝   ╚══════╝

Simple shell scripts to control relays connected to your raspberry pi with a via CLI, cron like scheduler, external switches REST API and a WEB UI.

tests version stable branch

Requirements

Compatible Raspberry Pi Boards

Operating System

Installation

Connect

  1. Connect your relay’s control circuit to one of the GPIO pins marked with O and GND, max 6 relays at this time.
  2. Connect your exnternal switches to GPIO pins makred with I and +5V, max 6 exnternal switches at this time
text
                  Pin Pin
           +3V3 [ ]1   2[ ] +5V
 SDA1 / GPIO  2 [ ]3   4[ ] +5V
 SCL1 / GPIO  3 [ ]5   6[ ] GND
        GPIO  4 [ ]7   8[ ] GPIO 14 / TXD0
            GND [ ]9   0[ ] GPIO 15 / RXD0
        GPIO 17 [O]11 12[O] GPIO 18
        GPIO 27 [O]13 14[ ] GND
        GPIO 22 [O]15 16[O] GPIO 23
           +3V3 [ ]17 18[O] GPIO 24
 MOSI / GPIO 10 [ ]19 20[ ] GND
 MISO / GPIO  9 [ ]21 22[I] GPIO 25
 SCLK / GPIO 11 [ ]23 24[ ] GPIO  8 / CE0#
            GND [ ]25 26[ ] GPIO  7 / CE1#
ID_SD / GPIO  0 [ ]27 28[ ] GPIO  1 / ID_SC
        GPIO  5 [I]29 30[ ] GND
        GPIO  6 [I]31 32[I] GPIO 12
        GPIO 13 [I]33 34[ ] GND
 MISO / GPIO 19 [ ]35 36[ ] GPIO 16 / CE2#
        GPIO 26 [I]37 38[ ] GPIO 20 / MOSI
            GND [ ]39 40[ ] GPIO 21 / SCLK

Boot and Install

Boot Raspberry Pi OS once logged in you can install relayct using the following command.

bash
curl -s https://raw.githubusercontent.com/ReinierNel/relayctl/main/setup.sh | sudo bash

This start an interactive wizard, follow the prompts to install relayctl

Uninstall

Update rc.local

Remove the following entrys from rc.local

bash
/etc/relayctl/relayctl.sh test
/etc/relayctl/scheduler.sh &
/etc/relayctl/external.sh &

Delete relayctl folder

delete the relayctl folder in /etc

bash
sudo -rf /etc/relayct

Uninstall Nginx, fcgiwrap and jq

If you enabled the API during the install process you will need uninstall the following packages

  • nginx
  • fcgiwrap
  • jq

run the folloing command to do so

bash
sudo apt remove -y nginx fcgiwrap jq

Delete the cgi api script

Finaly you will need to delete the CGI api script

bash
rm -f /usr/lib/cgi-bin/api.cgi

More

For detailed instructions please see the Wiki, If you have any Questions or concerns please create an issue here.

Parts

44
QtyValueFootprintReferences
7Screw_Terminal_01x02TerminalBlock_RND:TerminalBlock_RND_205-00241_1x02_P10.16mm_HorizontalJ6, J8, J9, J10, J11, J12, J13
6100 OhmResistor_THT:R_Axial_DIN0414_L11.9mm_D4.5mm_P15.24mm_HorizontalR0, R1, R2, R3, R4, R5
61N4001Diode_THT:D_DO-41_SOD81_P10.16mm_HorizontalD0, D1, D2, D3, D4, D5
6BC548Package_TO_SOT_THT:TO-92_InlineQ0, Q1, Q2, Q3, Q4, Q5
6LEDLED_THT:LED_D3.0mmD6, D7, D8, D9, D10, D11
6RAYEX-L90SRelay_THT:Relay_SPDT_RAYEX-L90SK0, K1, K2, K3, K4, K5
6Screw_Terminal_01x02TerminalBlock:TerminalBlock_Altech_AK300-2_P5.00mmJ0, J1, J2, J3, J4, J5
1Raspberry_Pi_2_3relayctl-hat:raspberrypi_2_3J7

Similar boards

  • 2 layers178 × 145 mmUltra DB X51 v1, the printed circuit board in 3D

    Ultra DB X51 v1

    ExploreEmbedded/8051_DevelopmentBoard

    Design files and sample code for 8051 development Ultra Boards

    145 parts70
  • 2 layers131.8 × 99.9 mmUps-12v, the printed circuit board in 3D

    Ups-12v

    dilshan/12v-automatic-ups

    12V Automatic UPS system

    77 parts50MIT
  • 4 layers99.6 × 99.8 mm3xosc, the printed circuit board in 3D

    3xosc

    aliqut/3xosc

    3xOsc | 3 VCO Eurorack Module

    92 parts40GPL-3.0
  • 2 layers200 × 96 mmTouchtone555, the printed circuit board in 3D

    Touchtone555

    DarcyJProjects/touchtone555

    An open-source DIY, NE555-based analogue synthesizer - play notes with a stylus

    73 parts33
  • 2 layers177.8 × 130.8 mmDurango, the printed circuit board in 3D

    Durango

    zuiko21/minimOS

    Scalable OS for 6502/65816

    159 parts23MIT
  • 2 layers236.8 × 169.8 mmTK2000, the printed circuit board in 3D

    TK2000

    clemarfolly/Microdigital-TK2000

    Reprodução da PCB do TK-2000 da Microdigital, clone do Micro-Professor MPF-II

    212 parts17
  • 2 layers100 × 65.5 mmSodaIDE v2 konami case, the printed circuit board in 3D

    SodaIDE v2 konami case

    Danjovic/Soda-IDE

    8 bit Compact Flash Interface for MSX computers

    30 parts11CC0-1.0
  • 2 layers213 × 130 mmMax48 ISSUE4, the printed circuit board in 3D

    Max48 ISSUE4

    alvaroalea/all-spectrum-clones

    Schematic of a 8bit computer, clone of Sinclair ZX Spectrum

    186 parts10

Questions

What parts does the Relayctl hat use?

44 parts, built around the BC548. 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 Relayctl hat KiCad files?

From the ReinierNel/relayctl repository on GitHub, at the commit this page was made from: the board is hat/relayctl-hat/relayctl-hat.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Relayctl hat design in my own project?

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