Skip to content

Latest commit

 

History

History

MegaRelayProp

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

MegaRelayProp

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

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:

Installation for Dragino Yún, Ethernet or WiFi Shield

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.

Arduino Mega 2560 with Dragino Yún Shield

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.

Dragino Yún shield setup

If you are not familiar with Yún (a Linux SoC bridged to the MCU), you will find help:

Arduino Mega 2560 with Ethernet Shield

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.

Arduino Mega 2560 with WiFi Shield

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.

Relay Prop wiring and control panel

All relay outputs are setup with the PyRelayControl GUI:

See PyRelayControl

Relay modules

See RELAY_MODULES.md

Prop commands

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 props
  • smoke/on:1 : ower on the smoke machine
  • smoke/fog:1 : release fog from the smoke machine

Group commands uses the /* tag:

  • maglock/*:0 : release all the maglocks
  • door/*:0 : open all the doors

Prop data messages

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 

Outbox messages

Prop configuration for Room by xcape.io

Room by xcape.io users can add the Relay Pi prop to their props:

Room prop configuration

And create a regular control panel:

Room control panel

MegaRelayEthernetProp alternative

Relay Prop on Arduino Mega 2560 + Ethernet Shield.

Warning Not done yet...

MegaRelayWifiProp alternative

Relay Prop on Arduino Mega 2560 + WiFi Shield.

Warning Not done yet...

Author

Faure Systems (Apr 26th, 2020)

  • company: FAURE SYSTEMS SAS
  • mail: dev at faure dot systems
  • github: xcape-io
  • web: xcape.io