Control Servo With Headphone Jack

by CallMeSwal in Circuits > Audio

6012 Views, 35 Favorites, 0 Comments

Control Servo With Headphone Jack

Control Servo Via Headphone Jack
55d1631967400c7133000c14.jpeg
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
IMG_20150815_214154.jpg
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
Snapshot - 10.png
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
Snapshot - 8.png
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
Snapshot - 19.png
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
schematic_bb.png

Wire up the servo as seen in this diagram.

Downloads

Control the Servo

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
Screenshot 2015-08-16 20.21.15.png
Screenshot 2015-08-16 20.23.12.png
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
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