Do you hate those long walks you have to take to switch off the lights at home while you go to bed? Well, you are not alone on that part. The good thing is that we are in an era whereby this tedious task is now easier via sound sensors. Now you can turn your lights on and off by just clapping your hands. You can play cool games in real life with your friends and do amazing things that did not seem possible a while ago via this technology. But how do sound sensors work? How can clapping your hands signal your lights to turn on or off? Well, in this article, we shall dive into these questions and try to answer them in the best possible way. We shall look at things such as:
- How sound sensors work
- Sound sensor Arduino
- Motion sensors that use sound
- How to make a sound sensor
- And so much more
Sound sensors are a great wonder; when well understood, you can create pretty fascinating projects. Hence without further ado, let us help you put together the sound sensor puzzle.
Sound Sensor
What is a Sound Sensor?
We define a sound sensor as a module that detects sound waves via the sound’s intensity and then converts it to electric signals.
How do Sound Sensors Work?
Sound sensors function like our ears, having a diaphragm that converts vibrations into signals. However, since the sound sensor is not human, it does not have an actual diaphragm or actual ears. A sound sensor instead consists of a peak detector, an amplifier (LM393, LM386, et cetera) that is highly sensitive to sound, and an inbuilt capacitive microphone. Sound sensors, having these components, can function correctly. They follow the following process to “hear” sound:
- Sound waves are propagated through air molecules.
- The sound waves are received by the inbuilt capacitive microphone
- The sound waves are then amplified and digitized for the processing of sound intensity
Through this process, sound sensors can detect when you clap your hands to switch on the light or when you want to switch them off. Of course, to achieve this feat, you will have to go the extra mile but worry not because we have got you on that.
Applications of a Sound Sensor
Other than being useful alongside with Arduino to build incredible projects (we shall get into this later on), sound sensors can also be essential in so many day-to-day applications which include:
- Monitoring and security systems such as door alarms, burglar alarms, et cetera.
- Consumer electronics, for example, music systems, computers, and phones
- Sound level recognition and ambient sound recognition
- Home automation, for example, lighting your house by clapping or even whistling instead of having to manually turn off the lights via a switch
These applications are pretty fascinating and aim at making our lives easier. With the great tech advances taking place, you are bound to see this list get longer and longer as sound sensor application areas grow.
To understand the concept of a sound sensor, let us look at an interface sound sensor using Arduino.
Arduino Sound Sensor
If you are looking to add the concept of sound to your next project, then this section might help you out a lot. In this section, we shall look at:
- How a sound sensor’s microphone works
- The sound sensor’s board interface
- How to merge a sound sensor onto an Arduino board
How does a Sound Sensor’s Microphone Work?
Have you ever used a microphone before? If you have, you might have been puzzled about how you speak into it using a low tone, and the sound gets amplified as it gets outputted via a speaker. To know how this works, we have to get inside of a microphone, not literally, of course! But by reviewing every part of a microphone, this is because sound sensors utilize the same features, only that the sound sensor microphone is pretty tiny.
Inside a microphone, you will find a thin diaphragm that is actually one capacitor plate. You will also find another plate known as the backplate. The backplate is parallel to and close to the diaphragm. When sound waves hit the microphone, the diaphragm vibrates. The diaphragms vibration causes a change in capacitance as the plates either get farther apart or closer together. The change in capacitance causes voltage change across the two plates, which, when measured, can be useful in determining the amplitude of the sound.
Now that that is out of the way, we can now look at the sound sensor’s board interface.
Sound Sensor Board Interface
A sound sensor is actually a tiny board that brings together a microphone (50Hz – 10KHz) and processing circuitry, which converts sound waves to electrical signals. A sound sensor board has three crucial parts, namely:
- Electret microphone
- Sensitive adjustment
- Comparator
Electric signals are fed onto the high-precision comparator found on the sound sensor’s board for digitization. The signal is then made available at the OUT pin.
To take things up a notch, you can set up a threshold using a potentiometer found on the sound sensor’s board. Using this threshold, you get to learn when the amplitude of sound is HIGH (in this case, it exceeds the threshold) or when it is LOW (lower than the set threshold). Using this setup, you can set an action to be performed once on reaching a certain threshold. For example, once you clap your hands, this sound wave can cross the set threshold, which in turn will trigger the switching on of light (the action). You can play around with this setup to generate so many cool projects.
The sound sensor interface also has two LEDs, one for power and the other for status:
- The power LED – lights up on powering up of the module
- The status LED – it lights up when the digital output goes LOW
Sound Sensor Pinout
A sounds sensor has only three pins:
VCC pin – it supplies power to the sound sensor. It’s recommended to power your sound sensor with a voltage between 3.3V and 5V.
GND – A ground connection
OUT – acts as the sounds sensor’s output. It outputs high whenever conditions are quiet and LOW whenever there is detection of sound. You can connect the OUT pin to any digital pin on an Arduino board or onto a 5V relay directly or a similar device.
Connecting a Sound Sensor onto an Arduino Board
To properly utilize the sound sensors utilities, you can hook it up to an Arduino board to develop a sound sensor Arduino; let us see how this is possible.
Connecting a sound sensor onto an Arduino board is relatively simple. It would help if you started by connecting the VCC pin on the sound sensor module to 5V on an Arduino board, then connecting the GND pin to the ground. Now plug in the OUT pin to the digital pin on your Arduino, and that’s it, you have mounted a sound sensor onto an Arduino.
Sound Sensor Calibration
To attain accurate readings from your sound sensor, you should calibrate it. Sound sensor modules come with a built-in potentiometer useful in calibrating the digital output (OUT).
To calibrate your sound sensor, all you have to do is adjust the potentiometer until you attain your desired threshold. Start clapping near the sound sensor’s microphone as you adjust the potentiometer until you see the status LED blink responding to your clap. Remember that the set threshold determines what the digital output will output. Once you exceed the threshold, it outputs LOW. Hence the wrong calibration can mess up your entire project.
Once you have calibrated your sound sensor, you can now utilize it with no accuracy worries for your project.
How to make Sound Sensor Devices
Now that you have successfully mounted a sound sensor onto your Arduino board and you have calibrated the sound sensor, it is about time we see what this combination can do.
The following example simply detects claps or snaps then prints a message on the serial monitor; all you have to do is connect your Arduino to a computer and type in this program:
#define sensor in 7
Unsigned long lastEvent = 0; // variable that stores the time at which the last event happened
Void setup(){
PinMode(sensorPin, INPUT); // sets sensor pin as an INPUT
Serial.begin(9600);
}
Void loop(){
int sensorData = digitalRead(sensorPin); // reads the sound sensor
if (sensorData == LOW) { //if the sensor pin hits LOW, sound is ultimately detected
if (milli () – lastEvent > 25{ //if 25 milliseconds pass since the last detected sound,
//it means that the clap is detected and not because of any spurious sounds.
Serial.println(“clap detected”);
}
LastEvent = millis(); // remembers when the last event occurred
}
}
If everything is functioning fine, the Arduino should detect sound once you clap and display “clap detected” on the serial monitor. You can play along with this program adding in new functionalities until you develop a pretty cool project.
Troubleshooting
If you detect that the sound sensor is misbehaving, try out the following steps to fix it:
- Double-check the power supply to ensure it is clean. Because sound sensors utilize an analog circuit, they are more prone to power supply noise.
- The electric microphone utilized on a sound sensor is pretty sensitive to wind noise and mechanical vibration. It would be best if you hence mounted it with a resilient material. Doing so can help absorb vibrations.
- The sound sensor’s sensing range is pretty small, probably around 10 inches. It would be best to clap your hands or make a noise near the sensor’s microphone to attain a better response.
That is how you can make a sound sensor. It is pretty straightforward, but you can use it for a lot of things that range from:
- Clap switches
- UV light meter
- Room lights that utilize sound sensors
Adding sound wave properties to your project has never been that easy.
Now that we know how sound sensors work, let us take things up a notch by looking at some advancements made in sound sensors:
The NXT Sound Sensor
Have you ever heard of the NXT sound sensor before? Do you know how this sound sensor functions? Well, if you do not have answers to both or even one of these two questions, then this section is for you. We shall go through the NXT sound sensor and the incredible new features that it brings to the table. Hence follow along!
The NXT sound sensor is a sound sensor that comes in two different variations:
- The normal sound sensor
- The ultrasonic sound sensor
How does the NXT Sound Sensor Work?
The NXT sound sensor functions like a standard sound sensor mounted onto an Arduino board but with some advancements that make it unique. Due to these advancements, robots can utilize NXT sound sensors to “see” and detect objects as they move around.
The NXT sound sensor detects both DB (decibels) and DBA (adjusted decibel).
- Decibel – We measure sound pressure in decibels.
- DBA – in detecting DBA, the sensor’s sensitivity is adapted to the human ear’s sensitivity. These are sounds that you can hear via your ears in simpler terms.
- DB – detects unadjusted (standard) decibels; this means that this sensor can detect sounds that are too low or too high for the human ear to hear.
The NXT sound sensor can detect and measure sound pressure levels of up to 90DB – that is almost equal to the sound pressure of a lawnmower. Sound pressure levels can be extremely complicated. Hence most NXT sound sensors display reading in percentages. The higher the percentage, the higher the sound being detected. For example:
- 4% to 5% is like a quiet living room
- 5% to 10% is like a person speaking from a distance
- 10% to 30% is like the noise generated when you are conversing with a person at close range
- 30% – 100% is like the noise produced by people shouting or when you are playing loud music
The Ultrasonic Sensor
Robots utilize the ultrasonic sensor for “vision” and detection; using this sound sensor, robots can sense and measure distance, detect movement and avoid obstacles. But how can sound sensors help in all this? Well, that all lies in the mystery known as the ultrasonic sensor.
Ultrasonic sensors utilize the same scientific principle that bats use. It produces a sound wave and then measures the time taken to hit an obstacle and then bounce back, the same way you hear an echo, only that the sound wave they produce is not as loud. Huge obstacles having a hard surface return the best reading. Curved obstacles (like a ball) made of soft fabric, or small in size are pretty hard to read for the sound sensor.
You should also note that two or more ultrasonic sensors working in the same room tend to interrupt each other.
Phasmophobia
Games are a major branch of tech. I mean, in the 21st century, almost every handset gadget comes with a game pre-installed. What’s more, games are evolving whereby we now have virtual reality games that you can play and experience everything as if you were literally in the game console yourself. Others utilize infrared, sound, and motion sensors to create a gaming environment out of your normal house. One of these incredible games the phasmophobia.
Phasmophobia is a horror game that utilizes sensors to detect a “ghost” in a room designated for the game. These set sensors are unlocked once you hit level seven through level eight. Once unlocked, you can utilize these sensors to record readings from the ghost. For the sensors to work, you have to place them on walls. Once you have perfectly placed the sound and the motion sensors, you can move back to your truck and monitor them.
Phasmophobia Sound Sensor
People use sound sensors to detect any movement that might occur in any of the designated rooms. To use the sound sensor, equip it onto your hand and then stand near a wall; you will see a hologram. Choose the most appropriate place to mount your sound sensor and you are good to go.
A sound sensor will detect any movement activity in the entire room. To visualize the radius of your sound sensor, head on to your truck and check on the map where you mounted the sound sensor. The sound sensor’s radius will be displayed in yellow giving a clear visual of the radius.
Remember that the sound sensors, once mounted on a wall, picks up any movement that occurs in the room. Therefore, if any of your teammates wander into a room, the sound detector will sense them and produce a false alarm. When the sound sensor picks up sound, it displays an alert on the gaming monitor. The room that has the sound sensor will also be displayed on the monitor.
When used with infrared and motion sensors, sound sensors give phasmophobia a great touch that makes the game super thrilling. Now that is what we call taking things up a notch.
Phasmophobia Motion Sensors
Phasmophobia motion sensors function exactly like sound sensors but have a pretty small radius. Therefore the best place to mount your motion sensor would be in an alley. Alleys have a straight line detection range, making motion detection pretty easy.
When a motion detector senses motion, it displays an alert on the map’s screen in the truck. Motion sensors cannot differentiate between a teammate and a ghost too.
Now that we are in the motion sensor section let us look at motion sensors with sound.
Motion Sensors with Sound
Motion sensors are important for a lot of things:
- In playing games such as phasmophobia
- To control devices via motion detection
- For security purposes – this is the core use of motion detectors
How do Motion Sensors with Sound help as per Security?
If anyone comes into your house while you are away, you will want to know about it since they might be thieves. Well, motion sensors with sound will alert you immediately they sense movement in your house while you are away. To avoid false alarms, you have to activate these motion sensors when you want to use them and deactivate them when you don’t.
How do Motion Sensors with Sound Function?
Motion sensors with sound work pretty much like sound detectors. See, when you are moving around, you send out vibrations. A motion detector picks these vibrations via a diaphragm, just like the sound sensor’s, and then wave conversion occurs. While playing a game such as phasmophobia, the instance anything or anyone sends out a vibration (might be vibrations from footsteps), the motion sensor with sound picks up this vibration and produces a reading.
Ultrasonic Motion Sensors
An ultrasonic motion sensor is another motion sensor that utilizes sound to detect motion. Ultrasonic motion sensors utilize the same principle that is used by microwave sensors. However, ultrasonic motion sensors use sound waves instead of bouncing off microwaves on obstacles. By bouncing off sound waves on surfaces, these motion sensors can detect motion and produce readings.
Sound Sensor Projects
Before we wrap things up, let us leave you with some sound sensor projects that you can try out on your own to test the knowledge that you have gained from this article:
- Sound pollution detection
Using a sound sensor, you can develop a device that can sense overall sound and air quality. In doing so, you can help reduce sound pollution in your area.
- Baby monitor
You know how babies can cry for hours and hours when no one is around. That can be a problem, but one that can be solved using a sound sensor. A baby monitor that utilizes sound sensors can pick up noise and alert you when the baby starts to cry. You can add more features, such as a camera, to increase the monitor’s efficiency.
- Dog barking tracker
Dogs tend to sometimes misbehave when left home alone. However, using a dog barking tracker, you can easily track your dog’s barking to know what your dog is up to. Of course, you will have to first track the dog’s barking pattern, but after that, you are good to go.
These are but a few of the many projects you can develop using a sound sensor.
Conclusion
A sound sensor is a crucial device that can do wonders in the tech industry. Its applications are endless, and benefits seem to go up every day. We hope this article has answered all the questions you might have heard regarding sound sensors and their application.