After testing replacing the note acceptor connector with a Pi I shortly decided to quickly replace the main electronics board with a Pi instead to control it.

Basic Requirements

With only a week to go when I started I had to set the basic requirements out that were required to let people play on the machine.

The basic requirements were drivers to control the 3 Motors (Left & Right, Forward & Back and Up & Down), A method of driving the electromagnet coil in the claw along with some simple wiring for the 4 end stops and two buttons in the front.

Motor Drivers

After looking at the datasheet for the motors I found that the motors only use approximately 400-500mA with a 1A Stall current at 24V. This just fits into the specifications of the RTk RPi M.C.B so is good enough for a prototype!

Creating a wiring harness

The machine had 3 wiring connectors I need to use. One's a DB25 connector, One a slightly bigger 9 way connector for power and one a similar 0.1" jumper connector. While I was able to get the DB25 connector I wasn't able to get the other two from the main UK retailer.

Luckily the main one I needed was the DB25 as the other two are for the front buttons and the power with the DB25 being the connector for the motor, claw & stop switches.
Just using some network cable and the service manual it was easy to wire one up ready for the following wiring:

Wiring the motors up

Wiring the motors was reasonably easy, just wired both motors up to the motor terminals and the 24V into the input voltage.

To be able to use 3 individual motors you however need two boards, what I did was use a black hat hacker and use jumper wires to connect the black hat hacker to each board leaving the other side of the black HAT hacker for a HAT.

Switch Wiring

Wiring up the switches was easy, I routed 4 new wires through to the front panel using spare network cable, I then soldered it to the two microswitches and it's ready to go. (While I could have used crimps I didn't have any to hand and they cost more from the high street chain than the microswitches do to replace).

The Stop Switches were wired from the DB25 connector and with the front panel wired them directly into a RasPiO ProHAT.

Claw Wiring

The claw was the most difficult to wire mainly due to making a silly mistake.

The electromagnet runs at 48V of which I planned to use a TIP120 which can drive up to 5A at 60V however when wiring it up I was having it where while the Pi would turn it on the magnet just would not turn off. Turns out the issue was that I forgot to put a diode between the magnet's positive and negative connections. Once I did the issue was resolved!

Quick bit of coding

After that a quick bit of coding using GPIO Zero and I have a working Pi controlled Claw Machine!

You can view the code at


I did a quick prototype to quickly get it ready for Camjam tomorrow.

Then in the future I plan to create a PCB to have all of the wiring on along with connecting up all of the lights in the machine. Eventually I'll also be putting a webcam in it so that it can be played over the internet.

That's it for this progress update! Stay tuned for Part 3