Rob The Nerd .com Low Fat!
Home
 
About
 
Projects
 
Amiga
 
Photography
 
Links
 

 

 
You are here: Home > Projects > Button Box > Design

 
ButtonBox
About
Design
Construction

 
 
 
ButtonBox Design
The interface board I selected is the rather excellent BU0836A Joystick Controller from Leo Bodnar Electronics. It features:
  • 6x6 button matrix inputs giving:
    • 12 directly-wired switch inputs, or
    • 32 matrix button inputs plus 4 hat switch inputs
  • Eight 12-bit analogue inputs
  • Support for 4-way D-pad or hat switch input
  • Support for up to 16 2-bit rotary encoders
  • 5V supply for analogue potentiometers
And all in a tiny little PCB. (Variations are available for different applications - check out the website). This was more than enough for everything I wanted, so I bought one and got to work.
 
spacer
 
 
The switch matrix makes things slightly complicated due to how it works. The theory of these layouts is that all columns are kept in the same state, and then each column is pulsed in turn, while the controller software watches for any rows showing a signal. This means that the controller is able to distinguish between different buttons without having a connection to all of them. The main drawback is that multiple switches aren't always recognised at that, so to get around this, a diode is put in series with each switch so that the pulse isn't sent back through the closed switches to confuse the controller. If you're interested in a better explanation of key matrices, check this page out.

Support for multiple button presses is not so important for buttons that are only pressed momentarily, but because I wanted the possibility of having held buttons or switches, I decided to add diodes for all inputs. The other issue was that the toggle switch inputs didn't really translate well to game inputs, most of which expect a momentary input like a key press. I could simply use all pushbuttons, but I liked the idea of toggle switches so I came up with a way of converting toggle switches to momentary signals. To do this, I used a monostable flip-flop for each input to give me a momentary output for each switch action. Wiring both sides of the toggle switch together gives a single pulse for either direction, which works for an input expecting a keypress to toggle, e.g. using the same key to raise or lower the landing gear.

Connecting this logic-level output as an input to the key matrix is tricky however, since it doesn't match the pulses used. To bridge this difference, I used optical isolators, which also have the benefit of not requiring the diode since they are based on a transistor. I just had to connect them the right way around...
 

spacer
 
 
Once I had the circuit finished, the final schematic looked something like this:
ButtonBox-schematic.png
ButtonBox Schematic

 
spacer

Read more:  About  |  About