Introduction: Control Servo With Headphone Jack
This idea started with this instructable. In it, RichMethods thoroughly explains how headphones work. His explanation made me realize that its possible to control up to two servos with a headphone jack. No Arduino, PIC, or any microcontroller required!
This technique is perfect for turning laptops, or anything that has a headphone jack, into a robot.
Not only is this method incredibly useful but it is also extremely simple!
Step 1: Parts List
- Old (Preferably Broken) Heaphones
- Servo (I'm using the HXT900)
- 9v Battery
- A computer with a headphone jack
- Soldering Iron and Solder
- Side Cutters or Wire Strippers
Step 2: Cut and Strip Headphones
Begin by cutting off the headphones. Only the headphone jack is needed.
Strip one inch of the wire casing.
Step 3: Analysing the Internal Wires
There will be three or four wires inside of the casing.
The only wires that we care about are the solid red and ground wires. Feel free to snip off any other wires.
Both wires will be insulated with vinyl. Remove the vinyl with sandpaper. Sand the wires until you see a copper like colour.
Step 4: Solder Wires
Solder a 22 gauge piece of solid wire to both strands.
Wraps the wires in electrical tape afterwards.
Step 5: Wire Up the System
Wire up the servo as seen in this diagram.
Step 6: Control the Servo
Plug your servo into a computer's headphone jack and run the above .wav files.
The servo should rotate clockwise, counterclockwise, and stop.
Step 7: Make Your Own Wav Files(Optional)
You may want to make your own wav files. This can be easily done with audacity.
Audacity is a software that lets you make custom wav files: http://audacityteam.org/.
To make a wav file run Audacity and click on > Generate > Tone.
The tone generator will pop up. Select Waveform:Square and Amplitude:1. The frequency of the wave controls the speed and direction of the servo.
The arduino expects a pulse every 20ms. 1ms and 2ms pulses cause full rights and lefts respectively.
Step 8: Future
This system makes it really easy to turn anything with a headphone jack into a robot.
In about a week, I'll post an Instructable on turning a phone into a programmable robot; that you can also drive from a PC.
If you guys have ideas or suggestions, I would love to hear them