Japanese Slot Machine

I own a pachislo Japanese slot machine. By law in Japan you need to press buttons to stop the reels. Although it has no effect on the outcome. I’d like to use an arduino to automatically randomly stop the reels similar to an American style machine. The buttons that stop the reels have 2 wires attached each of them and they plug in to a circuit board. I’m hoping to place the arduino in between the buttons and this circuit board. I’m kind of lost. Any suggestions on how to wire this up?

Maybe put a small relay in parallel with each button switch. Control each relay with an Arduino.

Don't put regular text in code tags.

Is one side of each button connected to digital ground? That would make it a lot easier. Examine the board, figure out how it's wired. That should always be your first step, and it's a simple exercise in using a multimeter to determine.

There are 2 wires coming from each button. That means one has to be a ground right?

Not necessarily - the switches could be in a matrix (or one of a number of other wiring schemes that would be incredibly unlilely to find in the wild). Unlike the other alternatives, this is not at all implausible. I think a bunch of switches that ground

+1 @groundFungus the easiest and safest way to do this is to bridge the normally open pushbuttons with a relay.

Then it don't matter how that pushbutton is wired.

Assuming that what you looking at is a simple normally open switch.

a7

1 Like

I think I get the idea now. My first attempt was to run one wire that came from the button into one arduino pin and out another. That was Dangerous and stupid I know now but I did run a dc voltage check on the buttons it was 5v. I hope it didn’t damage the arduino but the slot machine seems fine. I’m going to research relays.

Most any relay that you find will probably need more current than an Arduino output can safely provide. You will need a relay driver. That can consist of at MOSFET or BJT and a flyback diode. The flyback diode will protect the transistor from the inductive kickback when the relay coil is de-energized. You can buy relay modules with the driver on board and often optically isolated.

Here is an example of a MOSFET relay driver connected to the (normally open momentary) switch.
SWITCH RELAY

1 Like

Or…

There are many similar modules available if build your own doesn't look like fun.

HTH

a7

This was when the button was not pressed? What was the voltage when the button was pressed? (I expect it would be zero).

What current flows when the button is pressed and not pressed? (I expect current would be zero when button not pressed).

If the current is only a few mA and the voltage is only 5V, an alternative to relays would be opto-isolators. Small, quiet, don't wear out and don't demand a high current from the Arduino to activate them. Just put a 330R in series with the input.

I double checked the button's dc voltage. It reads just under two volts when the machine is on and idle and then it drops to zero when the button is pushed. That seems odd to me. Does that sound normal?

Amazon.com: SunFounder 4 Channel 5V Relay Shield Module for Arduino R3 MEGA 2560 1280 DSP ARM PIC AVR STM32 Raspberry Pi : Electronics

I ordered this module earlier today. Will this work? I know there is one extra but maybe I could use it to make a spin button later on down the road.

That can work, but has some problems that make it less than ideal. You'd be better off spending a bit more on two X two packs of the ones I linked.

I hope someone else weighs in here.

TBH I was surprised to find that many 4 relay modules made for the Arduino seem to be the identical, less than ideal, design. I actually found the same ones I casually linked above in some haste this morning when I went to check and laughed not quite out loud to see I'd already found it and passed a certain level of judgement on it.

As for the extra relay. I am sure a use for it will come up. :expressionless:

a7

1 Like

The way to wire a button switch to a controller is to wire one side to ground and the other to an input with a resistor wired from the input to Vcc (a pullup resistor). Then the input will read high (your 2V) when the button is not pushed and low (your 0V) when the button is pushed. That ishow your button is acting so it seems normal.

1 Like

@groundFungus asking for a friend :wink: wouldn’t we see close to 5 volts on the pin when the switch is open?

Even in a 3.3 volt system 2 volts seems low. I’d guess it was due to some kind of scanning and therefor a spurious measurement, except pressing gives 0 volts…

a7

I don't know the machine. I was trying to explain the typical switch wiring and how that may relate to what the OP was seeing.

OK, this is getting seriously confused!

While you can use relays, it is preferably to understand just what this machine is.

Start by identifying the power supply - what voltages (no doubt more than one) does it use? Verify that the negative of the supply connects to the chassis of the machine as it almost certainly does. Identify what sort of devices are used in the machine chip numbers and such. It presumably has a digital display and uses 5 V logic to drive it. Some pictures would be most helpful.

Identify with the meter while powered, what voltages are on both wires of each switch relative to the ground or negative logic supply. Actually, once you have verified that the power supply negative is grounded, you could first test with the power off, whether either of each switch wires is in fact, connected directly to ground.

Identify to what the buttons are actually connected in the unit. Are they (presumably) connected to a digital logic circuit, or to some other relay or solenoid?

The point is - if they are directly connected to digital logic, you will be able to control them directly with an Arduino and relays will be entirely unnecessary. But that is what you need to figure out instead of simply looking at all sorts of random suggestions!

I only see one "suggestion", use a relay for each switch.

The suggestion was not random, and I am sticking to my story.

If you are looking at a normally open switch the easiest and safest and I might as well add most rapid way to hack the machine is to use a relay.

Obvsly not the case for any switch in any machine - I would add that a little (tiny) bit of convincing oneself that there is no switching high voltages or massive currents might be a good idea.

But all the OP wants to do is press a button on an arcade machine. This hardly requires any large amount of reverse engineering or study of schematics of the device.

Whatchy'all got against relays? They got us to the Moon after all. The relays in this case will be briefly energized at low rates, they should last.

If good relays wear out in this use case, then go to some extra trouble to see if their function could be otherwise accomplished.

a7

I’m going with relays. While I am trying to understand the machine better. I’m not an engineer. Simple and safe is my goal here.

I do appreciate all the replies. I’m impressed at all the thoughtful answers.

As for the low voltage. These machines came from Japan and have had modifications made to them in order to run on the US electrical supply. I myself switched out some resistors on the main board in order to dampen the sound a little. Could one of those two things be causing a low reading? The machine appears to be fully functional.

***I’ll add some pictures of the machines innards tonight.

The relay module has arrived, I wrote a simple program and and it works. Thanks for the advice. Now When I start up the arduino it goes into an endless loop of pushing the buttons. It does the job but Obviously that’s not what I want. I need to activate the loop one time after the spin lever is used.

My spin lever uses a photo interruptor and is connected to the board with three wires. The outer two read 5v constantly and the middle and right wire read slightly less until the spin lever is activated. It’s my understanding that two of these wires are power and ground and the third wire is a “trigger” ? How should I be connecting this to the arduino?

Here is my code so far.

//japanese pachislot autostop:
//mcrowell75 and atlanticom 2021:
//This code was written for an arduino nano and a 4 channel relay module:

int button_1 = 2;
int button_2 = 3;
int button_3 = 4;
int spin_in = 5;

void setup() {
pinMode (spin_in, INPUT_PULLUP);
pinMode (button_1, INPUT);
pinMode (button_2, INPUT);
pinMode (button_3, INPUT);

}

void loop() {
if (digitalRead (spin_in) == HIGH) {
delay (random (1000,3000));
pinMode (button_1, OUTPUT);
delay (300);
pinMode (button_1, INPUT);

delay (random (1000,3000));
pinMode (button_2, OUTPUT);
delay (300);
pinMode (button_2, INPUT);

delay (random (1000,3000));
pinMode (button_3, OUTPUT);
delay (300);
pinMode (button_3, INPUT);

}

}