Anyone here good with building circuits?

I have a project idea that I need help with. I dont know much about designing circuits but I do have a audio circuit that I am trying to hook up to the stamp.

If you post some specifics, we might be able to help :slight_smile:

Yes, I am pretty good with creating circuits. Before I liked robotics, I liked to make circuits (they are similar, but have some differences). Eventualy, I liked making things move.

Ok Andy, here is the schematic I made. Now my goal is to eventually give my bot head some ears. The concept is simple, but the circuit that will work is not. Basically what I want to acheive from this circuit is to have a left and a right mic. the circuit needs to provide a signal that the basic stamp can read. What needs to happen: the stamp needs to determin what mic is loudest and then perform some kind of action. For example, if the right mic is louder than the left mic, the stamp needs to detect this and then move the head servo to the right. All I want is for the stamp be able to detect which mic is receiving the loudest audio and then take action on that. I do not need the circuit or the stamp to calculate the angle or direction of the audio sorce.

Look at my design and see if this is going to work, also, I have no idea on what values to use for the caps and diodes. The 2.2k resistor for the mic I got off the internet for powering electret mics, so I know this value is ok.

This is where you come in…

http://img466.imageshack.us/img466/5125/stampaudio22an.gif

Sorry Mike, I’m not much of an analog buff. Not being familiar with the BS2, I assume your using analog inputs or comparator pins.

Here’s my guess: My understanding of microphones says that the signal coming off them will bounce positive and negative based upon the frequencies that they sense. If you pass that into a cap before your amplification or after without rectification you’ll end up with near 0V signals coming off each one.

What kind of mic’s are they? A model number or the place you got them from.

PK

It’s an electret mic (3 wire) from radioshack.

Electret Microphone Element with Leads
Model: 270-092

http://rsk.imageg.net/graphics/product_images/pRS1C-2160123t98.jpg

radioshack.com/family/index. … 58.2032230

I would use a lm386 for the main reason that it only needs 5v to work and can go up to 9v. Where as the one you have in your circuit requires a min of 12v to 18v.

Here is a schematic or a lm386 circuit that I use with my speakjet. It has a voulume control.

putfile.com/pic.php?pic=12/34822540075.gif&s=x11

Just hook the mic to this. The 2.2k resistor is the impeadance that the mic will have. So if you have a 1k there then you will have 1k impeadance.

But im not to sure about the lm1458 nsince i have never worked with it.

And then you use freq in to read the noise and right your code from there.

PK

Thanks PK, I’ll give it a try and see what happens. If this works, then you are the man of all men!

Thanks again.

I agree with PK on this one. I have used that chip multiple times in various robot projects, although not as a component in a sound sensing circuit. They have proved to be very reliable and have never caused me any problems. I used to get them to drive motors.

I found a solution to my design. I will use 2 LM741’s and a ADC chip to do the stamp communication. I need to get the parts and write some code to try it out. If it works, I will post all that information here.

Mike

Wouldn’t it be easier to use a third amp to compare the levels of the first two?

Have the output of IC1A feed the + input to the third amp and have IC1B feed the - input of the third amp. The output of the third amp would go to the stamp pin.

So, if Mic 1 is louder, the stamp pin will be at +5 volts, and if Mic 2 is louder, then the stamp pin will be at 0 volts.

Potential problems:

The two analog inputs may need some level adjusting so that the robot is facing directly at the sound source.

You might want to slow down the high frequency response of the three amps so that the stamp sees more of an average over a short period of time rather than an instantaneous reading.

In the program, add a little filtering to prevent the robot from wandering from right to left. This could be something a simple as three or four samples of the stamp input pin. If all three are 1’s, then turn to the right. If all three are 0’s, then turn to the left. Any combination of 1’s and 0’s would indicate straight ahead.

         Rick

Well actually I have been consulting with one of the quys from Parallax on this circuit. The engineer I talked with suggested using an ADC chip to communicate between the audio circuit and the stamp. I plan on using an ADC08032 8 pin DIP. I thought about what you said in regards to using filtering in the code to eliminate a constant back and forth motion with the servo. I was going to have the code check for inputs levels at a set time and have the servo move when there is a significant input differance.

Here is my latest schematic of this circuit.

http://img370.imageshack.us/img370/7381/basicstampaudio3a9pt.gif

hmmmmmmm i can build one, i did beam robots way before i try program one

