My background is not as an EE, but as nobody who is experienced has replied I'll give it a shot. In the future, posting with the correct [EE] topic tag will let your entry be viewed by many more people on this list. So for the ADC conversion, you'll first need to know the specifications of your audio signal. Many audio signals are indeed 5v for smallish radios, and the ones that are not can be shifted there fairly easily with a simple voltage divider. For example, if you have an audio signal from -12v to +12v, you could rectify it with a couple of small signal diodes to make it 0v-12v, then run this signal through a resistance tree to get 0v-5v on the output. Since you're not worried about playing this particular signal on the speaker, the rectification would make for a more accurate "amplitude" measurement as well, especially if you tried to average the signal with added capacitance. My attempt at an ascii schematic: (* is the output signal) D1 R1 R2 -->|----/\/\/--*--/\/\/---Gnd A bridge rectifier would be better, as would averaging the signal to some extent with a capacitor. Calculating the proper resistance/capacitance needed for averaging an audio signal is beyond back-of-the-envelope for me, so maybe someone more knowledgeable will jump in and offer assistance. ----- Original Message ----- From: "Michael Cunningham" To: Sent: Friday, December 17, 2004 12:57 AM Subject: audio servo driver PIC design help > I breadboarded the design ya'll helped me > with previously and everything works perfectly! > Thankyou!.. Now on to my next challenge.. it is > stretching my mental capacities so far and should give > me experience with the a/d converter if it can work > like I think it might. This is a hobby circuit.. nothing > professional here. > > I have a servo mounted in a fake skull that can move > the skull's jaw. There are several non PIC based circuits out there > now to do this but they are simple threshold circuits. > If the circuit detects an audio signal it tells the servo > to move as rapidly as possible to open the jaw until sound > is not detected and it closes the jaw as rapidly as possible. > While this works..its not very realistic. Its doesn't account > for the fact that a loud sound should open the jaw faster > and in turn, further then a softer sound. > > It seems that a PIC with an a/d converter and ability to drive a > servo using PWM could be a good solution to this. > > Basically what I want to do is sample a line level audio > signal pretty rapidly and based on the presence of sound > move the servo to open the jaw at a rate based on the > amplitude of the sound, so a louder sound will cause the servo > to move quicker to a location and hence further then a > softer sound which will cause the servo to move slower and less > distance then the louder sound. So if it screams it will rapidly > move the jaw open, and a whisper will just cause a tiny jaw movement > despite the duration of the sound. > > After doing some basic research on the net it looks like I will > need to use some circuitry to cleanup the audio signal since > the a/d converter bases its comparisons on 0 to Vdd and as I > understand it, audio signals aren't 0 to 5 volts. > > Any ideas how I can do what I want to do? I know this project > is probably over my skill level, but ya don't learn unless you > push yourself. How would you do it? I don't think the actual > circuit is the big issue (except for the audio cleanup part - no > clue there) since there are plenty of examples of driving servos > with PICS on the net. My biggest hurdle is using the a/d converter > to figure out if sound is present and the amplitude of it and > creating a direction and rate at which to move the servo. > > Thanks, > Mike > > > _______________________________________________ > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > > _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist