Step 5: Wiring
The ATMega328 chip used on the Arduino contains internal pull-up resistors, so we won't need to wire individual resistors for each of the arcade buttons. This greatly simplifies the controller wiring. So all that needs to be done to wire the arcade buttons is to solder one leg to ground, and connect the other leg to one of the digital inputs on the Arduino board.
That said, pin 13 can not be used as a digital input with the internal pull-up resistor. See the pullup resistors section in the Digital Pins article on the Arduino website for the reasons why. For this pin we'll be using an external pull-down resistor. If you're unsure what a pull-up/pull-down resistor does, check out this great tutorial on ladyada.net .
Wiring the potentiometers requires a ground wire, a wire to the one of the Arduino analogue inputs, and a third +5V wire. As the potentiometer is rotated or adjusted, the resistance of the potentiometer changes between the ground and +5V wire. According to Ohm's law, voltage = current*resistance, so with a constant input current and a variable input resistance, the output voltage will be variable. It's this variable voltage that the Arduino reads on the analogue pins.
The attached wiring diagram (created with the great Fritzing software) shows how to wire up each of the components to the Arduino board. The black wire represents ground, the red wire represents +5V, the purple and orange wires are digital inputs to the Arduino, and the blue and green wires are analogue inputs to the Arduino. Note that the ground wires and +5V wires have been bridged between the buttons and potentiometers.
Before proceeding to the next step you may find it helpful to print out a copy of the wiring diagram to refer to whilst you solder.
MIDI_controller.fz500 KB
Remove these ads by
Signing Up










































Visit Our Store »
Go Pro Today »




Thanks for the comments!
you rule .
thank you so much for this perfectly put down info
i hope you make piles of cash and or happiness
question one can i extend this with the arduino mega
by just following the above diagram but with many more buttons and sliders?
question 2 is it possible to insert simple leds that only light up when you hit the button?
if so where would theey go in this scematic?
thank you much
sherwood
You should be able to run this on the Mega no problems by simply adding more buttons and sliders.
Connecting an LED to each button shouldn't be a problem either. Just connect the LED's cathode (short leg) to the button's leg (the one which connects back to the Arduino input), and connect the LED's anode (long leg) through a resistor to 5V. When you press the button the LED should light up, and switch off when you release the button.
i made the mistake of working an infared sensor into the design befor finding out if it would work like the pots in this sketch.
would an infared pot work at a pot with no other wiring just black red and yellow
i assume red 5v black ground and yellow signal.
your thoughts.
also are you in sf or england?
I'm based in Australia :)
i do not know what make ore model this sensor is but its yellow plastic with 2 black
nuts to skrew in to case
it has a red plastic window at the top
on the bottom it has a tiny tiny skrew(a pot of sorts i assume)
and 3 wires red black and yellow
i got it on ebay for an arduino board but they had no docs.
I had a quick look on ebay on found something which matches your description. Looking at the description provided, it seems like the device acts as a switch rather than a potentiometer.
It normally outputs a high signal, until something blocks or reflects the IR beam, at which point it outputs a low signal. The small screw in the bottom is to adjust the IR sensitivity (or the range over which it can detect something).
You should be able to use this as a digital input in place of the buttons. The code won't need to change, but you will need to wire a 5V signal into the device (to power the IR LED), along with the ground and output.