Sound-To-Servo Driver
This page describes a project that takes an audio signal and uses it to drive a
RC servo.
The louder the sound, the more the servo moves.
The most obvious application of this is to
make your own mouth animation
for talking and singing creatures.
History
Ray Martin is a friend of ours who designs toys for a living,
sometimes electronic, sometimes mechanical.
We were having lunch after the TRW Amateur Radio Club swap meet,
and I mentioned that some of the best
hackable products with animated mouths
were discontinued, and Halloween lovers were constructing
singing and talking props out of alternative things like servos.
Ray said, "I have a circuit that does exactly what you need on my desk right now!"
Ray went further than that.
He customized the design for specific servo limits and pulse frequency,
built a prototype and tested it, and sent me the details.
Since then, David has entered the circuit into our CAD package,
laid out two different prototype printed circuit boards, and experimented with them.
General Servo Theory
A
RC servo
takes a series of pulses and uses them to direct the position of an output shaft.
General servo limits (they vary between manufacturers and models) are:
| pulse width |
angle |
comment |
| 0.6m Sec |
-45 degrees |
minimum pulse length |
| 1.5m Sec |
0 degrees |
center position |
| 2.4 mSec |
-45 degrees |
maximum pulse length |
Notes:
- Increasing the pulse width by 10 µSec results in about a degree of movement on the output shaft.
- These numbers are nominal, and vary slightly between manufacturers and models.
For example, the HiTech HS81 likes pulses between 0.74 mSec and 2.14 mSec.
- The rate at which these pulses are sent isn't terribly important - only the width of the pulse.
Some typical rates are 400 Hz (2.5 mSec pulse spacing) and 50 Hz (20 mSec pulse spacing).
The driving pulse is usually specified as 3-5 Volt Peak to Peak, but I suspect that in many cases you can get by with
whatever power the motor is getting.
I would avoid using a drive pulse greater than the motor power.
Most servos require a power supply between 4.8V and 6.0V.
Circuit Theory
The single LM324 integrated circuit contains 4 op-amps, which perform
three functions in the circuit:
- Two sections of the LM324 (output pins 1 and 14) form an oscillator
set to 50 Hz, the desired pulse repetition rate. The output of the
oscillator is approximately a triangle wave.
- One section of the LM324 (output pin 7) integrates the incoming
sound, producing an envelope signal that is proportional to the
average loudness of the sound.
- The final section of LM324 (output pin 8) compares the output of the
other two sections. This clips the triangle pulses into nice
rectangles, with a pulse length depending on the envelope signal.
Circuit Modifications
The gain of the filter buffer (Pin 7 output) is +3 and the resistor
network reduces the amplitude by a factor of ten and scales the offset
voltage to make it compatible with the triangle wave generator to
generate the 3% to 12% duty ratio as required by your servo motor.
Therefore, those three resistors are the only variables one needs to
modify to obtain the full gamut of duty ratios.
The pulse rate is selectable by changing only the capacitor that connects
from pin 13 to pin 14 of the LM324.
Some sources say, do not exceed 50 Hz for proper servo function.
Schematic
Here is Ray's original schematic:
Click for full size schematic.
David's Etch1 prototype was exactly as Ray drew it.
During testing, he decided on some changes:
- Power regulator on-board feeds +5 (7805) or +6 (7806) volts to controller and servo.
- Potentiometers allow you to adjust servo center position and range.
- Changed value for R15.
Here is David's schematic the Etch2 revision:
Click for full size schematic.
This is one of the Etch2 boards.
David is a perfectionist and wants to fiddle around with it some more,
but the current results are good enough to share.
Related Pages
Please visit our related pages:
Thank you for visiting. Your comments are welcome.
. . .
. . .
©Copyright 2004 by The Wolfstone Group.
All rights reserved.
You must read and abide by our terms of service.