Introduction: How to Connect a Push Button With Audio Input and Output

Picture of How to Connect a Push Button With Audio Input and Output

A push button is one of a basic component for capturing your action. You can dynamically push a button to do something.

There are already several way to use push buttons in your projects (e.g. hacking mouse and keyboard, or Arduino, gainer, MCK). This probides alternative way to use push buttons with audio input and output.

We also present an application of this instructable from a work Monalisa "shadow of the sound".

All you need is just a push button, some soldering, and some software.

Note: This is a series of "How to coonect with Audio". Please see others: Fader, and Sensor.

Step 1: The Parts

Picture of The Parts

All of the following components can be found at your local electronics shop (e.g. maplin in UK, RadioShack in USA, Tokyu-Hands in Japan).

1 Push button
In this time, we choose a button with push on / off locking switch. However you could choose a push button with no lock, toggle switch, or foot switch instead.

2 3.5mm Mono Plug
One for audio input and another for audio output.

1 Twin Cable
You could use loudspeaker cable for this purpose. The length depends on how long you want.

Step 2: The Tools

Picture of The Tools

These are standard tools for assembling this project. I borrow part of the list from greyhathacker45's great work, thanks!

Soldering Iron

Solder

Multimeter

Wire strippers

Nippers

Solder-sucker

Helping hands

Step 3: Cutting the Middle of the Cable

Picture of Cutting the Middle of the Cable

Cut one line of the cable (usually cable has a mark for the one side) in the middle. Then strip the cutting sides.

Step 4: Stripping the Ends of the Cable

Picture of Stripping the Ends of the Cable

Strip the ends of the cable.

Step 5: Soldering the Push Button

Picture of Soldering the Push Button

Now you ready to solder the push button to the middle of the cable. Before soldering, the cutting side of the cable needs to be twisted to avoid expanses.

Step 6: Soldering the Plugs

Picture of Soldering the Plugs

Then you ready to solder the plugs to the each end of the cable. Be assure to solder the switch side of the cable to the center of the plug. Before soldering, the plug cover needs to be installed in the cable and the cutting side of the cable needs to be twisted to avoid expanses. After soldering, just attach the cover for the plugs.

Step 7: Quality Control

Picture of Quality Control

Now you have a set of a switch, two plugs, and a cable. Using multimeter on the resistance between the plugs. Tips (upper side) should be infinity and grounds (lower side) should be zero.

Step 8: Connect to the Audio Input and Output

Picture of Connect to the Audio Input and Output

Now you have a working hardware, so lets connect each side of the plug to the audio input and output.

Step 9: Some Software

Picture of Some Software

Open your programming environment (e.g. MaxMSP, Pure Data, Flash, SuperCollider). If it could treat audio input and output, any environment is ok.

In this time, we use MaxMSP and Pure Data.

Assign an audio signal (e.g. 10000Hz sine wave) for audio output.

Set volume calculator for audio input. In this time, we use a meter~ object on MaxMSP, and a threshold~ object on Pure Data.

Add a receiver for the calculator / threshold. In this time we use a 'toggle' object on MaxMSP, and a 'print' object on Pure Data.

Here are basic examples of MaxMSP and Pure Data patches.

MaxMSP: pushbutton-001.maxpat

Pure Data: pushbutton-001.pd

Step 10: Moment of the Connection

Picture of Moment of the Connection
Start audio, push the button, and get the connection! You're ready to use a pushbutton with your projects.

If it does not work, you just need to adjust the volume for audio output.


Step 11: Uses? Photo Release

Picture of Uses? Photo Release
There are many possible uses for a push button with Audio Input and Output. One of a feasible field is remote control. We made a Photo Release with this instructable. You could take your photo with your built-in webcam from a distance.

Here is the setup. You will need to setup yourself (and your friends) for photo. In your software, you add a webcam control function. In this time, we made a patch with MaxMSP on Mac OSX. We use an apple script to control webcam and a shell object to run the script.

You could download shell object from here!

Now, you can finely take your photo from a distance!



Here are the apple script and the MaxMSP patch (photorelease.zip). You just need to put both files in a same folder and run the patch.

Apple Script: takephoto.scpt
MaxMSP: camera-002.maxpat

Step 12: Application: Monalisa "shadow of the Sound"

Picture of Application: Monalisa "shadow of the Sound"
Monalisa "shadow of the sound" is an installation based on the software plattform Monalisa which enables to "see the sound, hear the image".

In this work, we detect the conduction of a push button as on/off of audio signal.


Step 13: Possible Improvements and Modifications

You can use other types of buttons and switches.

You can use two push buttons with 3.5mm stereo plugs and triple cable.

If you need more push buttons, you can extend with external audio interfaces. In this time, you need to use proper plugs for the port of the audio interface.

Comments

haunted.haunt (author)2013-03-31

What about a desordering iron?

nikaki (author)2010-04-27

 How can i use this to connect it on my midi keyboard volume control knob so I can control volume with my hand movement? I understand that I wouldnt need the audio transformer but what would i need instead?

Papagiorgio (author)2008-12-07

what can you use this for?

westfw (author)Papagiorgio2009-01-08

I think that the idea is that modern "high level" software has pretty much lost the ability to interface to "low level hardware" like, say, Buttons, even though it can deal with high-level concepts like sound and vision that traditionally use large amounts of CPU time. And a modern computer HAS lots of CPU time to spare, so the incremental cost of detecting that a button has been pressed by using sound-processing primitives is actually quite low; in fact, lower than figuring out how to connect a button directly to your PC hardware in ways that could be read more trivially.

ReCreate (author)westfw2009-06-17

Oh so with this you can detect ON and OFF of the switch?

jojporg (author)Papagiorgio2008-12-18

Hi, I just added "Uses? Photo Release" as one of a possible use of this instructable. Hope it works!

dodo91 (author)2009-03-14

what exactly does it do? you should make it so it says what it does.

westfw (author)2008-11-07

Wow. That's gotta be about the most convoluted way of reading a pushbutton I've ever seen. But you can't argue with the price, I guess (you do lose actual sound capability, right?) Can you get four pushbuttons by setting up the left and right output channels with different levels, and detecting the levels separate on left and right inputs? ("I got a LOUD signal on the RIGHT channel, that's button 4.") I oughta go into business selling cheap USB peripherals like buttons and sliders and switches and lights. (But Oh, the pain of interfacing to all that varied software!)

jojporg (author)westfw2008-11-10

Thanks for your comment. Yes, lose one channel of your sound capability. Though if you need stereo sound (still 1-ch is active) in your project, you might need external audio interface. About number of buttons, to use different level is a bit difficult (cause LOUD sound masks others), but if you have external audio generator (e.g. oscillator, synthesizer, CD player), you can use different frequency (sine wave is the best) for each button and separate these sound with filters (FFT would be nice) with your software. Best,

raykholo (author)jojporg2009-01-07

sounds cool , but that would involve complicated circuitry and an external power supply, right?

jojporg (author)raykholo2009-01-08

partly, yes. you need standard power for your audio generator. but you do not need complicated circuit. you just need to connect your button into your audio mixer. you also could use these kinds of connectors.

3.5mm Stereo Plug to Two 3.5mm Mono SocketsAdaptor
http://www.maplin.co.uk/Module.aspx?ModuleNo=1215

hope it works!

raykholo (author)jojporg2009-01-08

looks like a great site, but d u know any similar ones that are .com ?

jojporg (author)raykholo2009-01-08

radioshack would be nice!
http://www.radioshack.com/

raykholo (author)jojporg2009-01-08

yeah but too expensive, u have to get most of it off the site cuz its not in the stores, and theres is not enough variety