Sound to Servo

fritz42_male

Senior Member
I'm pretty sure this has been dealt with before but I'm looking for the easiest way to get a sound to servo setup on an 08M or 14M.

Ideally, I will be taking output from one side of the stereo output from a low cost MP3 player BUT a piezo might be an alternative option if glued to a speaker. The aim is to position a servo on a jaw mechanism of an animatronic skull - I can custom edit the side of the audio track to get a more realistic link between jaw movement and speech.

I've looked at the standard picaxe sound circuit but has anyone got a solution using a much lower part count? I'm designing a custom prop controller and want to keep the board size as small (& as adaptable) as possible.

Thanks in advance for any suggestions.
 

BeanieBots

Moderator
Is there actually any correlation between volume and jaw movement??
If you just want the jaw to open when there is "sound", then that circuit is probably your best bet.
You could cut down on component count by designing out the transistor amplifiction stages with an op-amp + detector circuit.
 

fritz42_male

Senior Member
I was considering using amplitude to define jaw movement. By editing the scond audio track, I could make the jaw move to a greater or lesser degree to make it more realistic.

However, this isn't essential.

I've been looking at simple op-amp circuits - my main criteria is a low component count.
 

BeanieBots

Moderator
The minimum (component count) I can think of would be-
Op-amp for gain, driving a diode (via resistor) into cap//R as a detector.
If your audio source is more than 1v pk-pk then you might not even need the op-amp. Just the detector circuit only using a limited range of the full scale A to D function.

You would need to experiment with values to get a sensible attack/decay rate combined maybe with some software profiling.
 

fritz42_male

Senior Member
I believe that line-out is 1.3V P2P but not sure about the headphone outputs?


That component count would be fine. Any suggested circuits and what software profiling would I require?

Thans for the help.
 

BeanieBots

Moderator
1.3v is just about enough to get reasonable values from the ADC.
As first off, it's worth trying with just a detector circuit as described earlier.
A typical servo takes a few 100's of mS to a 90o rotation, so there is no point detecting anything above that time frame.
Try series diode + 10k with 47uF to ground parallel with 100k as a starting point.
Use debug or sertxd to see what sort of values you get.
Then devise a formula to convert those value into a suitable range for servo demand positions.
Once that's working, it's a question of playing with attack/delay values in software to see if anything can be done to make realistic from what is essentially a volume indication.
 

fritz42_male

Senior Member
If you haven't already seen this site, it might help.
http://www.scary-terry.com/audioservo/audioservo.htm

I've used the audio section, up to pins-12/13 on the 4066. Feed that into a PICAXE 08M's ADC, converted that to a usable variable range, and drove the servo.

Lots more too by Goggling: Halloween skull servo.

ken
Just spotted your reply Ken - thanks.

Yes, I'm trying to duplicate the Scary Terry setup but without using the 4066 and 555 setup. Did you include the 4066 or just use the audio amp portion?

I was trying for as simple as setup as possible so was hoping there was an easier way but probably not. I've bought in a little Mic/Opamp board which I'll have a play with but it has no gain/sensitivity control so I'd have to do that in software. Perhaps I ought to have bitten the bullet and just done what you've done.
 

KMoffett

Senior Member
I stopped at the top of R15, no 4066, or anything after that. The gain and offset were important to get the results I was looking for.

Ken
 
Top