Arcade cabinets are configured as closed systems where access to the cabinet's circuitry is restricted to the owner of the arcade machine. Reconfiguring or maintaining an arcade cabinet is a cumbersome process where the arcade machine has to be opened up at the back in order to access various components.
The tedious maintenance process gets worse with arcade machines that are based on the widely used Pandora Box because accessing the arcade setup involves pressing a push-button which is located inside the cabinet on the arcade machine. This implies that switching from, say, paid play with coins to freeplay would require opening up the cabinet, pressing the setup switch on the Pandora Box, making the necessary configuration changes and then putting the cabinet back together. If a large number of arcade machines have to be reconfigured, then the process can take an obnoxious amount of time, for literally just pressing a button. Furthermore, given an arcade parlor, switching devices on at the start of the business day, respectively turning off all machines at the end of the business day is, yet again, a tedious process since arcade cabinets discretely hide a power switch at the back that is not meant to be operated by customers but would have to be operated for each arcade machine in part.
Unfortunately, a simple modification where the push button would be desoldered, leads pulled from the Pandora PCB and a switch installed on the outside of the machine is not feasible because that would give access to the arcade configuration to customers that would be able to just switch to freeplay.
Fortunately, using some electronics, it is possible to add IoT technology to an arcade cabinet that will allow controlling features of the machine that should not be available to customers. Furthermore, the arcade machine can be controlled to be switched on or off just using voice commands based on node-red and a voice assistant such as Amazon Alexa.
A WeMoS mini controller will be used to drive a solid-state relay powering a plug extender that powers on the Pandora Box circuitry and the arcade monitor. The Pandora Box will be dismantled and modified in order to allow a signal from one of the WeMoS GPIO pins to drive the push-button allowing Pandora to be reconfigured.
+---------+ | Monitor | +---+-+---+ | | | | | | +---------+ +------+ Pandora +----------------------------+ | +----+ Box +----------------+ +-------+ | | | +---------+ +-+ | | | | | | | | | +-+ WeMoS | | +------+-+------+ +-------------------+ | | | | | Plug Extender | | Solid State Relay | | | | | +------+-+------+ +-------++++---++-+++ | +--++---+ | | | |||| || | | +||- | | | |||| || +---+ || | | | |||| || || | | +-----------------+||| |+----------+| | +---------------------+| +------------+-----+ 220/110V AC | | || 5VDC | | +----++----+ +------------+ Stepdown | | +----------+ AC/DC | | | +----------+ +-----+-+------+ | Mains Socket | +--------------+
In case a dual SSR is used, then both channels can be bridged and both relays can be switched with a single signal from the WeMoS GPIO. SSRs are voltage-level triggered such that in a given low range of voltage for each relay in part, the relay defaults to an ON state and when a certain voltage threshold is surpassed, the relay closes to OFF. SSR boards meant to be used with the Arduino are designed to maintain a default ON state in a range of and will switch to ON given an input signal between . Since the WeMoS GPIO is rated at then the GPIO pin can be used to toggle the SSR.
These stepdown converters are very small and can provide up to which is more than sufficient to drive both the WeMoS and the SSR board. The WeMoS when connected to WiFi will draw about from the stepdown module.
Although this step varies between the various Pandora Box models, the main idea is to emulate presses on the Pandora Box setup button. Opening the Pandora is straightforward and the PCB is exposed just by removing a few screws. Measuring conductance between the momentary switch and the closest array of resistors reveals two resistor pins that can be used to hook up a GPIO signal and the ground from the WeMoS.
Using a small variation of the transistor-based momentary switch, the circuit is mounted on top of the Pandora Box PCB and fastended down with some double-sided foam adhesive. Leads are then drawn through the plastic chassis up to the WeMoS that is mounted inside the cabinet.
The arcade cabinet that has been worked on in this tutorial is powered by a PC kettle lead that plugs into a socket on the bottom of the cabinet at the back. There are multiple leads from the socket, some of them leading to the Jamma PSU whilst three cables are hooked to an internal socket extender: ground (green) and the blue and brown wires.
Whilst the green wire representing the ground can be just passed through to the socket extender, the other two sockets (for the blue and brown wires) will have two wires attached to it that are then both inserted into the cable crimps of a dual solid state relay. The other socket, corresponding to each wire leading from the power sockets are then populated with the wires from the socket extender cable - this allows both SSRs to switch thereby allowing a total of per relay. Even though does not seem much, given the power formula , the total expected amount of amps that could be drawn would, for an european-style socket be ( for each relay).
Two additional wires are attached directly to the power sockets of the cabinet and drawn to the AC/DC stepdown converter that will power both the WeMoS board and the SSR DC input. During the modifications, an additional ground board was created in order to accommodate multiple GPIO switch leads having further developments in mind.
The end result is a very small circuitry that is placed on the interior of the arcade cabinet. From left to right:
Since the WeMoS will, at the time of writing, only be used to toggle GPIO pins either HIGH or LOW, a boilerplate Arduino pin toggling sketch can be programmed to the WeMoS board. The sketch allows the WeMoS to boot in AP mode in order to be configured and to connect to a WiFi network and allows subscribing to an MQTT broker in order to process message for toggling the various GPIO pins.
With the setup completed, the GPIO pins used for toggling power, respectively entering the Pandora setup mode can be toggled by sending messages to the MQTT broker. The difference in usage between the two GPIO pins is that the pin responsible of driving the SSR will have to maintain its state whilst the GPIO pin meant to enter the Pandora setup mode has to simulate a button press such that the pin will have to be set HIGH and then LOW with a few milliseconds delay.
Assuming that GPIO pin 6 is responsible for powering the arcade cabinet ON or OFF, the following command issued in a terminal should set the GPIO pin to HIGH:
mosquitto_pub.exe -h 192.168.0.1 -t 'esp/arcade' -m '{ "pin": 6, "state": "on" }'
where:
192.168.0.1
is the MQTT broker IP address,esp/arcade
is the topic that the WeMoS has been configured to listen on,{ "pin": 6, "state": "on" }
is the message payload that instructs the WeMoS to set GPIO pin 6
to HIGH.
Note that SSRs tend to have their default state set to ON such that sending the above message will, in fact, turn the arcade machine off. Conversely, setting the pin state to LOW, via a payload message like { "pin": 6, "state": "off" }
, will, in fact, power on the arcade machine.
On the other hand, the GPIO pin controlling the Pandora will have to be set to HIGH and then LOW after a delay of a few milliseconds - this can be accomplished from the command line as well, if need be:
mosquitto_pub.exe -h 192.168.0.1 -t 'esp/arcade' -m '{ "pin": 6, "state": "on" }' && \ sleep .25 && \ mosquitto_pub.exe -h 192.168.0.1 -t 'esp/arcade' -m '{ "pin": 6, "state": "off" }'
However, with the setup in-place, it is more convenient for a project such as Node Red to be used instead.
The above node-red flow has two pathways established: the upper path is meant to switch the arcade on or off whilst the lower path is meant to press the Pandora momentary switch.
For the upper half of the flow and from left to right:
msg.payload
to an empty object,Switch
node routs a message received by Alexa to turn the "Arcade" on to the upper node connector, respectively a message received by Alexa to turn the "Arcade" device off to the lower node connector - note that counter-intuitively, the messages are switched for the follow-up nodes, such that telling Alexa to turn on the arcade machine will tell the WeMoS to set the GPIO pin to LOW; this corresponds to how solid state relays operate,For the lower half, the flow, from left to right reads:
msg.payload
to an empty object,Configure
node, the On
node instructs the WeMoS to set the GPIO pin to HIGH and, in parallel, a copy of the message is fed to the purple node that delays the message by and then instructs the WeMoS to set the GPIO pin to LOW - effectively simulating a momentary button press,
The flow could most likely be minimized by merging the nodes Humanize
and Clear
that do nothing much else than: set an easy to remember name for the device and reset msg.payload
to an empty object. The Configure
node is responsible for setting the MQTT topic (although, this could be achieved on the purple MQTT nodes directly) and the GPIO pin.
Telling Alexa to discover devices should yield two new devices named Arcade
and Arcade Setup
that can then be used to control the arcade cabinet.
For the future, perhaps some of the following could be done in order to leverage the rest of the GPIO pins available on the WeMoS: