Looking for example where Propeller can monitor audio frequency and volume.
RobotWorkshop
Posts: 2,307
I think I've seen something similar in the forum before but don't recall exactly where....
I want to use the Propeller to monitor an audio (line level out of a laptop sound card) to read the approximate frequency of the audio signal and also the volume. At the very least just the volume level. I have a Propeller acting as the co-processor on a new robot and it is handling all the lighting effects on the robot. If the Propeller can monitor the audio signal I can use the values for the frequency and volume to help control the lights.
If you know of any similar examples or have seen them in the forum please let me know.
Robert
I want to use the Propeller to monitor an audio (line level out of a laptop sound card) to read the approximate frequency of the audio signal and also the volume. At the very least just the volume level. I have a Propeller acting as the co-processor on a new robot and it is handling all the lighting effects on the robot. If the Propeller can monitor the audio signal I can use the values for the frequency and volume to help control the lights.
If you know of any similar examples or have seen them in the forum please let me know.
Robert
Comments
http://obex.parallax.com/objects/488/
-Phil
I really don't need a ton of accuracy on this. I'm just going to use the data to control a set of 7 LED's used as the mouth display on a robot. There are 32 LED's on the head that the Propeller is controlling (as well as 20 on the body, head movement control, and other misc functions. I want the Propeller to monitor the audio line so it can control the lighting on the mouth LED's depending upon the volume and frequency. I'd just like it to look like it is talking when it is talking. All of the speech is generated from the laptop that is running the overall robot.
Since I am much more comfortable working on the digital aspects of the wiring do either of you happen to have an example schematic on how the MCP3208 chip or Propeller would be wired to monitor the Audio line?
Robert
I'm not sure what the impedance is on a headphone jack, or the voltage swing, or if you are planning on having the jack going to another audio output... so that information would help a bit.
Robert
What is the # of the OpAmp that you are using in the schematic? I think there is still room on my protoboard where I can add one.
Robert
Here are a couple that should function the same: 2CH: MCP6282-E/P or TLV2772CP -- 4CH: MCP6284-E/P or TLV2774CN
Do you think something like a TL082/TL082CP Wide Dual JFET Input Op Amp would work instead? I have a couple of those on hand. I probably also have many of the older classic op-amps in the junk drawer too. If possible I'd like to use a common part and one that I may already have here.
Robert
Notes on Audio Op-Amps
OPA350 will work, in fact has way to much bandwidth so you will want to limit it with that part.
It fits the voltages however.
Also the Lm324 and Lm358 and the other versions in that family.
I would run the op-amp off of the 3.3 supply and for the bipolar type of parts you will need to
reduce the 2.2M divider resistors down to like 22K and raise the coupling cap to 10uf.
220K's and 1uf if the offset caused by input bias currents does not bother you.
The ref for the A/D would now also be 3.3v, I am assuming this part Ref is an input and not
the A/D putting out a Ref which is about a diode drop below it's supply. I am not sure why
the 2.5 volts in Bobb's circuit, but am open to learning.
From what you describe your not looking to make a high quality audio preamp just detect
audio range signals to light some led's so you do not need audio grade op-amps , anything
will do as long as it works down to 3.3v
Tom
I just found some LM358 chips and they may be a better choice for this circuit. I'm going to try and wire it up to see how it reacts and if I can get a reading on the propeller. Since it is a dual unit I can wire up the same thing for the other channel so I can pickup any sounds on that one too.
Thanks for the suggestions.
Robert
I'm trying to use a LM358 since I had some spares on hand. It is running at 3.3V. I'm bringing the left and right channels to the chip and then the outputs from there to channel 0 and 1 on the ADC chip. I've tried a couple different resistor/cap combinations but I can't seem to pick up anything yet. The most recent was two 22K ohm resistors with 10uf cap. I'm going to re-check all my wiring on the LM358 again in case I've overlooked something.
I may have some other op-amps if anyone happen to know of others with the same pinout and would operate on a single 3.3v supply. That chip is in a socket so it is easy to swap out.
I'd really like to get this working over the weekend if I can.
Robert
Can you post schematic of analog ckt? Also, what is your sample freq ? By expected values on 3.3 and gnd you mean FFF and 000? Thinking on this as I write, need to see the input analog ckt gain too high hitting rails no values in between?
Robert
So, now all I need to do is tweak my code to get the effects that I want but so far it seems to work well.
Thanks to everyone for the suggestions.
Robert
http://www.youtube.com/watch?v=3MTEQHUQRlQ&feature=youtu.be
http://www.youtube.com/watch?v=ExrksOLL3vc&feature=youtu.be
Robert
Wow! Can you tell us more about the speech recognition and generation?
-Phil
This is for an old Android Amusement DC-2 robot that I picked up. There was a write up on these robots in the latest issue of Robot Magazine. All of the original electronics had been stripped out (and thrown away) by the previous owner. I had to start from scratch on the electronics. It was originally a remotely controlled showbot but now it will be a fully autonomous robot that can be remotely controlled if desired. I'm using a Propeller to control all the lighting, some I/O, and control of a hacked Logitech Orbit MP camera. It can also display things on the touchscreen in the chest and I'll probably have the Propeller do a few other things as well. The robot never had a display for the mouth. I really thought it should have some so I built that mouth display from a piece of plexiglass. I was able to make it without drilling or altering the robot so I could undo it if I wanted to. I think it adds a lot so it will stay.
The main brain of the robot is running on a Windows XP based laptop. The laptop a bad LCD screen but I didn't care because that was being removed since a 10.4" touch screen in the chest of the robot would be used instead. The software is based on the software from the Leaf project:
http://www.leafproject.org/
It uses the Microsoft speech engine . None of the built-in voices seemed to fit so I bought one from:
https://www.cepstral.com/
It is pretty reasonable in cost for a license to use on an individual system. You can also tweak the effects to give it a more robot sounding voice.
The LISP code running on the laptop is looking for words it recognizes and will process them accordingly. Once I finish some of the hardware side of the project there are quite a few routines I want to add to the higher level LISP code.
I've been trying to take a lot of pictures along the way and am going to document the whole project. I just thought it would be cool to at least get a quick video up of the project so far. Still lots to do. It has been keeping me busy!
Robert