We removed the screws on the back to see how hard it would be to attach solenoids to each of the hammers. As you would probably expect, there's not a lot going on in there.

From here, we just did a quick and easy attachment of the solenoids to the hammer using some old copper wire stranding. We ended up using two strands per solenoid and that was plenty to hold it in place.

Each of the 4 solenoids was then wired up to outputs of the Darlinton array that had a corresponding GPIO input from a Raspberry Pi.

The rest is visual programming within NodeCode.

We need the following nodes:

  • RasPi -> Pin Writer node for each GPIO pin
  • Raspi -> HC-SR04 node for the range finder
  • Logic -> Number Equality node for each pin.

The idea is simple. We use the distance as a trigger. Each time the distance equals the value in one of the equality nodes, the signal passes through and triggers the pin writer node. This then activates the respective solenoid.

We created a view and wired it up as well so that we can more easily see what is going on.

Visit NodeCode Downloads to download