Skip to content

About

Raspberry Pi 3 Switch Cabinet

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Raspberry Pi 3 Switch Cabinet


This was a project I built a few years back when I wanted a clean way to control outlets to my computer equipment and some Zigbee devices from a Raspberry Pi. The idea was to put everything in a DIN-rail cabinet so the high-voltage wiring is enclosed, and let the Pi handle the switching logic. This project would not have been possible without my dear friend Dennis M. who helped me source and integrate parts.

Cabinet build photo


The 230 V side comes into the cabinet through an M20 cable gland and goes through a circuit breaker first, then through some Wago terminal blocks for distribution. From there each outlet is switched individually through a 230 V relay, which itself is switched by a smaller 5V relay. This is done to make the system more secure. The 5 V coil runs directly off the Pi without needing any extra power supply and controlls the 230V relay. The 230V relay's contacts handle the load side, so the two circuits stay fully isolated and high current never reaches the smaller relay which may not be rated for it. The actual outlets are flush-mount sockets mounted on the cabinet. On the control side, the Pi talks to the relay coils via GPIO,

The Raspberry Pi 3 uses Raspberry Pi OS (Trixie) and has Homebridge installed to control the outlets via a web interface or IOS devices. With Homebridge the Pi can also start a PC with Wake-On-LAN and with an additonal Zigbee receiver (e.g. SONOFF Zigbee 3.0 USB DonglePlus V2) it can also control Zigbee devices over the network (with Zigbee2MQTT). With Guacamole the Raspberry Pi can connect to hosts on the local network (and itself) with Remote Desktop or SHH via a web interface. Every service is running behind nginx as a regular web server which a unified web interface and it is reachable via a custom domain. The entire software stack is hosted in this repository and should work out of the box, all services are hosted inside containers and are defined inside docker-compose.yml. To install it get a fresh Raspberry Pi OS image and run ./setup.sh (caveat: the script uses fixed names e.g. for my router which need to be changed)

Cabinet wiring diagram


Notes

  • The power supply is rather weak which means the Pi sometimes throttles. You can try to increase the voltage slightly or buy a more powerful power supply, however, I have not had any problems even if the Pi is throttled.
  • To put the 5v relays on the Pi buy the ones with a DIN-rail mount or 3D-print one.
  • Same goes for the Raspberry Pi. You can buy or print DIN-rail mounts. I did not print mine by myself I got mine from a friend, however, but I was able to find replacements online. I linked them in the parts list below.

Parts

Part Detail Amount
Empty Housing 220 x 170 x 60 Legrand Housing 297 1x
Connection Cable with Plug Rubber Hose Cable H05RR-F3G1.5 - 3 Cores - IP20 1x
Cable gland M20 + lock nut - 1x
Flush-mount socket 230 V / 16 A AS-Schwabe Anbausteckdose, Schutzkontakt, schwarz — Schwabe 45081 2x
DIN rail flat - 2x
Terminal block 3-wire Wago 2002-1301 1x
Terminal block 2-wire Wago 2002-1201 1x
 Circuit Breaker ABB AUTOMAT (S 201-C4) 1x
230V Relay Heschen Household AC Contactor CT1-25 Ie 25A 2 Pole  2x
 5V Power supply MEAN WELL HDR-15-5 Ultra Slim Step-Shape 1SU DIN Rail  1x
5v micro-USB cable - 1x
Din-rail mount  https://remoteqth.com/3d-din-rail-mount-clip.php 2x
Raspberry Pi 3b - 1x
GPIO Cable - 6x 
5v Relay SRD-05VDC-SL-C 2x
Relay DIN-rail mount https://www.thingiverse.com/thing:3001457  2x
(Optional) USB extension cord - 1x
(Optional) Ethernet extension cord - 1x 
(Optional) Zigbee USB coordinator SONOFF Zigbee 3.0 USB DonglePlus V2 1x

About

Raspberry Pi 3 Switch Cabinet

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages