Arcade Button MIDI Controller

 by fraganator
Featured

Step 5: Wiring

MIDI_controller_wiring.png
MIDI_controller_wiring_schematic.png
With all of the components securely fitted inside the enclosure, it's time to work out what needs to be wired where.

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.
 
Remove these adsRemove these ads by Signing Up
djozmo says: Nov 22, 2012. 1:58 PM
hmmmm.....would this work with Teensy? This is sort of a thinking out aloud question, I am very new to this...and have my research to do..I think it would work. care to comment? :) By the way GREAT instructable, thanks for the awesome work!
fraganator (author) in reply to djozmoNov 22, 2012. 4:43 PM
Most certainly it will, and it'll also act as a USB-MIDI device (set through the Arduino IDE once you've installed Teensyduino), so you won't need the serial to MIDI converter software. The sketch should work with it without modification.

Thanks for the comments!
headsdeep says: Jul 29, 2011. 6:27 AM

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
fraganator (author) in reply to headsdeepJul 29, 2011. 6:52 AM
Thanks for the kind comments :)

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.
headsdeep in reply to fraganatorJul 31, 2011. 12:30 AM
thank you a million

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?
fraganator (author) in reply to headsdeepJul 31, 2011. 9:02 AM
What sort of infrared sensor are you thinking of using? Do you have a link to its datasheet?

I'm based in Australia :)

headsdeep in reply to fraganatorJul 31, 2011. 6:21 PM
i thought you were too nice to be an from the u.s.a.

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.
fraganator (author) in reply to headsdeepAug 2, 2011. 12:48 AM
Haha I'm sure there are plenty of nice American peeps on Instructables :)

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.
redtraceur says: Apr 17, 2011. 10:11 AM
IS it possible to re upload the wiring diagram for Fritzing or give an alternate link i try to download but it is a .tmp file not matching withc fritzing .fz
fraganator (author) in reply to redtraceurApr 17, 2011. 6:21 PM
I just tried it out in Chrome and it does indeed save it with a .tmp extension. Simply rename the file with a .fz extension and it should work.
redtraceur in reply to fraganatorApr 20, 2011. 8:03 AM
Lol that was more than simple thanks a lot for the reply, im trying this may be on weekend till i get the materials and components.
trainables says: Feb 26, 2011. 12:45 AM
Thanks for the wiring diagram! Much easier to follow than schematics only.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!