Shop OBEX P1 Docs P2 Docs Learn Events
sound detection — Parallax Forums

sound detection

ArchiverArchiver Posts: 46,084
edited 2001-08-02 19:50 in General Discussion
hello stampers!

I want that my robot reacts at sound, when i clap my hands my robot should
start moving. What kind of hardware do i need, and how to connect it to a
bs2? a simple microfoon gives very few power to trigger a input pin on the
bs2....

many thanks

pieter-jan

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-12-20 10:30
    hello stampers!

    I want that my robot reacts at sound, when i clap my hands/ or make a
    loud sound my robot should start moving. What kind of hardware do i
    need, and how to connect it to a
    bs2? a simple microfoon gives very few power to trigger a input pin
    on the
    bs2....

    many thanks

    pieter-jan
  • ArchiverArchiver Posts: 46,084
    edited 2000-12-20 11:59
    At 10:30 AM Wednesday 12/20/2000 +0000, you wrote:
    >hello stampers!
    >
    >I want that my robot reacts at sound, when i clap my hands/ or make a
    >loud sound my robot should start moving. What kind of hardware do i
    >need, and how to connect it to a
    >bs2? a simple microfoon gives very few power to trigger a input pin
    >on the
    >bs2....
    >
    >many thanks
    >
    >pieter-jan

    Hi pieter-jan

    The following was offered by S. Premna earlier this month (12-10-2000):

    QUOTE

    Subject: [noparse][[/noparse]basicstamps] Re: help in design for sound

    Whereas this problem is not trivial you could give it
    a good start by taking two identical mics and housing
    [noparse][[/noparse]as close as possible!] and put the outputs to a
    differential amplifier [noparse][[/noparse]op amp connected differentially
    with same input impedance per side - or 3 amplifier
    instrumentation amp configuration].

    You need a preamplifier for each microphone before you
    go to the differential amplifier...

    Now the diff amp output will be large when the two mics
    are not the same input sound... gives you "off center"
    signal.

    Which side is less? Feed the outputs of the two microphone
    preamplifiers also to two rectifiers and look for
    which signal is larger [noparse][[/noparse]another diff amp, or comparator]

    The audio differential amplifier could also give this
    information on it's output but my intuition is that it
    would be harder to discern...

    Considering the large likely dynamic range of audio input
    you may need automatic gain controls etc.... but I'd
    give it a try with the preamps, rectifiers, comparator
    and differential amp.

    Why not just the preamps and rectifiers? Well, the diff
    amp could give you a degree of off center reading harder
    to extract with a comparator. Remember the two channels
    must be as identical as possible and then put in a balance
    pot somewhere to trim things out... [noparse][[/noparse]change one preamp
    gain should work...]

    Hope this is a thought provoking start for you - I apologise
    it isn't a simple complete solution.

    Good luck - let us know how it works out... premena [noparse][[/noparse]ARS AJ0J]

    PS Don't forget to isolate robot motor sounds from your
    microphones or locate the microphones symmetrically
    with the mics ... :-) You may need to restrict the mic
    bandwidth of frequencies you listen for with some bandpass
    filtering [noparse][[/noparse]identical per channel].

    End QUOTE

    Hope that gets you started
  • ArchiverArchiver Posts: 46,084
    edited 2000-12-21 00:57
    Pieter-Jan,

    This topic was discussed here in the recent past.

    I think we ended up saying that a mic preamp would be necessary, followed
    by a dual comparator circuit to convert the audio waveform to a logic
    signal. The comparator could be an LM393 type, and the hookup is pretty
    well documented in National's data sheet. You would operate the comparator
    on 5V power, with the first stage allowing a capacitor to charge when sound
    is present, and the second stage performing the conversion to a logic
    signal. The capacitor insures that your logic signal lasts long enough for
    the Stamp to detect it.

    It's possible that the mic preamp could be eliminated by biasing the first
    comparator very carefully, if your mic has a lot of output voltage when the
    clap hits it. Old-fashioned ceramic mics often work best for this job...

    >I want that my robot reacts at sound, when i clap my hands my robot should
    >start moving. What kind of hardware do i need, and how to connect it to a
    >bs2? a simple microfoon gives very few power to trigger a input pin on the
    >bs2....

    Mike Hardwick, for Decade Engineering -- <http://www.decadenet.com>
    Manufacturer of the famous BOB-II Serial Video Text Display Module!
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-02 13:08
    Hi Stampers,

    does anyone know an easy way to detect sound using the BasicStamp? I would
    need a rather sensitive device that is able to detect a mumbling person in a
    distance of about 30 cm...

    I am building a pseudo-brainwave-measuring-helmet and therefore I want to
    detect sound, to see if the person is quiet, and movement.
    That leads to my second question:

    Is there a way to detect motion of a head under a spherical 'hood' without
    engaging complicated stuff like ultrasonics or similar? Can I build a huge
    capacitor (two plates of metal on either side opf the head) and detect the
    capacitive difference when the head moves?

    What am I doing here in this job? How crazy is someone who builds a
    pseudo-brainwave-measureing-device ?

    Have a nice day you all,

    uli


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-02 13:34
    Hi Uli,

    There was a thread about sound detection a while back. I'd just get a good
    mic, amplify it, and then use a comparator to detect the level going above a
    pot reference (so I could adjust the sensitivity).

    Have you considered mercury switches in the helmet? That would seem to be
    the simple solution. Pin ball machines and similar devices have (used to
    have?) tilt sensors. These were large ball bearings held captive on a track
    with microswitches at either end. When the ball hit the microswitch you
    tilted the machine.

    Another idea would be to use a cheap PIR motion detector behind the person?

    Regards,

    Al Williams
    AWC
    * Connect RS232 devices quick and easy:
    http://www.al-williams.com/awce/rs1.htm


    >
    Original Message
    > From: ulibasic [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=lKpkfJocaYGpLxN1xsCpNuAM9qMetT6p5YfJFc4Rq-pFrIp9G-aSVYmMO_rIBgMtqcRCEhZv4K0_rW2jLtKxDq200tU3n_mY48yQ0zA]ulibasic@r...[/url
    > Sent: Thursday, August 02, 2001 7:08 AM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] sound detection
    >
    >
    > Hi Stampers,
    >
    > does anyone know an easy way to detect sound using the BasicStamp? I would
    > need a rather sensitive device that is able to detect a mumbling
    > person in a
    > distance of about 30 cm...
    >
    > I am building a pseudo-brainwave-measuring-helmet and therefore I want to
    > detect sound, to see if the person is quiet, and movement.
    > That leads to my second question:
    >
    > Is there a way to detect motion of a head under a spherical 'hood' without
    > engaging complicated stuff like ultrasonics or similar? Can I build a huge
    > capacitor (two plates of metal on either side opf the head) and detect the
    > capacitive difference when the head moves?
    >
    > What am I doing here in this job? How crazy is someone who builds a
    > pseudo-brainwave-measureing-device ?
    >
    > Have a nice day you all,
    >
    > uli
    >
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-02 14:09
    I wouldn't be too happy sticking my head into a huge capacitor !!
    Sorry I can't offer anything constructive - other than how about using a
    gyro ?

    Good Luck !

    Justin.
    :-)

    Original Message
    From: ulibasic [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=qyNjZf_HmKEXpneS3mkmcoGwRsdvcai_I7oX3ax87BKAfghi9KSot9AYUp09rqrA5GZOKkaeH4eH2gsaZNS8D_vBgtBYd0XL3Q]ulibasic@r...[/url
    Sent: 02 August 2001 13:08
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] sound detection


    Hi Stampers,

    [noparse][[/noparse]SNIP]

    That leads to my second question:

    Is there a way to detect motion of a head under a spherical 'hood' without
    engaging complicated stuff like ultrasonics or similar? Can I build a huge
    capacitor (two plates of metal on either side opf the head) and detect the
    capacitive difference when the head moves?

    [noparse][[/noparse]/SNIP]
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-02 16:16
    While you're waiting for Al to reply I felt compelled to throw in my
    2 cents.

    Probably the easiest way to do what Al suggests is to connect a
    inexpensive dynamic microphone into a LM386. The '386 is intended to
    be a power amplifier, to drive a loudspeaker with a line level input.

    The LM386 will also function as a preamp. It will be a bit noisy, but
    you dont care about this. Connect the microphone to the '386 input.
    (if I recall correctly no cap is required at the input) I believe to
    increase the gain of the 386 a cap goes between 2 pins. Again, go to
    Yahoo and search on LM386, you'll have all the info you'll need.

    Anyway, the LM386, with the cap for max gain, will work just fine as
    your mic preamp. Very few parts required so far, the mic, the 386, an
    output cap, and one other small cap. The data sheet will probably
    suggest a snubber on the output, a good idea.

    The output of the 386 goes through a diode, from there it goes to a
    comparator input, just as Al suggested. A small cap to ground at this
    point will add a bit of delay, (prevent false trigger) and will
    stretch the comparators output pulse just a bit.

    I have used the LM339 comparator in similar applications. Works well,
    and is dirt cheap, as is the LM386.

    Can't help you with the helmet thingy, I would be curious to know
    what you come up with. Al suggested a tilt switch, good idea...

    Regards

    Rich

    --- In basicstamps@y..., "ulibasic" <ulibasic@r...> wrote:
    > Hi Al,
    >
    > thanks for reply, I didn't explain good enough what this is all
    about, sorry
    > for my poor language...
    >
    > It is not really a helmet, it is more like a hood that will be
    fixed and the
    > person just put his /her head under the hood, without contact.
    (Like the
    > strange thjings old ladies use to dry their hair...).
    >
    > The problem with pid-devices is that they can only say yes, it
    moves or no,
    > it doesnot. I would prefer a device that can tell me how quick or
    how much
    > or how far the head moves.
    >
    > Could you go a lil more into detail about the microphone thing?
    What kind of
    > mic can I use, how do I amplify it and what would this comparator
    look like,
    > just an op-amp?
    >
    > You see, I am not very cool in electronix though I fumble my way
    along this
    > world for ten years now...;-)
    >
    > Thanx again, Al,
    >
    > Greetings, Uli
    >
    >
    >
    >
    >
    >
    Urspr
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-02 16:36
    Hi Uli,

    Just what Rich said. The LM386 is a staple -- very nice AF amp with
    practically no way to mess it up. Then you have a voltage at the output. You
    might want to "filter" it with an RC so you'd need some sustained level, but
    that will depend on exactly what you want to do.

    As Rich points out, you'll probably want to rectify the output with a common
    diode so you only get the positive excursions. A 339 comparator is so
    versitile that we include one with our lab kit -- would you belive a 339, a
    resistor, and a capacitor can make a 4 channel A/D converter for the Stamp?
    Yep.

    One trick to using the 339 that many people overlook. The output is open
    collector. That is to say it goes to ground in one state and floats in the
    other. A pull up resistor will take care of that.

    As for the "hood" thing, I don't know. I'd be wary of making people's heads
    into a dielectric. Beau can shed some light, but I know that electricity and
    people take special care. How about a ring of IR LEDs and sensors. You turn
    on an LED and "see" which sensors can see it. Then turn it off and turn on
    another one. You could triangulate the position of the head pretty well that
    way I'd think.

    Regards,

    Al Williams
    AWC
    * Connect your Stamp to the Internet!
    http://www.al-williams.com/awce/netporter.htm

    >
    Original Message
    > From: ulibasic [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=zAFT8_PYnHU54WLZtuim5xh2MXYI7La8XMGCKRUbgDMis3i_GiLnx29b8dMa4pnHe2-NLzQnARVoIHLPjsZXTRhj_Tol778D3A]ulibasic@r...[/url
    > Sent: Thursday, August 02, 2001 7:38 AM
    > To: basicstamps@yahoogroups.com
    > Subject: AW: [noparse][[/noparse]basicstamps] sound detection
    >
    >
    > Hi Al,
    >
    > thanks for reply, I didn't explain good enough what this is all
    > about, sorry
    > for my poor language...
    >
    > It is not really a helmet, it is more like a hood that will be
    > fixed and the
    > person just put his /her head under the hood, without contact. (Like the
    > strange thjings old ladies use to dry their hair...).
    >
    > The problem with pid-devices is that they can only say yes, it
    > moves or no,
    > it doesnot. I would prefer a device that can tell me how quick or how much
    > or how far the head moves.
    >
    > Could you go a lil more into detail about the microphone thing?
    > What kind of
    > mic can I use, how do I amplify it and what would this comparator
    > look like,
    > just an op-amp?
    >
    > You see, I am not very cool in electronix though I fumble my way
    > along this
    > world for ten years now...;-)
    >
    > Thanx again, Al,
    >
    > Greetings, Uli
    >
    >
    >
    >
    >
    >
    Urspr
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-02 17:23
    >Is there a way to detect motion of a head under a spherical 'hood' without
    >engaging complicated stuff like ultrasonics or similar? Can I build a huge
    >capacitor (two plates of metal on either side opf the head) and detect the
    >capacitive difference when the head moves?

    Uli,

    This ought to do it. It's a Design Idea from EDN Magazine, November 6, 1997:


    http://archives.e-insite.net/archives/ednmag/reg/1997/110697/23di_04.htm

    Mike Hardwick, for Decade Engineering -- <http://www.decadenet.com>
    Manufacturer of the famous BOB-II Serial Video Text Display Module!
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-02 17:35
    >does anyone know an easy way to detect sound using the BasicStamp? I would
    >need a rather sensitive device that is able to detect a mumbling person in a
    >distance of about 30 cm...

    Hi Uli,

    I have experimented with simple op-amp circuits to integrate small
    voltages so that they can be sensed for magnitude using the RCtime
    command. A couple of these circuits both integrate and rectify in
    one step, so they are useful for sensing analog sound level. Here is
    the URL:

    http://www.emesystems.com/BS2rct.htm#SmallV

    The ones that rectify and integrate are toward the bottom of the article.

    >It is not really a helmet, it is more like a hood that will be fixed and the
    >person just put his /her head under the hood, without contact. (Like the
    >strange thjings old ladies use to dry their hair...).
    >
    >The problem with pid-devices is that they can only say yes, it moves or no,
    >it doesnot. I would prefer a device that can tell me how quick or how much
    >or how far the head moves.

    Maybe the Analog Infra-Red Range-finding System (AIRRS) would help?
    http://www.hvwtech.com/sensors.htm

    -- regards,
    Tracy Allen
    electronically monitored ecosystems
    mailto:tracy@e...
    http://www.emesystems.com
  • ArchiverArchiver Posts: 46,084
    edited 2001-08-02 19:50
    I think you could do it without the IR LEDs, just the sensors. The
    head is a pretty good IR source after all. I'm thinking like a motion
    detector where a single IR detector detects variation in IR level,
    except in this case you might want several. You could use lenses or
    some other method to narrow their field of view if desired. You could
    use horizontal and vertical slits in front of the detectors to
    separate horizontal from vertical motion. Feed the output of each
    detector into a circuit like the soud detector and then use the Stamp
    to sample the activity level of each one.

    --- In basicstamps@y..., "ulibasic" <ulibasic@r...> wrote:
    > Hi Al,
    >
    > thanx again for your detailed explanation. I like the IR-idea for
    the hood.
    > But there is one thing missing: the explanations by "Rich" that you
    refer to
    > never reached me... Did he post it in the group? I cannot find it...
    >
    > Could you forward it?
    >
    > Thanx and Hi Ho,
    >
    > Uli
    >
    >
    >
    >
    Urspr
Sign In or Register to comment.