xcape-io / RelayProp

No-code prop and control panel to command relays with Arduino Mega 2560 or STM32 Nucleo-144 or Raspberry Pi board.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Relay Prop

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:

And a guide for relay modules:

Usage

  1. Choose if you will use Arduino Mega or Raspberry Pi board
  2. Intall on your local network, either:
  3. Install an MQTT broker on your local network, eihter:
  4. Install PyRelayControl on your desktop
  5. Start PyRelayControl GUI and configure your relays wiring (GPIO)
  6. Upload the wiring to the MQTT broker (one-click)
  7. Automatically build the control panel widgets (one-click)
  8. Customize the control panel widgets (labels and images)
  9. Enjoy controlling your relays from the control panel

Why do we need a Relay prop in our Escape Room?

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.

Benefits

  • 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)

Recommended room network (star wiring)

Room network

Raspberry Pi or Arduino Mega or STM32 Nucleo 144 ?

For the Relay prop we recommend and provide code for Raspberry Pi and Arduino Mega.

Raspberry Pi

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:

Arduino Mega

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)

Do we connect the Arduino Mega with Dragino Yún or Ethernet or WiFi shield?

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.

STM32 Nucleo 144

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

MegaRelayProp project

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.

NucleoRelayProp project

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 project

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 project

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.

TODO

  • Add MPC23017 support
  • Add Mega without bridge support

Author

Faure Systems (Jun 4th, 2020)

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

About

No-code prop and control panel to command relays with Arduino Mega 2560 or STM32 Nucleo-144 or Raspberry Pi board.

License:MIT License


Languages

Language:Python 86.9%Language:C++ 7.6%Language:C 4.2%Language:Batchfile 0.9%Language:HTML 0.2%Language:Makefile 0.1%Language:CSS 0.1%