Control Servo With Headphone Jack
by CallMeSwal in Circuits > Audio
6064 Views, 35 Favorites, 0 Comments
Control Servo With Headphone Jack
![Control Servo Via Headphone Jack](/proxy/?url=https://content.instructables.com/F2O/ZVFH/IDCXFYL0/F2OZVFHIDCXFYL0.jpg&filename=Control Servo Via Headphone Jack)
![55d1631967400c7133000c14.jpeg](/proxy/?url=https://content.instructables.com/FG5/NJNP/IDCXQCL1/FG5NJNPIDCXQCL1.jpg&filename=55d1631967400c7133000c14.jpeg)
![IMG_20150815_223241.jpg](/proxy/?url=https://content.instructables.com/FNB/E8IL/IDCXFYTX/FNBE8ILIDCXFYTX.jpg&filename=IMG_20150815_223241.jpg)
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!
Parts List
![IMG_20150815_214207.jpg](/proxy/?url=https://content.instructables.com/FA2/QLDI/IDCXFN1U/FA2QLDIIDCXFN1U.jpg&filename=IMG_20150815_214207.jpg)
![IMG_20150815_214154.jpg](/proxy/?url=https://content.instructables.com/FPE/RDVY/IDCXFN1M/FPERDVYIDCXFN1M.jpg&filename=IMG_20150815_214154.jpg)
![IMG_20150815_220648.jpg](/proxy/?url=https://content.instructables.com/FAS/FRPT/IDCXFN21/FASFRPTIDCXFN21.jpg&filename=IMG_20150815_220648.jpg)
Parts
- Old (Preferably Broken) Heaphones
- Wire
- Servo (I'm using the HXT900)
- 9v Battery
- A computer with a headphone jack
Tools
- Soldering Iron and Solder
- Side Cutters or Wire Strippers
- Sandpaper
Cut and Strip Headphones
![Snapshot - 9.png](/proxy/?url=https://content.instructables.com/FUW/59V3/IDCXFN5I/FUW59V3IDCXFN5I.png&filename=Snapshot - 9.png)
![Snapshot - 10.png](/proxy/?url=https://content.instructables.com/FOX/PQJ0/IDCXFN6N/FOXPQJ0IDCXFN6N.png&filename=Snapshot - 10.png)
![Snapshot - 11.png](/proxy/?url=https://content.instructables.com/FQK/G1V1/IDCXFN7Q/FQKG1V1IDCXFN7Q.png&filename=Snapshot - 11.png)
Begin by cutting off the headphones. Only the headphone jack is needed.
Strip one inch of the wire casing.
Analysing the Internal Wires
![55d014612e7fb696d1000458.jpeg](/proxy/?url=https://content.instructables.com/FUV/70G8/IDCXG2GX/FUV70G8IDCXG2GX.jpg&filename=55d014612e7fb696d1000458.jpeg)
![Snapshot - 8.png](/proxy/?url=https://content.instructables.com/FSY/XUVR/IDCXFN5H/FSYXUVRIDCXFN5H.png&filename=Snapshot - 8.png)
![Snapshot - 16.png](/proxy/?url=https://content.instructables.com/F8Z/E8GV/IDCXFNB0/F8ZE8GVIDCXFNB0.png&filename=Snapshot - 16.png)
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.
Solder Wires
![Snapshot - 18.png](/proxy/?url=https://content.instructables.com/F8Z/ZFRY/IDCXFNC3/F8ZZFRYIDCXFNC3.png&filename=Snapshot - 18.png)
![Snapshot - 19.png](/proxy/?url=https://content.instructables.com/F8O/KIWN/IDCXFND5/F8OKIWNIDCXFND5.png&filename=Snapshot - 19.png)
![Snapshot - 20.png](/proxy/?url=https://content.instructables.com/FHB/9O13/IDCXFND6/FHB9O13IDCXFND6.png&filename=Snapshot - 20.png)
Solder a 22 gauge piece of solid wire to both strands.
Wraps the wires in electrical tape afterwards.
Wire Up the System
![IMG_20150815_222507.jpg](/proxy/?url=https://content.instructables.com/FP9/9AH8/IDCXFN27/FP99AH8IDCXFN27.jpg&filename=IMG_20150815_222507.jpg)
![schematic_bb.png](/proxy/?url=https://content.instructables.com/FBE/ZPUV/IDCXOJYV/FBEZPUVIDCXOJYV.png&filename=schematic_bb.png)
Wire up the servo as seen in this diagram.
Downloads
Control the Servo
![IMG_20150815_223348.jpg](/proxy/?url=https://content.instructables.com/FH3/KNR6/IDCXFN4E/FH3KNR6IDCXFN4E.jpg&filename=IMG_20150815_223348.jpg)
Plug your servo into a computer's headphone jack and run the above .wav files.
The servo should rotate clockwise, counterclockwise, and stop.
Make Your Own Wav Files(Optional)
![Screenshot 2015-08-16 20.15.25.png](/proxy/?url=https://content.instructables.com/FLL/0M69/IDCXOY57/FLL0M69IDCXOY57.png&filename=Screenshot 2015-08-16 20.15.25.png)
![Screenshot 2015-08-16 20.21.15.png](/proxy/?url=https://content.instructables.com/FHL/YQHS/IDCXOY58/FHLYQHSIDCXOY58.png&filename=Screenshot 2015-08-16 20.21.15.png)
![Screenshot 2015-08-16 20.23.12.png](/proxy/?url=https://content.instructables.com/FSP/LO0R/IDCXOY7S/FSPLO0RIDCXOY7S.png&filename=Screenshot 2015-08-16 20.23.12.png)
![Screenshot 2015-08-16 20.23.44.png](/proxy/?url=https://content.instructables.com/FIL/Q2T3/IDCXOY8H/FILQ2T3IDCXOY8H.png&filename=Screenshot 2015-08-16 20.23.44.png)
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.
Future
![IMG_0058.JPG](/proxy/?url=https://content.instructables.com/FJD/E0S0/IDFSHYGQ/FJDE0S0IDFSHYGQ.jpg&filename=IMG_0058.JPG)
![IMG_0057.JPG](/proxy/?url=https://content.instructables.com/FO1/NW4A/IDFSHYGV/FO1NW4AIDFSHYGV.jpg&filename=IMG_0057.JPG)
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