In the lesson, we’ll show how to use sound Sensor detect the sound intensity of the environment through Cayenne IOT Platform. This sound sensor is used to detect whether there’s sound surround or not, please don’t use the module to collect sound signal. The sound sensor module has a built-in capacitive electric microphone which is highly sensitive to sound. Sound waves cause the thin film of the electric to vibrate and then the capacitance changes, thus producing the corresponding changed voltage., so it can detect the sound intensity in ambient environment. You can adjust the sensitivity with by adjusting the Potentiometer.
2 Hareware preparation
|UNO R3 board||1|
|Ethernet Shield W5100||1|
|Sound detector sensor module||1|
3 Hardware connection
Connect sound sensor with UNO as followed diagram:
|UNO Board||Sound sensor|
Log in Cayenne IOT platform, add new…->Device/Widget
Click Digital Input，setting the datasheet as followed:
Please Note: If V1 pin was used by other widgets, you can select other pins. and change the VIRTUAL PIN in
sketch to the pin number you have selected.
In your dashboard click”Step 1:Sketch File”, the sample sketch will be displayed, in this example,we created a new sketch, please download from http://osoyoo.com/driver/sound.txt
Copy and paste the sketch into Arduino IDE ,please remember to use your own authentication token. Upload to your Uno board, then click “Step 2 :Add Sensor”, Once the Arduino connects to the Dashboard it should automatically update the Digital Sound Sensor widget with data.
When you speak or make noise intermittently near the sound sensor, in your dashboard, you can see the data will change between 0 and 1.
when the volume is higher, the value on the dashboard turn to 0, when the volume is lower, the value on dashboard turn to 1