4
\$\begingroup\$

Yesterday, I found that it was possible to control a servo using a headphone socket with a fairly simple circuit. I've got a project where I need to to control a dc motor via a headphone socket. Is such a thing possible? I basically need it to rotate at various speeds as well as change direction quickly. Apparently it is possible to modify servos to rotate continuously but none of them seem to have the speed I require for my project

Here's some context as to why I need this. Yesterday, I had an idea on how to automate the black card technique in landscape photography where you move a black card up and down in front of the camera during a long exposure. I want to build it on the cheap so this is my design:

enter image description here

Animated and annotated versions

The DC motor is stuck to the bolt, which is rotated. The nut is stuck to the plastic cylinder so when the bolt rotates, the cylinder travels up. If you reverse the current, the cylinder travels down. The DC motor therefore needs to work in both directions with the headphone socket circuit. As this is already quite a bulky setup, I'd rather not build a whole arduino into it so if I could get it working via the headphone socket of my phone or music player, that would be ideal!

I've never really done much electronic engineering before so go easy on me please ;)

Any help is much appreciated!

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

Within reason, it is possible to drive almost anything from a headphone socket if you have some 'smarts' on the other side decoding the signal. As you have said, you'd prefer not to use the Arduino, but there are of course much smaller microcontroller systems if physical size is a problem.

For bidirectional control of a DC motor, you need at least a power supply and an H-Bridge. It would actually be possible (with perhaps some risk to your phone) to drive the 'A' channel on the H-bridge with your left audio output and the 'B' channel with your right audio output. This makes some assumptions which may or may not be true depending on your phone, for example, that your audio output is DC coupled (that is, it will pass a very low frequency signal). Of course, you would likely have to use a transistor on each input to shift the levels from ~1V P2P to ~5V P2P (if you are using a common H-bridge chip such as the L298). So you are looking at probably about half a dozen parts anyway including passives.

Probably the best thing is to invest in doing it the 'right way' by devising some simple digital protocol which may be transmitted by your software and using a simple microcontroller on the device. It would be fairly straightforward to do with even the simplest 6-pin microcontroller.

\$\endgroup\$
2
  • \$\begingroup\$ To be honest, it was more the additional complexity of having to use an Arduino that put me off it. When I started, I didn't really think I would be needing H-bridges and large circuits but I see now that this is probably going to be the case. If I were to use an arduino microcontroller or similar, I would probably just build an LCD screen and a couple of buttons onto it to deal with the signal generation rather than use my phone to control it. Of course, I could eventually use bluetooth or wifi too but I'd rather not go there for now! Thanks! \$\endgroup\$
    – Durand
    Apr 14, 2013 at 12:37
  • 1
    \$\begingroup\$ Public Service Announcement: Arduino boards are not the sole and only source of microcontrollers on the planet. \$\endgroup\$ Oct 20, 2014 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.