Driving a servo from raspberry pi 3.5 audio
Moderators: adafruit_support_bill, adafruit

Driving a servo from raspberry pi 3.5 audio

by sideburn on Sun Jan 05, 2014 1:51 am

Hello,

I have a need to run a servo from a RPi's audio output.
I am using omxplayer to play a video and I am syncing the servo's movement to the video by embedding the servo PWM signals as the audio track in the video and then connecting the audio output to the signal input on the servo.

I have confirmed this works from my laptop computer.
The problem is that the RPi's volume level is a tad bit too low to drive the servo.

Would an LM386 amplifier solve my problem?
I tried using a generic amplified speaker used for smartphones etc but the signal was too noisy when I looked at it on the oscilloscope so that has gotten me concerned if this is doable.

Any tips appreciated.

Thanks

-Tavis
sideburn
 
Posts: 39
Joined: Tue Aug 18, 2009 3:07 pm

Re: Driving a servo from raspberry pi 3.5 audio

by adafruit_support_mike on Sun Jan 05, 2014 3:56 am

Interesting..

You should be able to get an LM386-based amp to work, but you may need more than just the chip. IIRC, that has a fixed gain of 20 that can be jumpered to 200, or vice versa. You might need some voltage control to get the signal to the right levels while keeping line noise low enough to avoid problems.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 10777
Joined: Thu Feb 11, 2010 2:51 pm

Re: Driving a servo from raspberry pi 3.5 audio

by sideburn on Mon Jan 06, 2014 7:40 pm

Yep it worked!
I shorted pins 1 and 8 to get maximum gain (i think)...
I didn't have to add anything else to the amp. no resistors no caps..
Not sure if i can make it even better with caps or not..

http://www.youtube.com/watch?v=Ad69Cd-ahu0
sideburn
 
Posts: 39
Joined: Tue Aug 18, 2009 3:07 pm

Re: Driving a servo from raspberry pi 3.5 audio

by adafruit_support_bill on Mon Jan 06, 2014 8:06 pm

Cool effect! Thanks for posting. :D
User avatar
adafruit_support_bill
 
Posts: 31750
Joined: Sat Feb 07, 2009 10:11 am

Re: Driving a servo from raspberry pi 3.5 audio

by sideburn on Mon Jan 06, 2014 10:00 pm

Heres one with everything running off the Pi.
There is a problem though. I cannot power the servo off the same supply powering everything else.
It must have something to ddl with the ground on the audio jack.
As you can see I am powering the servo off of a separate 3.6v battery.

http://www.youtube.com/watch?v=S6JlAZkq6io
sideburn
 
Posts: 39
Joined: Tue Aug 18, 2009 3:07 pm