Buy from US | Buy from UK | Buy from DE | Buy from IT | Buy from FR | Buy from ES | ここでご購入を! |
In this lesson, we will show you how to use a sound sensor to detect the sound intensity of the environment and monitor the data using an app. The sound sensor is designed to detect whether there is any sound surrounding it. Please note that it should not be used to collect sound signals. The sound sensor module has a built-in capacitive electric microphone that is highly sensitive to sound. When sound waves cause the thin film of the electric to vibrate, the capacitance changes, producing the corresponding voltage change. Therefore, it can detect the sound intensity in the ambient environment. You can adjust the sensitivity by adjusting the potentiometer.
First, please insert the ESP8266 Wi-Fi Shield into your motherboard.
OSOYOO Basic Board | Sound sensor |
D9 | OUT |
GND | GND |
5V | VCC |
Step A) Install the latest IDE from https://www.arduino.cc/en/Main/Software?setlang=en. (If you have IDE version 1.1.16 or later, please skip this step).
Step B) Connect the motherboard to the computer via USB cable.
Step C) Open the IDE and choose the corresponding board type and port type for your project:
Step D) Download the sketch file from https://osoyoo.com/driver/wifi-iot/lesson10/wifi-lesson10.zip, unzip the file and double-click on the esp8266-lesson10.ino file to load the sketch into the IDE.
char ssid[] = "******"; // your network SSID (name) char pass[] = "******"; // your network password
Please replace the ****** with your correct Wi-Fi SSID and password, otherwise, your project cannot connect to the Internet.
Step E) After changing the above lines, load the sketch into the IDE.
Step A) Open your Serial Monitor. You can see that your router will assign an IP address to your IDE, as shown in the following example:
Step B) Open your OSOYOO IOT UDP Robot app. If you haven’t installed this app, please read the APP installation section in Lesson 2.
Step C) Make sure your cell phone is on the same local network as your Arduino. Open the app, click on Settings, enter your Arduino IP address from Step F, and Port to 8888 in Settings.
Now, press any key on your app, and your Arduino will start to send sound status data to the app. When noise is detected, the app will show “Noisy!”. Otherwise, the app will show “Quiet!” as shown in the following picture.
DownLoad Url osoyoo.com