Skip to content
Solid State Relay Module Raspberry Pi HAT - Industrial Control & Home Automation
PHP HTML CSS JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gui
img
CNAME
LICENSE
README.md
index.html

README.md

CTRL-HAT

CTRL HAT Animated

A Raspberry Pi HAT I/O board specifically designed for use with Crydom style SIP PCB mounted solid state relays (SSRs).

This project is an evolution of previous I/O & relay interface boards we have created primarily for home automation purposes. We saw a need for a low cost high current capacity solid state relay control board for switching inductive loads such as motorised blinds, without the need for costly extra hardware such as SSR modules or contactors. CTRL HAT is ideally suited to automation or industrial control applications requiring high-speed switching, or switching of loads not suitable for regular mechanical relays, such as motors, power supplies, or noise sensitive equipment such as amplifiers.

Features

  • Support 4 Industry Standard SIP type Solid State Relays per CTRL HAT
  • Easy to use interactive web GUI
  • Stackable. Up-to eight CTRL HATs can be used with a single Raspberry Pi
  • 16-port GPIO expander
  • 5V / 3.3V GPIO voltage selection via jumper
  • Supports range of SSR control voltages
  • Can be used with any MCP23017 compatible host device
  • Built-in user programmable ID EEPROM
  • Support for multiple connector types
  • Conforms to Raspberry Pi HAT Specifications
  • Enormous range of applications

Why Solid State Relays?

  • Low Power – Up-to 32 SSRs using 8 CTRL HATs on a single Raspberry Pi, with a single power supply!
  • Low Noise – SSRs generate minimal electrical noise compared to mechanical relays
  • High Speed – SSRs typically switch around 100 times faster than mechanical relays with no contact bounce
  • Reliability – High resistance to shock & vibration makes SSRs suitable for use in demanding environments
  • Opto-Isolated – Typical opto-osolation of > 4000VAC
  • Zero Sparks – SSRs do not generate electrical arcs or sparks like mechanical relays
  • Zero Noise – No moving parts means completely silent switching operation
  • Life Expectancy – Increased operational cycles compared to mechanical relays

Typical Applications

  • High speed and frequent switching operations
  • Applications in high vibration environments
  • Applications near sensitive electronic components
  • Dusty or humid environments
  • Hazardous locations

Interactive Web GUI

CTRL HAT Web GUI

Once installed on your Raspberry Pi, this interactive GUI allows quick & easy control of your CTRL HAT without the need for any coding. It is designed to be both a user guide & quick reference to the CTRL HAT pinout. The GUI is fully responsive and adapts to any screen size.

Check-out the Live Demo.

Built-in GPIO Expander

Featuring the well-documented MCP23017 16 channel GPIO expander, CTRL HAT is easy to setup and control via I²C. Channels 0-4 (Group A) are utilised for the solid state relays, giving you an extra 12 GPIOs for each CTRL HAT you have.

Not Just Raspberry Pi

We built CTRL HAT to work with any device featuring an I²C bus, the 2-wire connection makes it easy to connect to your preferred device. It can be used with either 3.3V devices (eg, Raspberry Pi) or 5V devices (eg, Arduino); by selecting the appropriate jumper (see device compatibility).

We believe the Raspberry Pi HAT specification is the perfect footprint. Compact yet familiar, with 4x mounting holes, the option to stack with other Raspberry Pi HATs / pHATs and of course a wide range of compatible cases to choose from.

Known Compatible Solid State Relays

Crydom SSR Mechanical Specifications

Any solid state relay which physically fits onto CTRL HAT and is suited to a control voltage of 5VDC will work. CTRL HAT can also be configured to accept relays with other DC control voltages by using a dedicated power supply (see isolating the relays).

Zero Cross Turn On (Resistive Loads)

Random Turn On (Inductive Loads)

MOSFET (DC Loads)

Maximum Ratings

  • 10A @ 250V (ambient temperature)
  • 16A @ 250V (forced air cooling recommended, ~30° temperature rise)

Exceeding these limits may overload the PCB.

