Difference between revisions of "Sound Sensor/Microphone Brick"
(→Electrical Characteristics) |
(→Demo) |
||
Line 46: | Line 46: | ||
==Demo== | ==Demo== | ||
+ | Connect S port of electronic brick of microphone to A0 port of Arduino, and we will use the following program to read the analog value. When the value exceeds the threshold, the LED indicator will flash. | ||
+ | |||
+ | const int ledPin = 13; // the number of the LED pin | ||
+ | const int thresholdvalue=400; //The threshold to turn the led on | ||
+ | void setup() { | ||
+ | pinMode(ledPin, OUTPUT); | ||
+ | } | ||
+ | void loop() { | ||
+ | int sensorValue = analogRead(A0); //use A0 to read the electrical signal | ||
+ | if(sensorValue>thresholdvalue) | ||
+ | digitalWrite(ledPin,HIGH); //if the value read from A0 is larger than 400,then light the LED | ||
+ | delay(200); | ||
+ | digitalWrite(ledPin,LOW); | ||
+ | } | ||
==Download== | ==Download== | ||
==Useful Links== | ==Useful Links== |
Revision as of 02:41, 27 May 2014
Contents
Overview
Electronic brick of microphone can be connected to the analog I / O port, when speaking to the microphone, the analog value will be changed. A recorder can be made by reading and saving the analog value.
Features
1. Plug and Play, easy to use.Compatible with the mainstream 2.54 interfaces and 4-Pin Grove interfaces in the market.
2. With use of M4 standard fixed holes, compatible with M4-standard kits such as Lego and Makeblock
Specifications
PCB Size | 33.0mm X 14.0mm X 1.6mm |
Working voltage | 5V DC |
Operating voltage | 5V DC |
Compatible interfaces | 2.54 3-pin interface and 4-pin Grove interface(1) |
Note 1: S for digital output port , V and G for voltage at the common collector and ground respectively.
Electrical Characteristics
Parameter | Min. | Typical | Max. | Unit |
Working voltage | 4.5 | 5 | 5.5 | VDC |
Digital output voltage(VCC=5V) | 0 | - | 5 | V |
Working current(5V) | - | 260 | - | uA |
Frequency range | 100 | - | 10000 | Hz |
Sensitivity | - | -50 | - | dB |
Demo
Connect S port of electronic brick of microphone to A0 port of Arduino, and we will use the following program to read the analog value. When the value exceeds the threshold, the LED indicator will flash.
const int ledPin = 13; // the number of the LED pin const int thresholdvalue=400; //The threshold to turn the led on void setup() { pinMode(ledPin, OUTPUT); } void loop() { int sensorValue = analogRead(A0); //use A0 to read the electrical signal if(sensorValue>thresholdvalue) digitalWrite(ledPin,HIGH); //if the value read from A0 is larger than 400,then light the LED delay(200); digitalWrite(ledPin,LOW); }