Hi Mike,
I see several possible problems/concerns with the schematic you posted:

  1. Earlier, you showed an LM1458, now it is two 741’s. The 1458 essentially is a pair of 741’s in an 8-pin package. A 741 has a couple of extra signals (offset, as I recall), but you’re not using those anyway. So, using a 1458 would be simpler. But, you should be using a different type of op-amp anyway, see below.
  2. The places where C3 and C4 connect to the op-amps needs a resistor to ground. Without it, the op-amps input will tend to saturate, and you’ll get no output. However (see item 5 below), your circuit doesn’t have the proper ‘ground’ for the op-amps…
  3. A resistor is needed from the (-) inputs to ‘ground’ (again, see item 5). Without it, you are running “open loop”, which means that the amps will saturate at the slightest input, and you won’t be able to tell which was loudest.
  4. I would use an LM324 chip instead, which contains 4 basic op-amps. Use 2 of them to amplify the mic signals (similar to what you have now), and a 3rd to act as a comparator. The ‘comparator’ is what someone else in this thread already suggested as a way of determining ‘who is louder’.
  5. You have the op-amps running from 2.5 V. Is that a mistake? Or are you trying to limit the imput to the A/D to a 0 to 2.5 V range? In any case, I’m not sure a 741-type op-amp can work on such a low voltage. I recommend running the op-amps on 10 V, and then (if needed) scale the output of the op-amps with a resistor divider. Also, the 741 is intended to be run off of differential power (a + V, and a - V, with a common ground), so with the way you’ve drawn it, the 741’s are really seeing +1.25 and -1.25 V, which I suspect will not work.
  6. The way you are making the 2.5 V (using two 1K resistors) is very wasteful of juice. It will waste 2.5 mA all the time. Instead, use a resistor and a Zener diode, or a resistor and a string of ordinary diodes in series, to create the voltage you want. I can explain the detail if you want. However, I don’t think you need to be doing that at all.
  7. I don’t see the need for the A/D, unless you want to know “how loud” each of the inputs was. Something that would be more useful would be to know “which mic heard the sound first”, so that you could have a (probably) more reliable way to tell which way the sound came from.

Pete

I mis-spoke a bit on item 4: It’s not “open loop”, but rather a “unity gain” configuration that you’ve drawn. This means the op-amp is not amplifying the input voltage at all - the output V will be the same as the input. I’m thinking you don’t want to do this, because the output of the mic is not high enough to easily measure with the A/D.

If you’re going to do this with op-amps, you’ll need to change a few things. The LM386 that others have suggested might be the easiest to get working (you’ll need 2 of them), although it will require a few more R’s and C’s.

Pete

Thanks for the input Pete!

The reason I changed from my original part 1458 to 2 seperate LM741’s were from a post from one of the Parallax staff who is apparently an IC layout engineer. He suggested that using 2 LM741’s would be less confusing than one 1458. He also suggested using an ADC chip to communicate from the circuit to the stamp. I have ordered this part ADC0832 (2 channel ADC) and it should be at my door step in the next few days. He did not mention any other problems with my circuit and he is the one that suggested also to power the LM741’s with a split voltage supply

I have a hard time following what you said about the caps, and resistors. Can you draw up what you are talking about using the Express PCB schematic program? If you have it I can email you my schematic file. If not, you can download it for free here: expresspcb.com/

Here is my latest design with the most accurate wire routing including the ADC0832. This schematic is the one I am going to use for my bread board test. To view it, click thumbnail and then click the image again to see full screen. It is fairly large to show detail.

img322.imageshack.us/img322/6720/stampaudioab4hs.th.png

Thanks Pete, I may need all the help I can get.

Mike,
I just e-mailed you an SCH file. I prototyped this circuit and tested it today, and it works. I figured I may be wanting something similar for my bot within a few months, so it was a good excuse to re-familiarize myself with the LM324 op-amp.
Your latest schematic is much better than the previous ones. The one I just sent you is very similar - the only important difference is the LM324.
Reasons I recommend the 324:
You get 4 amps in a 14 pin DIP.
It has lower quiescent current than a 741 (sucks less power when it’s not doing anything).
It is better suited to single-supply operation.
It will run off of a lower supply voltage.
If you’re going to stay with the 741, I’d suggest using the 1458 - it will simplify your circuit overall. You don’t need the extra pins on the regular 741.

My schematic has some notes written on it, but some other comments:

The value of the output C is dependent on two things: 1) What is the input impedance of the A/D, and 2) How long do you want the output signal to linger after a sound has stopped (it’s mostly a SW issue).

I ran my mic off of 5 V. Your mic may be different.

The ratio of R3 and R4 determines the DC output level when there is no sound input. With the LM324, it is possible to set the level very close to 0 V. This is another advantage of the 324 over the 741 (the 741 will not allow the output to go so close to the negative supply input, which is 0 V in this case).

The values of R1 and R2 depend on the output level and impedance of your mic, and how sensitive to sound you need the circuit to be. In general, set R1 to the output impedance of the mic (mine was 1K), and then play with R2 to get the amount of gain that you want.

Pete

One more thing: On your latest schematic, R8 and R9 are way too big - you’ll have a gain of only 2.

Other than that, I think it should work, although I still recommend the LM324 for this application.

Pete

WOW Pete!

Where were you weeks ago when I needed you! I have been trying to get the kind of help you have provided me for a long time, but I had to take what I could get. I had some input from others which I am very greatfull for, but I was pretty much left on my own to put the pieces together to get the circuit where I have it now. In a way I’m glad they did not give me all the answers, as this caused me to learn more about my project and I have some satisfaction from this.

I don’t have an LM324 so I think I am going to try just one LM741, since I only have one, to see if I can get some kind of data reading.

Is the LM324 a popular part? Meaning, can it be bought at Radioshack?
I like the low power characteristics and it would probably make for a smaller board design as well.

If all goes well, I want to design a circuit board using the proven breadboard test component values, complete with silkscreen and green solder mask. Spark Fun has some good prices on this.

Since you have an interest in using audio senesing in your bot as well, I can order a few extra copies and give you one in return for your help if you want.