Isolating the Relays

Link Jumper Animated

Removing the LINK jumper from CTRL HAT disconnects 5V power to the solid state relays. This allows you to power the relays independently, but also gives you the option to use solid state relays with other DC control voltages (up to 30V). This opens up a huge range of additional compatible solid state relays for use with your project.

Back-Powering

Using a decent power supply, such as the official Raspberry Pi adaptor, you can expect to pull around 1.5A from the 5V pins on a Raspberry Pi. You can use up to 8 CTRL HATs with a single Raspberry Pi. That's up to 32 solid state relays, 32 LEDs and 8 GPIO expanders which all need power. It's easy to see how quickly we can go over the limit, especially if the GPIO expanders are used to drive other devices. Back-powering can solve this.

The easiest way to back-power CTRL HAT is using the 5V power pins. However there are some other options.

Back-Powering with Terminal

Use one of the 5.08mm pitch terminal blocks in-place of relay channel 3. You must also solder the BACK-PWR jumper on the underside of the board for this to work.

Back-Powering Supplementary

Alternatively, solder directly to the supplementary power-in pads as shown above, but DO NOT solder the BACK-PWR jumper!

I²C Addressing

Address A2 A1 A0
0x20
0x21
0x22
0x23
0x24
0x25
0x26
0x27

Device Compatibility

CTRL HAT is fully compatible out of the box with most Raspberry Pi models and clones.

Device Model Compatibility
Raspberry Pi Model A ⚠️
Requires 26-way adaptor
Raspberry Pi Model B ⚠️
Requires 26-way adaptor
Raspberry Pi 1 Model A+ ✔️
Raspberry Pi 1 Model B ✔️
Raspberry Pi 1 Model B+ ✔️
Raspberry Pi 2 Model B ✔️
Raspberry Pi 3 Model B & 3+ ✔️
Raspberry Pi 4 ✔️
Raspberry Pi Zero ✔️
Asus Tinker Board ✔️
Orange Pi ✔️
Odroid ✔️

GPIO Voltage Jumper Animated

To use with Arduino or any other 5V device the 3V3 jumper must be moved to 5V. Use the SDA & SDL breakout pins for I²C communication.

Mechanical

Mechanical Drawing

Known Compatible Cases

  • ModMyPi Modular RPi 2/3 Case

There are countless cases compatible with CTRL HAT, limited only by the height of the solid state relays used.

Web GUI Installation

Prerequisites

Raspberry Pi with Raspian: https://www.raspberrypi.org/downloads/raspbian/

I recommend a clean Raspian install before proceeding.

sudo bash

Update Raspian

apt-get update
apt-get upgrade

Install Apache components

apt-get install apache2 php5 libapache2-mod-php5

Install WiringPi

apt-get install git-core -y

Get repo

git clone git://git.drogon.net/wiringPi

Build WiringPi

cd wiringPi
git pull origin
./build

Before proceeding, check WiringPi is working correctly.

gpio -v
gpio readall

Install SVN

apt-get install subversion

Clone Repo Contents

cd /var/www/html

Empty default Apache files

rm -rf *

Clone repo

svn checkout https://github.com/plasmadancom/CTRL-HAT/trunk/gui .

Be sure to set file permissions to 755 in the web directory.

chmod -R 755 /var/www

Apache requires sudo permission to use WiringPi. Note: If your Raspberry Pi is on a shared network you may want to find a more secure method than this.

echo "www-data ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

Optional: install vsftpd for easier file editing

apt-get install vsftpd -y

Change user for vsftpd

chown -R pi /var/www

Edit vsftpd.conf

nano /etc/vsftpd.conf

Uncomment the following line:

write_enable=YES

Add the following line:

force_dot_files=YES

Restart vsftpd

service vsftpd restart

Config

There are various configuration options in the config file :/gui/config.php

You can customise the I²C address, GPIO setup, or disable any solid state relay channels you don't need.

License

MIT © Dan Jones - PlasmaDan.com

You can’t perform that action at this time.