mabe if u screened the back inside of the mikes it would get u a diff,about the delay i think his delay was for somthing else could be wrong ,i once was
Are you talking about if it hears sound from this angle to start with?
What I was saying is that it determines the angle from the zero position, looking straight forward. The sound source is going to be either in the front, left, or right. The angle can be determined by the software with a formula to calculate the values.
Forgive me if Iām still misunderstanding you.
Oh, you ment the sound coming from the back side, behind the mics. Iām not sure how one would do this. Perhaps Pete can give an answer.
Well, I can answer that.
Anything on the front side of the head would be synonymous with the back side with only 2 mics.
In all honesty, this wonāt much matter.
A servo only has 180 degrees of rotation, anyhow.
If youāre behind the botās head and shout, it will turn itās head so that the back of the head points directly at you.
This would look a bit odd.
Sort of like the bot is purposefully ignoring you.
For that reason, I probably wonāt bother fixing it.
Yes, another microphone would alleviate that.
And, no, I canāt think of any way to do fix it without the aid of a third sensor of some sort.
Oh, and Mike, stop putting yourself down.
Just look at me.
::points at self::
Does it look like I know anything?!
(Really, itās OK, you donāt have to answer that. )
Pete, thatās a really neat way to do it.
I had been wondering how you were going to time the two sounds with only a single processor thatās not capable of true multitasking.
Leaving the sensing of that to the microās hardware sounds like a good way to overcome those problems.
Iāve been looking at what your speed of sound example said and it seems like even the distance of mikeās bot head would be enough to give an ample resolution with a decent micro.
Assuming only an inch of distance between the two mics, thereās still a max delay of 83uS or so, which is rather long in the micro world.
Still, though, Iām going to mount those buggers as far appart as I can on my bot.
Ahhā¦
That comparator stage looks like a nice way to save an interupt input.
Iām a bit confused about that, though.
How are you going to have your micro tell the difference between a high and a low if the inputs of the comparator stage will be varying analog levels?
Wonāt the signal coming out of the comparator be of a varying level as well, susceptible to dishing out a voltage at a level that your micro will have trouble deciding is high or low?
From looking at it, Iām assuming that the input pins will interupt on change, as it looks like youād need that, rather than them interupting on just high or low, as I had previously assumed they did.
Is that actually how they work?
Oh⦠and it looks like youāre sharing your programming pins with the audio āloudnessā inputs.
I had been told that this was a no-no for beginners like me.
How are you keeping them from messing with each other?
Are you just planning to be real quiet when programing, or is there something going on here that I donāt understand?
(Probably the latter. )
Hi Nick,
Multitasking is really a SW problem, not HW. Almost any CPU can do it, but it might be horribly inefficient on a smallish PIC.
However, multi- processing might be what you mean - it requires more than one CPU actually running at the same time.
You guys are right: A 2-mic solution does not differentiate between front and rear. Animals work it out with subtle clues such as echoes, and head movement.
Yes. But the mics and other things are imperfect, so I would expect some āslopā, which means putting the mics further apart is always a good idea.
Re: The comparators: They output essentially a ādigitalā signal - either all high or all low. The resistor divider driving one of the inputs sets the level at which the comparator will change its output from H-L or L-H. So, the output of the two comparators only indicates āa sound was detectedā. The 16F88 PIC has only one input that will do edge-sensitive interrupts; so instead I use two of the PORTB pins, and go for an āinterrupt-on-changeā.
Those two pins are indeed shared with the programming pins. This means that to burn new code, I have to remove the LM339 from its socket. In theory, it will also work to just ensure that the comparator outputs stay āhighā during the programming.
Pete
Doh!
Now I see where I went wrong.
Looky here, Mikey.
If yeh wanna learn yer smarts like I beā¦
Just ask logically-garbled questions and then hope that a kind soul like Pete will come allong, magically decode your pagefull of questions, and put things into really small words.
Thanks, Pete!
Methinks Iāll stick around with Mikeās design (with the altered components for a better range, of course) and give it a try, since he was so nice as to send me a board.
Once I get to the point where Iāve found the limitations of the āloudnessā hardware, Iāll rearrange things and make one like yours.
Theyāre both just too interesting to pass up, and definitely within my pricerange.
Who knows, maybe Iāll trip over a better way to use the āloudnessā comparison and get some decent info out of that.
Maybe theirin lies a way to guess the forewards/backwards direction of the soundā¦
Heh, Nick,
Sorry, I forgot about sending you the board last weekend, I will have it out this weekend, I promise!
Sorry!
As for smarts, I think you surpassed this old geezerā¦
JK
You have come a long way since the beginning though. Proves you have really taken the bull by the horn and learned a great deal on your own. Yeeeehaaawww!
Although Iāll be playing with Mikeās loudness circuit for a while once I replace my programmer, in the meantime Iāve been putting together a circuit for my bipedās car that uses both loudness and speed as Pete did.
Iāve decided to go ahead and make it with 3 mics though, so the bot will know which direction (forewards/backwards) the sound is coming from as well.
Iāve finally come to the point where Iāve run out of ADC pins, though (and my micro has 13!).
So instead of keeping them seperate as in Mikeās circuit, Iām going to combine the three with another opamp.
In your circuit, Pete, it looks like you use 110k resistors before the 3rd opamp to divide each seperate voltage in half before smushing the two together.
So, methinks Iāll just take the output of my 3 opamps and use a 200kās and a 100k to divide each into thirds before smushing all 3 together.
Iām a bit confused as to the gain resistor across your opamps.
Mikeās circuit uses 1M.
Did you split up the gain into two stages by using 300k in the first and 110k in the second?
If so, how do you determine the overall gain of the two stages?
Iām thinking that itās not simply multaplicative, since thatād give you a 30M totalā¦
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
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.
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.
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ā¦
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 ).
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.