Universal Relay Prop for Escape Room with Arduino Mega 2560 connected with Dragino Yún, Ethernet or WiFi shield.
In your Escape Room, PiPyRelayProp centralizes the control of your main relays:
- lights
- electricity
- maglocks (doors)
- smoke machines (warmp-up and shots)
No coding is required, the relay outputs are configured with the PyRelayControl wiring GUI and the commands can be triggered with the PyRelayControl panel or a regular control panel for Room by xcape.io users.
- Prepare Arduino IDE and Mega 2560
- Installation for Dragino Yún, Ethernet or WiFi Shield
- Relay Prop wiring and control panel
- Relay modules
- Prop commands
- Prop data messages
- Prop configuration for Room by xcape.io
You will find instructions in the ArduinoProps.md (1. Installation and usage) to install:
- ArduinoProps library
- PubSubClient library
- ListLib library
Then add Dragino Shield boards in the Boards Manager, adding package_dragino_yun_test_index.json
to Additional Boards Manager URLs in Preferences:
URL to add: http://www.dragino.com/downloads/downloads/YunShield/package_dragino_yun_test_index.json
Then you need to install ArduinoJson library:
Download RelayProp-master.zip
, the sketch MegaRelayProp.ino
is in the MegaRelayProp folder in RelayProp/MegaRelayProp/
.
Advanced users may clone the https://github.com/xcape-io/RelayProp repository.
Open the MegaRelayProp.ino
sketch in the Arduino IDE to set MQTT topics for your Escape Room:
MegaRelayProp prop(MegaRelayProp::Bridge,
u8"Relay Mega", // as MQTT client id, should be unique per client for given broker
u8"Room/My room/Props/Relay Mega/inbox",
u8"Room/My room/Props/Relay Mega/outbox",
u8"Room/My room/Props/Relay Mega/wiring/#",
"192.168.1.53", // your MQTT server IP address
1883); // your MQTT server port;
Then upload the sktech to the Relay Mega board.
D0 (RxD) and D1 (TxD) are used by the Arduino Bridge connection, other I/O pins are available.
If Dragino Yún Shield has not been setup in Arduino IDE yet, see Add Dragino Yún + Mega 2560 board to Arduino IDE boards manager in the README of ArduinoProps library.
If you are not familiar with Yún (a Linux SoC bridged to the MCU), you will find help:
- Dragino Yún Shield Wiki
- Arduino Yún Board Setup and Demo at Medium
- Getting Started with the Arduino Yún at arduino.cc
- Getting Started With Arduino Yún - Video tutorial on YouTube
Open the MegaRelayProp.ino
sketch in the Arduino IDE to set MQTT topics for your Escape Room:
MegaRelayProp prop(MegaRelayProp::Ethernet,
u8"Relay Mega", // as MQTT client id, should be unique per client for given broker
u8"Room/My room/Props/Relay Mega/inbox",
u8"Room/My room/Props/Relay Mega/outbox",
u8"Room/My room/Props/Relay Mega/wiring/#",
"192.168.1.53", // your MQTT server IP address
1883); // your MQTT server port;
Then upload the sktech to the Relay Mega board.
All I/O pins are available, the Ethernet shield is connected to Arduino with SPI port.
Open the MegaRelayProp.ino
sketch in the Arduino IDE to set MQTT topics for your Escape Room:
MegaRelayProp prop(MegaRelayProp::WiFi,
u8"Relay Mega", // as MQTT client id, should be unique per client for given broker
u8"Room/My room/Props/Relay Mega/inbox",
u8"Room/My room/Props/Relay Mega/outbox",
u8"Room/My room/Props/Relay Mega/wiring/#",
"192.168.1.53", // your MQTT server IP address
1883); // your MQTT server port;
Then upload the sktech to the Relay Mega board.
All I/O pins are available, the WiFi shield is connected to Arduino with SPI port.
All relay outputs are setup with the PyRelayControl GUI:
See PyRelayControl
See RELAY_MODULES.md
Commands are implicitly defined with the PyRelayControl GUI, you can create group commands by naming variables in groups with the /
separator.
Relay commands are built from the variable name:
props:on
: power on the propssmoke/on:1
: ower on the smoke machinesmoke/fog:1
: release fog from the smoke machine
Group commands uses the /*
tag:
maglock/*:0
: release all the maglocksdoor/*:0
: open all the doors
Relay state variables are sent as defined with the PyRelayControl GUI, as well as the board and settings informations:
wiring:
0: not configured
1 to 50: number of pins configured
board:
Mega: Mega 2560 with Ethernet/WiFi shield
Mega with bridge: Mega 2560 with Dragino Yún shield
For example:
board=Mega with bridge
wiring=9
Room by xcape.io users can add the Relay Pi prop to their props:
And create a regular control panel:
Relay Prop on Arduino Mega 2560 + Ethernet Shield.
Relay Prop on Arduino Mega 2560 + WiFi Shield.
Faure Systems (Apr 26th, 2020)