Radioshack Special - Build your own bot ears!

well nick, considering you asked me to help out on this on AIM, heres wat i think

you need to make this thing realllllyy power, the rover i mean, so that it can carry and little perron in it, (I.E. me), from there, you have me blindfolded while you recklessy race around you house, if i scream you know you’ve hit something, and also, i would point to the noise when i hear one and from wat direction, if all works out, you shouldn’t need a new me for a day…or two

:laughing:

im jking every one

Nick, perhaps Pete can chime in on the question regarding the gain resistors for the op amp. I know that the resistor acts as a feed back loop. Higher resistance provides less feedback to the neg input of the op amp. This causes the op amp to “think” it needs to amplify more.

Best way to describe it is like our ears are the neg input and when we adjust the volume on the stereo, we “listen” for the loudness. We keep cranking up the volume till we get the desired output level. Now if you put ear muffs on your ears (the resistors) you will not hear the volume as much, so you keep cranking the output so that it’s loud enough for you to hear it through the muffs.

The resistors on the op amp take the output and “trick” the op amp into thinking it needs to crank out more and more.

This is in a nutshell how I understand it. Pete might want to put me in a straight jacket, but that’s my analogy of it. :laughing:

In my circuit, the 3rd amp does a summation of the 2 signals, but it does not amplify the summation (because of the value of the feedback R). It is a simple ‘mixer’.
On your circuit with 3 sources instead of two, you should still use 100K’s all around. The reason is that the R’s for each channel are part of the equation for each other channel.
But if you want to add overall gain to the mixer, just increase the feedback R. The gain of the circuit is about proportional to Rf/Ri, so if the Rf were 200K, the gain is doubled. [This is a simplification, but it’s close enough for now.]

My first stage has a gain of less than 300 (actually 300/1.1). Mike’s circuit is going for a rather high gain (about 1000). My own version hasn’t really been ‘road-tested’ yet, so I could end up changing the Rf values. Mike’s mics are different, as is his A/D.

It is multiplicative across the stages, but the first stage is 300, and the second stage is 1, so overall it’s still 300.

Regarding the need for the feedback resistors:
An op-amp is fundamentally a very high-gain device. Without using negative feedback, it would run ‘full throttle’ all the time - it is called “running open loop”. This may sound like a good thing, but in reality it makes it unstable, and you wouldn’t be able to predict the exact gain for each amp. If you look at U5 on my schematic, those are ‘comparators’, which are essentially a special type of op-amp that is designed to run open-loop. Why? Because a comparator is intended to have its output be either all on or all off (a digital signal). By comparison, the regular op-amps are intended to amplify signals proportionally; that is, they run “linear”.
Mathematically, you could say that the output of an op-amp is y=mx+b (remember that from basic algebra?), where x is the input, m is the gain, b is the DC offset, and y is the output.

Pete

Ahhhh!
I love when things come full circle and finally click together.
:smiley:

I had been multiplying the gain resistor values when I needed to be multiplying the calculated gain of each stage.
That makes so much sense, since gain is reported without any units, the lack of which is produced by division of Rf/Ri.

Good ol’ function of a line, how well I remember thee…
:stuck_out_tongue:

Nick, did you get the board yet?

Yes, it came in today’s mail.
^.^

Thanks, Mike!

I’ll be soldering it together tomorrow, probably.
If all goes well, I’ll be able to test it even before I get a replacement programmer for my robot PICs.
In school, the other students (slowpokes) just finished building their 16F877’s boards (which means that I’ve done that a week ago and have started programming in assembler :laughing:).
So, as soon as I learn enough assembler to multiply (there’s no multiplication built into this chip!) and access the ADC, I’ll be able to test it.

I’m glad it made it to you ok. Take your time with it. I just wanted to make sure you got it ok.

Nick,
Why do you need a replacement programmer? Did yours break?

Pete

(Sigh)
Ya gotta luv archives. Here I was, contemplating just how to add audio direction-finding without re-inventing the wheel (again), when a site search reveals this.
Exactly what I had in mind. Complete. Whole.

Just thought you should know that old posts never die… and are appreciated by the cogniscenti.

Greetings kdwyer, this circuit is old, and although it works, its performance fell a little short. I have a new circuit design that eliminates the use of the ADC chip and performs much better. You can build two copies of the new design for left and right ears and write code to do fancy things like finding angles. I will try to remember to post the updated schematic tonight if you’re interested.

Sure, an updated version would be great, especially since I don’t have all the components yet!

Ok, Ill upload a PDF tonight. This circuit has good sensitivity.

I forgot, I try to remember tonight! :blush:

Now I’m interested too… And a few days have gone by. Slacker!

if all you are doing is trying to measure the difference between left and right, could you not have used the two mics more like a comparator? one to the inverting input, one to the non? I guess the issue would then be measuring the output. You don’t want infinite gain, because that would tell you left and right, but not by how much. And if you want to measure the output, you almost need a +5v and -5v with 741 chips, but that can’t be read easily by the atom. Anywho, didn’t see the original posts so I’m not sure what you tried, but I’ve always been interested in op-amps. My first robot was a line follower using 4 op-amp comparators.

Oh geez, I forgot again! I’m writing a reminder in my hand! SORRY!! :blush:

Note to self…

Self, don’t forget to… Um… Doh!

No to what? Oh yeah… that’s right! just kidding :laughing:

Ok the note in my hand worked! Here it is, see attached. The values are base values. When you bread board this circuit, you can experiment with C1, R2, R3, R5 values for desired sensitivity.

Sorry for the delay guys. :smiley:
ExpressSCH.pdf (23 KB)

Thanks, an interesting circuit. I like the lights when it hears sounds :slight_smile:

The two outputs- the first is the output of the op amp, whats the second? When the output is high, the transistor is open, so that would be the LED voltage it reads plus 0.3V of whatever for the transistor. When the output goes low that would go to 5V? So its almost but not really the inverse of output 1, or am I missing something?

One output works with the Basic Stamp, the other output works with the Basic Atom Pro. I forgot which one works with which MCU. It’s been a while since I messed with this, but trying both will tell you which one works. I believe the one connected to R4 is for the BAP and the other one is for the BS2. I remember the Stamp worked inverted to the BAP’s adin pins. Also, changing C1 to a higher value will change the delay that the LED stays on, and the pot will adjust the sensitivity. You could try using a 10uF trimmer cap and really tweak the way you want it to work.

I forgot to add to the schematic that Q1 can be a 2N2222 switching transistor.