How to Use Sound Sensor With Arduino
by STEAM-DIY in Circuits > Arduino
84 Views, 1 Favorites, 0 Comments
How to Use Sound Sensor With Arduino
Welcome back to my blog. We discussed servo motors in a previous post. Do you remember it? We presented 11 articles on Arduino basics. If you have not read those articles yet, please read them. I will hope to present Nodemcu lessons in the next articles.OK let’s go to today’s post. Today we are going to talk about the sound sensor.
What is the Sound sensitive sensor?
It is a sound recognition sensor. The sound sensor includes a condenser microphone. It is used to recognize sounds. If you want to change the sound recognition range, you can use the sensor’s preset controller. This sensor cannot detect sounds separately. There are other sensors on the market that are suitable for that. This sensor has three pins. It is VCC, GND, and OUT pins. VCC and GND pins are used to power up the sensor and the OUT pin is used to get output. Using this sensor we can get the digital value. We can get 0 when this sensor detects noise and 1 when it is not. We can connect this sensor to any digital pins on your Arduino board. Using this sensor we can create amazing projects. We will discuss those projects in the following articles. Today we are doing a project to blink an LED bulb using this sound sensor. The required components are given below.
Supplies
- Arduino Nano board —
- Sound sensitive sensor —
- LED bulb —
- 220-ohm Resistor —
- Breadboard —
- Jumper wire
components
Please attach the components to your breadboard.
Ok, Let’s look at the code.
- The complete program of this project –
Let’s identify this code one by one. This code sets the second pin as the input pin and the third pin as the output pin.
This code reads the sensor value and puts it in the Boolean variable. The variable name is ‘pulse’.
The digital value is checked using the IF condition. The LED bulb turns on when the digital value is 0. The LED bulb turns off when the digital value is 1.
Now, select the board and port. After, click the upload button.
Now you can test this project.
Please subscribe my channel . thanks