Shop OBEX P1 Docs P2 Docs Learn Events
Need help with a Stamp audio circuit — Parallax Forums

Need help with a Stamp audio circuit

SN96SN96 Posts: 318
edited 2006-01-06 18:28 in General Discussion
Hello all,

I am trying to build a circuit that will take two eletret mics and have the audio output hook to a stamp. What I want the circuit to do is have a left and a right mic detect audio and have the stamp determin which mic has the loudest output. What needs to happen is if the stamp detects the left mic for example having a stronger signal from the right, it needs to move a servo to the·right or to·the·left depending on which mic had the largest input signal.

I'm not very good with circuit design which is why I need all the help I can get. Another concern I have is since the mic is analog, how would I make the signal a digital signal. Since I am not reproducing sound, the signal can be any kind the stamp can read. I am guessing once I have a circuit that can output to the stamp, that you would use the PULSIN command?

Here is the circuit I have so far.

stampaudio22an.gif
Thanks!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike

·
«1

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-12-16 20:37
    I would use an analog comparator to detect the instantaneous left/right louder condition, this would kill two birds with one stone of the comparison and the conversion to digital. However when there is no sound the comparator will still try to compare the values so given the inherent noise in any analog system, you are likely to get an oscillating output. You should also have the outputs feed into another comparator in a summing fashion into one of the two terminals, and have a variable voltage divider to compare the summed intensity of the two channels, when the output of the second comparator switches (the summed left/right channels on V+ terminal exceeds the reference voltage on the V- channel), you know to sample the left/right comparator to see which is the loudest.

    Im hoping others will weight in with thier ideas, since·Im busy at the moment as we discussed already [noparse]:)[/noparse].

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10

    Post Edited (Paul Baker) : 12/16/2005 8:43:34 PM GMT
  • SN96SN96 Posts: 318
    edited 2005-12-16 20:48
    Thanks Paul, that sounds exactly like what I need. Now my next question would be what part would provide this type of function? I would like to find the data sheet to see If I can figure out how to design this circuit you are describing using both types of comparators.

    Any input from anyone is welcome! I'm sure others would benefit from this project as well since ther are so few of this type of stamp project on the web. (I looked)

    Thanks,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike



    Post Edited (SN96) : 12/16/2005 8:52:37 PM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-12-16 21:08
    Something like the AD8561 its the cheapest one digikey sells that fits the bill, they are more expensive than I remember.


    <edit> after further search I found the LT319AN·which has 2 comparators in a package for <$4 </edit>

    <edit> Aha! theres the old standby, the LM311·for $0.59 apeice </edit>

    BTW, you can use the same part number for both, but on the second comparator, you feed both signals into the same terminal (V+) just as you would for a summing configuration for opamps, I think hyperphysics has an example circuit (for summing opamps).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10

    Post Edited (Paul Baker) : 12/16/2005 9:22:12 PM GMT
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2005-12-16 22:23
    I'm anyone, minimally.

    How about Amp'ing your microphone/s and running that into one of those bargraph generators (LM3915, LM3916.)· You'd have a·display of the sound it's "hearing", too, if you'd like.· You could pick off the voltage from the LEDs' cathodes (going LO/LOwer when ON) and put that into a comparator (LM339, config'd as a COMP), which you could then run to the STAMP.· Additionally, you can use the 3915/3916 to establish your threshold/s by adjusting the range.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2005-12-17 00:14
    Mike,

    I think you are on the right track with your schematic.... "Hear" is a schematic, based
    on yours with a few changes. I basically changed the input configuration you had going
    to the op-amps to make them inverting amps ( better gain ). On the outputs you will need
    to use a Dual input ADC so that the Stamp can read each channel. Basically in this circuit,
    if both inputs are equal, then the ADC value for both channels will be equal. If one input is
    different from the other, then the ADC value will swing HIGH on one channel, and swing LOW
    on the other channel. You should also be able to determine magnitude (volume) with this
    circuit. ( ADC#1 + ADC#2 ) / 2 or something similar to that.


    I might also add....

    I would strongly recommend building this in a SBB (Solderless Bread Board) and experimenting
    with things such as gain ( The 100K resistors across the OUTPUT and INPUT of each Op-Amp) as
    well as the input resistors ( The other 100K resistors). Something like 10Meg or 1Meg would
    not be out of the question for this type of project. Balance is important, so if you change a value
    on one Op-Amp, make sure that you also change it on the other Op-Amp. For "test" purposes,
    you might consider building your design with two LM741 Op-Amps rather than a single LM1458.
    This is simply to help reduce "visual confusion" around a single IC version.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 12/17/2005 12:33:45 AM GMT
    763 x 515 - 41K
  • SN96SN96 Posts: 318
    edited 2005-12-17 01:14
    Thanks a billion Beau!

    I appreciate the time you took to modify my design. It helps me understand so much better what you said by looking at the schematic. I guess I am more of a "visual learner" than anything else. I bought a solderless breadboard just for this project, and I will also try experimenting with the values like you suggested.

    I do have one question about the schematic, what is the +2.5v circuit in the middle of the design? I'm guessing it is the power source for the two LM741's?

    Thanks again!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike

    ·
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2005-12-17 01:39
    Mike,


    Q: I do have one question about the schematic, what is the +2.5v circuit in the middle of the design?
    I'm guessing it is the power source for the two LM741's?

    A: Your right, it is a voltage reference for the Op-Amps. If you look closely, there are two 1K resistors
    that form a voltage divider between ground and your +5V supply. The divided voltage is 2.5V because
    BOTH resistors (1K's) are the same value. This is a common "trick" with Op-Amps so that you do not
    need to supply a negative voltage to the Op-Amp. If you reference 2.5V to the Op-Amp then a
    "GROUND" signal ( 0V ) on the input is seen by the Op-Amp as -2.5V while a +5V signal on the input
    is seen by the Op-Amp as +2.5V.

    Input Voltage - Reference Voltage = What Op-Amp "sees"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • SN96SN96 Posts: 318
    edited 2005-12-17 01:53
    I found this ADC in a 8 pin DIL package. It is the simplest I could find but I'm not sure if it will work.
    ADC0832 datasheet

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike

    ·
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2005-12-17 03:41
    Mike,

    This is one of the preferred ADC's that many people are using.

    Nuts and Volts article:
    www.parallax.com/dl/docs/cols/nv/vol6/col/nv118.pdf

    This article starts out with a ADC0831 and then goes on to talk about
    the ADC0832.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 12/17/2005 4:42:55 AM GMT
  • SN96SN96 Posts: 318
    edited 2005-12-19 15:45
    What's a good general doide to use? Will any low power diode work?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike

    ·
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2005-12-19 20:27
    1n914 , 1n4148 , 1n4001 ...whatever Radio Shack sells in their 50 pack should work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • SN96SN96 Posts: 318
    edited 2005-12-28 15:13
    Hello Guys,
    I am waiting on my part ADC0832 to be shipped to my house. In the mean time, can someone take a last look at my latest schematic to see if anything needs to be changed or added before I begin to bread board this circuit? I want to make sure there are no obvious erros.
    stampaudioab4hs.png
    Thanks for any help!
    [url=http://forums.parallax.com/forums/stampaudio7nc.th.png][/url]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike



    Post Edited (SN96) : 12/28/2005 7:05:27 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2005-12-28 15:40
    I would "lower" R6 and R7 to increase the drive current of your voltage reference.
    Two 100K's allow for 25uA while two 1K's provide 2.5mA to the Vref of the Op-Amp.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • SN96SN96 Posts: 318
    edited 2005-12-28 17:10
    Thanks Beau,

    I appreciate all the help you have provided as well as evryone else who has help me with this project. When my part comes in, I will test this circuit out and report my findings.

    Thanks again.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike

    ·
  • pjvpjv Posts: 1,903
    edited 2005-12-28 18:38
    Mike;

    What happened to the 100K resistors on each of the op-amp negative input lines ?

    Cheers,

    Peter (pjv)
  • SN96SN96 Posts: 318
    edited 2005-12-28 18:49
    Poof... there gone!

    JK, thanks Peter for pointing that out! I have looked at this schematic dozens of times and still failed to see that. I'm going to make that change right now...

    <<EDIT>> I updated the schematic image and made some fine tweeks to it. Thanks Pete.

    Thanks!


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike



    Post Edited (SN96) : 12/28/2005 7:07:06 PM GMT
  • SN96SN96 Posts: 318
    edited 2005-12-30 14:22
    attachment.php?attachmentid=39948

    I tested the basic design of my project and it worked. I am still waiting on my ADC0832 part before I begin to write code for it. I know this is a simple circuit and it has been done before, but I am proud of my self because I·have such little knowledge of circuit design and having my design come to life from idea, to paper, to reality is a very rewarding experience for me personally.

    Below·is a short video of my design. For some reason, when I attach the ground to the Electret mic, the LED goes HIGH for just over a second and then goes·LOW and reacts to sound. Any ideas why?

    http://www.youtube.com/?v=AcivtKS9Cy8


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike



    Post Edited (SN96) : 12/30/2005 2:31:29 PM GMT
    470 x 285 - 8K
  • pjvpjv Posts: 1,903
    edited 2005-12-30 19:17
    Mike;

    What happened to the 2.2K mirophone powerline resistors?

    I believe your mic. is a simple FET with its gate connected to the capacitive microphone disk, and it should have a load resistor for optimal performance. You are being rather hard on it by omitting that 2.2K; the FET operates kind of as a current sink to ground, and you ought not rely on its internal resistance to limit the current. It's just not "good" design.

    The positive input DOES need to be connected to a reference point such as the 2.5V orgiginally planned. The circuit as you now have it should NOT work, or at best, if the leakages are just right, operate in a rather unstable manner. Hook it up; it's "proper".

    When first you connect the ground to the microphone, when all else is already powered, the 10 uF input capacitor gets a discharge kick, and that reflects through to its output, pinning the output to the rail and charging the C1 "integrating hold" capacitor and lighting the LED. Also, with the positive op amp input floating, it is difficult to analyze how the circuit will react to such large input disturbances.

    Connect the positive input to the 2.5 V reference, and then see how it reacts.

    Also, I would put some limiting resistor in the LED circuit; again it's just "proper".

    If I were to build what you are attempting, and based on my assumption of a relatively low sensistivity requirement, I would simplify the approach considerably; I just hate putting in more circuitry than the absolute minimum......I'm kinda freaky that way.

    I would simply use the 2 electret microphones and connect them to an SX input (I don't think you can do this on a Stamp input) which I would configure with a couple of resistors and a small capacitor as an A/D input. The software for such a configuration is very simple, and beside linear, you can also get logarithmic output from the algorithm; probably exactly what you want.

    No external A/D needed; 2 channels all done with 2 mics, 4 resistors, and 2 small caps.

    Man how I like that SX chip!

    Cheers,

    Peter (pjv)
  • SN96SN96 Posts: 318
    edited 2005-12-30 20:30
    The circuit I did a few post up was just to reflect exactly how I had it assembled on the Breadboard. I purposely omitted the resistor for the mic because my last un successful attempt, that had the resistor, did not work. I figured since the supply voltage is only 5 volts, the mic is safe to operate at that voltage. Originally I found mic circuits on a web site that was using 10v as the supply and had a resistor to drop it down in the 5v range.

    The breadboard circuit·does not represent its final design. I just threw it all together last night after work just to see if I could get something to work, and to play with values to update my latest schematic. Many of the values on the latest full design were mainly guessed values as a starting references. My goal is to fine tune the circuit and then "plug-in" the actual values that work best in the schematic. It's a W.I.P. project, and I am changing things around to learn what happens along the way·with many mistakes that make me lean what I am doing.

    I have not spent hardly any time experimenting with this circuit, but I plan to try several things after work today. I will try using different resistors for the mic to see what happens and also play around with the voltage reference values as well.

    There are several ways to do this design I admit, but I like this design even though it might use more parts than needed because I am learning so much more going this rout.

    Thanks for your input, I plan to do the things you suggested.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike



    Post Edited (SN96) : 12/30/2005 8:41:05 PM GMT
  • SN96SN96 Posts: 318
    edited 2005-12-30 23:03
    I tried hooking up pin 3 (+input) of the 741 and it caused the circuit not to work. This part does not have a Vreg pin, only -input, +input, 2 offset nulls, +V, -V and output. I made it inverting so I used the - input. Do I need to have the + input connected to voltage? I only seems to work with it not connected.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike

    ·
  • pjvpjv Posts: 1,903
    edited 2005-12-31 00:51
    Hi Mike;

    The +input of the op-amp should be connected to a voltage half way between the plus and minus supply rails.

    Cheers,

    Peter (pjv)
  • SN96SN96 Posts: 318
    edited 2005-12-31 01:22
    What is it suposed to do? I don't understand what it's purpose is.

    >>EDIT<< I found this PDF document and on page 9 it shows a almost exact setup that I am using which is why it probably works with no problems not using a Vref circuit. I'm not certain, which is why I need some help in this area.

    http://www.stanford.edu/class/ee122/Handouts/Lab2.pdf#search='op%20amp%20circuit%20explained'


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike



    Post Edited (SN96) : 12/31/2005 2:10:59 AM GMT
  • pjvpjv Posts: 1,903
    edited 2005-12-31 06:52
    Hi Mike;

    Well, actually the schematic is NOT like your circuit when you leave the +input floating. But it IS the same if you terminate your +input at the 2.5 volt level.

    The purpose of doing that is to give the op-amp's input a reference point, or a "virtual ground" for the junction of the input and feedback resistor at the -input.

    In the document, all their examples assume a dual power supply; a positive and a (usual) equal negative one, both with respect to ground. This way the input signal can swing positive as well as negative with respect to ground. That ground is half way between the power rails, just like the 2.5 V reference is in your circuit.

    Its just the way op-amps work.

    Cheers,

    Peter (pjv)
  • mediaprefectmediaprefect Posts: 31
    edited 2006-01-02 02:28
    Just curious. In your original post, you are going to drive a servo with the stamp. Is this for a robot to head towards a sound or is it to control a stereo balance control? If it is to control an audio level, perhaps you might consider having the cpu control a pair of digital potentiomeners to serve as a balance control. They won't get noisy with use like a mechanical pot will.

    Also, depending on how quickly you want the circuit to respond to changes in audio level, you should experiment with the size of the caps which average the opamp outputs going to the ADC inputs. You can also put a resistor (or trimpot) in parallel with each of the caps to tune the hold time to keep the output stable and also giving the Stamp time to do other tasks. Too short of a time constant could keep a servo jittering back and forth constantly.

    Rick
  • SN96SN96 Posts: 318
    edited 2006-01-02 19:10
    This circuit is for an aluminum humanoid bot head that will house PING sensors for navigation, two microphones for interaction with the sounds in it's environment, and it will also house a 26mm mylar speaker for speech. The circuit's main purpose it to monitor the left mic from the right mic, and then execute code routines based on the audio levels as well as the side the audio source came from.

    One example: If the left side of the head receives the strongest audio signal, I could have the code move the bot head to the left and then have the robot walk in that direction.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike

    ·
  • SN96SN96 Posts: 318
    edited 2006-01-06 01:45
    Hello guys, I was able to make my audio circuit to work and respond to sounds via the electret microphone, but I have a new challenge. I am horrible with math and it is my least favorite subject. I am also weak in programming with Pbasic. Bellow is the code I used to try out my audio circuit to see if the microphone would respond to sound, and it did.
    There are two new problems:
    1.) I need to have a wider range of values, perhaps a scale of 1 to 9 with 9 being the loudest. I need·one of you math gurus out there to figure out a way to make the output values to reflect only a 1 decimal value. I have tried to capture the output value of adc and put it in a variable so I can code an if-then-else based on a threshold of 0-9.
    2.) Also, I noticed that the values begin to slow way down when there is no sound. As the values begin to lower, the rate at which the value updates in the debug window begins to slow. This is not a real problem but I would like to have consistent speed at which it reads values. If a sudden loud sound takes place, the debug window does respond with out delay, however, it takes a while for the numbers to settle back down again. I only have one mic input to channel 0 and 2.5 volts feeding into channel 1.
    The two pics attached at the bottom are screenshots of actual output results. One is with sound and one is without sound.
    any help is greatly appreciated!
    ' =========================================================================
    '
    '   File...... ADC08x32.BS2
    '   Purpose... Experiments with the ADC08x32 ADC
    '   Author.... Jon Williams
    '   E-mail.... [url=mailto:jwilliams@parallax.com]jwilliams@parallax.com[/url]
    '   Started...
    '   Updated... 06 DEC 2004
    '
    '   {$STAMP BS2}
    '   {$PBASIC 2.5}
    '
    ' =========================================================================
    
    ' -----[noparse][[/noparse] Program Description ]---------------------------------------------
    '
    ' This program demostates the various modes of the ADC08x82 ADC.
    
    ' -----[noparse][[/noparse] Revision History ]------------------------------------------------
    
    ' -----[noparse][[/noparse] I/O Definitions ]-------------------------------------------------
    CS              PIN     15                      ' ADC0832.1
    Clk             PIN     14                      ' ADC0832.7
    Dio             PIN     13                      ' ADC0832.5 / ADC0832.6
     
    ' -----[noparse][[/noparse] Constants ]-------------------------------------------------------
    Sgl             CON     %1                      ' single ended
    Dif             CON     %0                      ' differential
    Raw2mV          CON     $139B                   ' 19.6 mV per count
    
    ' -----[noparse][[/noparse] Variables ]-------------------------------------------------------
    sglDif          VAR     Bit                     ' adc mode (1 = SE)
    oddSign         VAR     Bit                     ' chan (Sgl), sign (Dif)
    adc             VAR     Byte(2)                 ' channel values
    mVolts          VAR     Word(2)                 ' millivolts
    
    ' -----[noparse][[/noparse] EEPROM Data ]-----------------------------------------------------
    
    ' -----[noparse][[/noparse] Initialization ]--------------------------------------------------
    Reset:
      HIGH CS                                       ' deselect ADC
      DEBUG CLS,
            "ADC08x32",
            CRSRXY, 0, 2, "Single-Ended", CR, CR,
            "  Ch0:", CR,
            "  Ch1:", CR,
            CRSRXY, 0, 7, "Differential", CR, CR,
            "  Ch0:", CR,
            "  Ch1:"
    
    ' -----[noparse][[/noparse] Program Code ]----------------------------------------------------
    Main:
      DO
        sglDif = Sgl
        FOR oddSign = 0 TO 1
          GOSUB Read_0832
          mVolts(oddSign) = adc(oddSign) */ Raw2mV
          DEBUG CRSRXY, 7, (4 + oddSign),
                DEC3 adc(oddSign), TAB,
                DEC mVolts(oddSign) DIG 3, ".", DEC3 mVolts(oddSign)
        NEXT
        sglDif = Dif
        FOR oddSign = 0 TO 1
          GOSUB Read_0832
          mVolts(oddSign) = adc(oddSign) */ Raw2mV
          DEBUG CRSRXY, 7, (9 + oddSign),
                DEC3 adc(oddSign), TAB,
                DEC mVolts(oddSign) DIG 3, ".", DEC3 mVolts(oddSign)
        NEXT
      LOOP
      END
    
    ' -----[noparse][[/noparse] Subroutines ]-----------------------------------------------------
    ' Reads ADC08x32
    Read_0832:
      LOW CS
      ' send start, mode, channel
      SHIFTOUT Dio, Clk, MSBFIRST, [noparse][[/noparse]%1\1, sglDif\1, oddSign\1]
      ' read raw counts from ADC
      SHIFTIN  Dio, Clk, MSBPOST, [noparse][[/noparse]adc(oddSign)\8]
      HIGH CS
      RETURN
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike



    Post Edited (SN96) : 1/6/2006 1:59:38 AM GMT
    661 x 406 - 31K
    661 x 406 - 31K
    431 x 376 - 149K
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-01-06 03:14
    What happens when you increase the gain on the OpAmps?

    Also, try smaller capacitors on the output of the OpAmps. This should help with "...it takes a while for the numbers to settle back down again".

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • pjvpjv Posts: 1,903
    edited 2006-01-06 05:55
    Hi Mike;

    On Dec 30 I posted a reply to you with some recommendations as to how I would go about this project, as I could see your current situation coming from a mile away.

    With the circuit you proposed, you are going to produce SOME results, but FAR from the best results.

    Dumping an op-amp into a capacitor and using a LED as a bleed-off path is just not kosher. Too many things are uncontrolled and up to chance.....hence SOME results. I expect that the second channel will behave rather differently as you can't readily control the actual values of components such as the capacitors, current curves of the LEDs. And that is even without taking temperature variations into account.

    As Beau suggests, you need to get rid of those large charge holding capacitors behind the op-amp rectifier diodes. In fact, figure out a way (there are many ways) to get rid of the diodes. You need a logarithmic sensing algorithm here.

    Let me repost the salient line from my earlier post:

    "I would simply use the 2 electret microphones and connect them to an SX input (I don't think you can do this on a Stamp input) which I would configure with a couple of resistors and a small capacitor as an A/D input. The software for such a configuration is very simple, and beside linear, you can also get logarithmic output from the algorithm; probably exactly what you want."

    That again is my recommendation; hopefully this time you might follow it. There are lots of examples in the Ubicom/Parallax/SXList sites to show you how to make that A/D and its software.

    I don't mean to be pounding on you like this, but it pains me to see someone on a path that does not have an optimum result when the other path is so obvious. Of course, you don't have to listen to my or anyone else's advice, but I think that IS why you are asking questions on this forum.

    I do commend you for at least getting somewhere and learning in the process; many are not even venturing down ANY path.

    Cheers,

    Peter (pjv)
  • SN96SN96 Posts: 318
    edited 2006-01-06 13:50

    Thanks Beau,

    ·

    Peter,

    I sense your frustration with me, and I know you think you are giving me recommendations and I am ignoring them and going down my own path. The truth is, I have been pulled in several directions because no matter who I talk to, each recommendation is very different, probably because there are so many ways to approach a·task. I listen to every person's recommendations and then make a decision as to what to do. Sure your idea is the simplest and perhaps the best approach, however, you your self had to start somewhere to get to that level where you know how to approach a idea you have in your mind.

    I am not looking for the simplest circuit, I choose to stay this path as I have mentioned in my previous post, to learn as much as I can from this current design.

    At times I feel as though I am in the middle of a tug-of-war. Person "A" saying to do ABC, and person "B" saying to do xyz. I fully respect all your advice and pounding, but the bright side is: I do listen, I do benefit, and I do learn. I went from an idea in my head to a working circuit all with only buying the "What's a microcontroller" book, and a heck of a lot of reading and research and question asking.

    I'm happy with how things are turning out and I am very grateful with all the help I have received.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike

    ·
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-01-06 16:44
    SN96,

    Based on what Peter mentioned "You need a logarithmic sensing algorithm here" ... I seem to remember, for an ultrasonic distance measuring application
    I did several years ago, that I used an Op-Amp with an inverse log gain (<-originally designed/used for RF applications). The benefit of this would be to
    "linearize" the output. Simply put, the inverse log component combined with the natural log component cancels each other out leaving you with a linear
    relationship. As Peter pointed out there are better ways of doing things, and a "logarithmic sensing algorithm here" might produce better results. Although
    I believe Peter was talking about creating a logarithmic algorithm in software, however it can be done in hardware as well if you don't have the processing
    overhead ( thus the mention of the SX processor ). I will try to find the part number for the Op-Amp that I mentioned, just in case you might be interested.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
Sign In or Register to comment.