Shaker control with pwm

Using a Arduino mini pro as extension to a TILT!Audio board, you can easily control a shaker motor via pwm (pulse width modulation).

First we need a motor driver module that is capable of driving the high current motor power. e.g. something like this:

Dc motor driver module for up to 10A

The picture is more or less self-explaining the only thing that need to be connected to the Arduino mini pro is the GND / PWM input.

Now looking at the Arduino mini pro we use pin 5 as pwm output and to connect to the TILT!Audio board we use the i2c bus the is controlled by the SCL / SDC pins (together with GND / Vcc of course):

Be sure to choose a 5v type for Arduino mini pro as there are also available in 3.3v but the TILT!Audio connector for the i2c bus provides 5v. Also the 5v type runs on 16Mhz instead of only 8Mhz for 3.3v with is also good.

So connections are:

FromTo
TA-Board: GNDGND (right side)
TA-Board: VccVCC (right side)
TA-Board: SDASDA (green)
TA-Board: SCLSCL (green)
Arduino: GNDPower Driver: GND (right)
Arduino: Pin5 (PWM)Power Driver: PWM (right)

Now we create a script for the Arduino mini pro like this (see https://github.com/sker65/tiltaudio-extensions). We start with initial setup stuff:

First thing we do is switch shaker on, off and set speed (within a limited range to not make to pinball machine jump):

Second we wire these functions to i2c control:

And additionally we can create “sequences”. A sequence would play back some schema of on and off or speed up and speed downs. The idea is to define a sequence as 3 integers: command byte, value, interval in milliseconds. We define these commands:

  • 0x00: stop -> end of the sequence
  • 0x01: switch on, value -> speed
  • 0x02: switch off, value -> don’t matter
  • 0x03: ramp up, value -> target speed at end of interval

We delegate playing those sequences to the Arduino and later just trigger it from the TILT!Audio board by sending some command to the i2c bus:

And again create a function that triggers the sequence playback and wire it to i2c control:

Find the complete example on github.

To get an idea, how it finally will play all together I did a test installation:

Test a TILT!Audio board

In order to test your TILTAudio board including the WPC bus interface to the pinball machine you can use an arduino mega board.

Just connect the mega with the TILT!Audio board like this:

Connections from the Arduino mega to WPC bus on TILT!Audio

Connecting also the 5v power line is optional. You need to choose either to power everything from on source or just skip the red 5v wire and power the 5v on the TA board and the Arduino separately.

For the address decoder (the smd chips) to work the raspberry pi needs to be plugged in as the 3v3 power for the decoder comes from the pi’s onboard regulator.

Also the resistor network RN3-5 must be installed, without them bus connections are not there. 12V can be skipped for testing, which means amps will not work, but you could also connect a speaker either to the PI’s audio jack directly or use the audio jack on the DAC module.

Then load the following ino script to the Arduino:

This way you can emulate sound effect commands to would normally come from the pinball machine.

I will upload a more detailed example on the github repo: https://github.com/sker65/tiltaudio-extensions

Connections needed:

ArduinoTILT!Audio
PA0:22CD0 wpc15
PA1:23CD1 wpc13
PA2:24CD2 wpc11
PA3:25CD3 wpc9
PA4:26CD4 wpc7
PA5:27CD5 wpc5
PA6:28CD6 wpc3
PA7:29CD7 wpc1
PC0:37CA0 wpc25
PC1:36CA1 wpc23
PC2:35CA2 wpc21
PC3:34CA3 wpc19
PC4:33CA4 wpc17
PC5:32RW:wpc31
PC6:31WDEN:wpc29
GNDGND

Quick Start

What is it?

TILT!Audio is a free time project that aims to get you a replacement for your audio board in your pinball game. It works with data east, wpc and white star games.

What do I need?

You need a board (PCB) and a couple of electronic components (SMD chips, resistors and some pre assembled modules), a raspberry pi (3B or newer recommended, but 3A and even zero also works) and a micro sd card for the software and the new sounds to use. Maybe some additional wires as you are going to get stereo sound on old wpc machines.

The PCB designs are free and you can create one or order one on your own if you like. Just checkout out https://oshwlab.com/steve45/tiltaudio. Alternatively you can order a kit including all required components and a PCB in my shop.

Finally to run the software without licensing hints for more than just 10 minutes you need a license (also available in my shop).

Can I do it on my own?

Some soldering skills are required. Some basic understanding of your pinball electronics (it is not plug and play). Some computer knowledge on how to flash a micro sd card with an “image” and maybe extracting a zip file.

Step by Step

  1. Assembly: First you need o assemble the board, there are a couple of hints and also a video available on the assembly page on this website. As there were already many board revision, be sure that you only look for your board revision not older outdated ones.
  2. Prepare the micro SD Card for the pi: get a 16GB micro sd card a flash the latest image onto the card using a tool like balena etcher. Add a sound pack for your machine into the data/sound directory on the sd card. Sound packs are available from the virtual pinball community on http://altsound.vpin24.com. Just look for your machines rom abbreviation (see on https://www.ipdb.org/).
  3. Optional for sd card: add an update.zip to the sd card update if there is a patch update newer that the latest image available. Latest versions see below.
  4. Check the initial setting for your machine: (only for board rev < 3.5, newer boards can skip this step): there is a jumper on the board that needs to be set to DE if your machine is data east or white star and to WPC for all wpc machines. Open the raspisound.ini file in the data/sound diectory and add one line with “vendor=0” for data east, “vendor=1” for WPC, “vendor=5” for WPC DCS and “vendor=7” for white star.
  5. Prepare speaker wiring: for old wpc machines you need to change the speaker wiring, as you will get stereo in the backbox plus mono in the cabinet (2.1 sound). see here. Lookup out for the speaker connectors on the bottom of the board and change your speaker wiring accordingly. You could also think of replacing the original speakers with better replacement ones to get even better sound (and you really should!!)
  6. Turn down the volume: before putting the board in and start up the pinball turn down the volume to almost minimal by turning to two onboard pots to the left (CCW) and then slightly back to right some degrees.
  7. Apply the raspberry pi: put the micro sd card into the pi and then put the pi upside down onto the board.
  8. Replace the sound board: pull out the old sound board from the pinball machine and replace it with the new TILT!Audio board. Note: not all the former connections are needed / are the same. For WPC the speaker wiring is changed (see 5) also the logic power connector (on the left) is not needed only the aux power J501 at the bottom.
  9. Switch on the pinball machine: for WPC boards you should see the DC power module led and in any case the led on the DAC module light up. If you installed an OLED status display shortly after boot the TILT!Audio logo should appear. After 20 seconds you should hear a boot sound.
  10. Configure via Wifi (optional): if your pi has wifi (normally always the case) after a few minutes you should see a new wifi network “TILTAUDIO”. You can connect your computer or smart phone using the password “tiltaudio” and then connect to http://192.168.42.1:31008/ to get to the webUI. This is only necessary if you some of the initial setup steps above did not match your machine setting or for more expert configurations. if you have the right vendor setting applied and a sound pack installed you should already be able to play your first game with new sound experience.

Latest image version is 1.34 can be downloaded here: https://tiltaudio.com/file/firmware-latest

Latest update patch (see changelog) can be found here: https://tiltaudio.com/file/update-latest please be sure to rename the zip file to update.zip before copying to the update folder onto the sd card.

Troubleshooting

I can’t hear any sound, not even boot chime.

Check speaker connection wires. Check on board pots if volume is not completely down to zero (all to the left).
If you have access to web UI goto audio device settings and try a different audio device.

I can’t hear only boot sound, but game does not start playing music or react to game play

Check if jumper setting matches your game type (see 4 above). Also check the vendor setting in the raspisound.ini file. If you have access to the web UI you can also check vendor settings on the config page.
Also check the connection of the data cable (ribbon cable).

Raspberry pi does not boot and no led is lighting up on the DAC module.

Check power supplies: on wpc check fuse. (older boards also data east). Check correct connection of power supply connectors J501 for WPC and CN2 for data east.

Data east cabinet pot for volume control does not work

Check CN3 connector to cabinet pot (top side of the board). for newer boards: is the ADC module applied? for older boards: enable_dataest_volume set to true?

I hear sound triggered in the web ui, but not in the game.

Check data connections and the jumper must be set accordingly (DE or WPC)

Please also check the FAQ.