No-code prop and control panel to command relays with Arduino Mega 2560 or STM32 Nucleo 144 or Raspberry Pi board.
For either the Arduino Mega or the Raspberry Pi, you just have to install the code provided in MegaRelayProp or NucleoRelayProp or PiPyRelayProp.
Use PyRelayControl GUI app on Windows or Linux desktop (Mac OSX should work too) to configure the Arduino Mega or the Raspberry Pi board and your wiring.
The configuration is stored locally in a JSON file and in a topic of the MQTT broker.
This repository contains 4 projects:
- MegaRelayProp: Relay Prop on Arduino Mega 2560
- NucleoRelayProp: Relay Prop on STM32 Nucleo 144
- PiPyRelayProp: Relay Prop on Raspberry Pi (3B/3B+/4)
- PyRelayControl: control panel for Relay Prop
And a guide for relay modules:
- Choose if you will use Arduino Mega or Raspberry Pi board
- Intall on your local network, either:
- Install an MQTT broker on your local network, eihter:
- Install PyRelayControl on your desktop
- Start PyRelayControl GUI and configure your relays wiring (GPIO)
- Upload the wiring to the MQTT broker (one-click)
- Automatically build the control panel widgets (one-click)
- Customize the control panel widgets (labels and images)
- Enjoy controlling your relays from the control panel
Our goal is to give most of the electrical control to a central accessory located near the Game Master's computer or in the room's central electric cabinet.
- Provide power reboot for in-room props
- Most of relay modules are centralized and accessible
- Centralized 12V supply for door maglocks
- Reduce support costs with centralization and accessibility
- Centralized power shutdown to reduce electricity bills
- Inexpensive to wire the escape room like a house (star wiring)
For the Relay prop we recommend and provide code for Raspberry Pi and Arduino Mega.
Good choice for Python enthusiasts because we need an MQTT broker for the Escape Room and the Relay Prop on a Raspberry board can run the mosquitto
broker.
Raspberry Pi doesn't expose a lot of pins:
- 25 pins available
- 39 pins with one 16 Pins I/O Expanders with MCP23017 connected thru I2C
- Pins are 3.3V
Examples of MCP23017 expanders:
Good choice for people who prefer coding Arduinos rather than Python.
Arduino Mega 2560 expose a lot of I/O:
- 50 pins available (48 with Dragino Yún Shield)
- we don't use analog pins (due to Arduino memory constraints)
WiFi shield may not make much sense because in central wiring you should have a centralized Ethernet switch.
You can use the Ethernet shield coupled to a USB cable connecting the Arduino Mega to the Game Master computer. Thus, you can program the Arduino Mega from the Game Master computer and possibly remotely with TeamViewer.
With the Dragino Yún shield, you don't need a USB cable to program the Arduino Mega from the Game Master computer and possibly remotely with TeamViewer (this is what we recommend for in-room Arduino props).
D0 (RxD) and D1 (TxD) are used by the Arduino Bridge connection. Ethernet and WiFi shield are connected to Arduino with SPI port.
Good choice to save money (Nucleo boards cost $20 including Ethernet RJ45), tinkerers can code as simply as Arduinos with Arduino IDE with STM32duino libraries. Advanced IoT/embedded coders can use the power of the STM32 F7 with STM32CubeIDE.
STM32 Nucleo-144 expose a lot of I/O:
- 73 pins available on ST Zio connector including support for Arduino Uno V3
For the Relay Prop Arduino sketch to run on Arduino Mega 2560 see MegaRelayProp.ino
sketch in MegaRelayProp.
The MegaRelayProp.ino
sketch includes MegaRelayProp
class that extends Props
class from ArduinoProps library.
The Relay Prop inbox/outbox MQTT topics are:
Room/[escape room name]/Props/[props name]/inbox
Room/[escape room name]/Props/[props name]/outbox
Room/[escape room name]/Props/[props name]/wiring/#
example:
Room/My Room/Props/Relay Mega/inbox
Room/My Room/Props/Relay Mega/outbox
Room/My Room/Props/Relay Mega/wiring/#
MegaRelayProp.ino
sketch supports:
- Arduino Mega 2560 + Dragino Yún Shield
- Arduino Mega 2560 + Ethernet Shield
- Arduino Mega 2560 + WiFi Shield
See MegaRelayProp: Relay Prop on Arduino Mega 2560.
For the Relay Prop Arduino sketch to run on STM32 Nucleo 144 see NucleoRelayProp.ino
sketch in NucleoRelayProp.
The NucleoRelayProp.ino
sketch includes NucleoRelayProp
class that extends Props
class from ArduinoProps library.
The Relay Prop inbox/outbox MQTT topics are:
Room/[escape room name]/Props/[props name]/inbox
Room/[escape room name]/Props/[props name]/outbox
Room/[escape room name]/Props/[props name]/wiring/#
example:
Room/My Room/Props/Relay Nucleo/inbox
Room/My Room/Props/Relay Nucleo/outbox
Room/My Room/Props/Relay Nucleo/wiring/#
NucleoRelayProp.ino
sketch supports:
- STM32 Nucleo 144 (tested with STM32F767ZI)
See NucleoRelayProp: Relay Prop on STM32 Nucleo 144.
PiPyRelayProp is the Python application to run on Raspberry Pi for the Relay Prop.
The Relay Prop inbox/outbox MQTT topics are:
Room/[escape room name]/Props/[props name]/inbox
Room/[escape room name]/Props/[props name]/outbox
Room/[escape room name]/Props/[props name]/wiring
example:
Room/My Room/Props/Relay Pi/inbox
Room/My Room/Props/Relay Pi/outbox
Room/My Room/Props/Relay Pi/wiring
See PiPyRelayProp: Relay Prop on Raspberry Pi (3B/3B+/4).
PyRelayControl is the prop control panel for the Relay Prop, it's a PyQt5 GUI application to configure the Relay Prop.
We usually run PyRelayControl on Windows but you can install and run it on Linux and Mac, PyQt5 installation on Mac can be tricky.
You can run PyRelayControl as a plugin for xcape.io Room.
- Add MPC23017 support
- Add Mega without bridge support
Faure Systems (Jun 4th, 2020)