Pages: [1]   Go Down
Author Topic: best/cheapest sound amplitude sensor and/or code?  (Read 1669 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi all

whats the easiest, cheapest sound amplitude sensor out there?

i just want something that detects sound amplitude and responds accordingly.

also if anyone knows nay good sound sensor code examples (not Knock - that seems more aimed at vibration), they'd be much appreciated smiley

cheers, auto
Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 31
Posts: 2611
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Check on Sparkfun: http://www.sparkfun.com/products/9964
Or you can build one using breadboard, electret mic and OPA, and just download code from them smiley
Logged

0
Online Online
Shannon Member
****
Karma: 222
Posts: 12739
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It rather depends on what you mean by amplitude - instanteous, averaged, and what bandwidth you are talking about...  Best and cheapest are mutually exclusive I think.
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi - thanks, I might take a look at that breakout board.

Can anyone recommend code for detecting sounds exceeding certain absolute values?

Something like if sound > 100db then the LED will light up....
Logged

0
Online Online
Shannon Member
****
Karma: 222
Posts: 12739
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Decibels for the purposes of human hearing are not the same as decibels in the electronic domain - for human hearing the ear's frequency response is compensated for.   So if you want accurate measurement of sound volume from a human PoV you'll need to emulate this frequency response curve.

However if you are only interested in a rough level you only really need a peak level detector along the lines of:
Code:
 int value = analogRead (AUDIO) - zero_level ;
  if (abs(value) > threshold)
  {
    digitalWrite (LED, HIGH) ;
  }
Logged

[ I won't respond to messages, use the forum please ]

Pages: [1]   Go Up
Jump to: