Building my Mikrocontroller controller as a test vehicle for a full size cabinet has taught me a number of lessons. I got used to using headphones or having to turn down the volume – not all of my family is on-board with a loud Pinball machine.
I started looking for solutions. The Suzo-Happ coin door I bought has a metal plate that can be replaced with a standard bill acceptor. That looked like a good mounting point and I copied Stern's implementation.
A simple break/make headphone socket wired between the computer and amplifier would be sufficient for the headphones. But now I needed a way to get a remote volume control. For a while I thought I was going to have to either use shifted buttons like I have on the Mikrocontroller or install two volume up/down buttons under the cab.
Three days ago I found the solution staring me in the face – use a rotary encoder. I had several laying around from other electronics projects.
For the uninitiated a rotary encoder is a continuous rotation device with a knob. You can find them all kinds of places such as volume controls for your car’s stereo. The encoder has two outputs (typically called A and B). A third connector is connected to ground. As you rotate the encoder the outputs switch between logic 0 and logic 1 levels using a method called gray code. This is where only one output changes at a time. Assuming the outputs A and B correspond to two binary digits then the sequenced output is 0 (00), 1 (01), 3 (11), 2 (10), 0, 1, 3, 2, and so on. Rotating the encoder in the opposite direction gives the sequenced output of 0, 2, 3, 1, 0, 2, and so on.
A method is needed to recognize the direction of rotation and convert it into pulses on “up volume” input or “down volume” inputs to simulate a user pressing up or down volume buttons. There are several ways to do this but I choose a small microcontroller that only has 6 I/O pins called the MicroChip ATTiny45. It is actually overkill for the job but I had one handy in my parts bin. Two input pins are used to monitor the A and B inputs from the encoder and two output pins simulate the up volume/down volume button presses for a keyboard controller such as Pinscape or I-PAC 2.
The rotary encoder also includes a push-button. I used this built-in push-button as an input to provide a mute volume button. There are 5 connections:
- 5V
- “Mute Volume” button
- “Up Volume” button
- “Down Volume” button
- Ground
Here is a picture of the completed controller. My total cost was zero as I used parts I already had on-hand. The circuit is prototyped on some "stripboard" with the encoder mounted on the solder side of the board. The 5 header pins for the keyboard controller are on the left.
Here is a picture of the completed coin door from the front with the headphone socket and volume control. Note that right now I just used some 1/8” MDF for the front panel instead of the actual metal plate. Later I will either drill the metal plate or paint the MDF black so it blends in better.
The back of the coin door is shown in the picture below with the 5 header pins ready to be connected to a keyboard controller.
Although I am still using Mikrocontroller, I now have a cracked one more problem for a full size cabinet (and can eliminate additional button holes in the cabinet design).
Edit: Clarified that this will work with any keyboard controller (not just Pinscape)
Edited by MikePinball, 16 August 2019 - 03:31 PM.