Wireless Noise Detector


People love enjoying the peace of silence, I recognize that I belong to that group. Sometimes the peaceful atmosphere is disruptive for example when someone opens a window without knowing there is noise outside. If I had knowing someone was making noise in the street I had not opened the window. By now, do not get worried because I am going to tell you about how to make a WIRELESS NOISE DETECTOR that lets you detect the noise and you do not need to drill the wall. Read on this project and you will learn how to do it yourself.
Before starting let me identify another use case. Imagine that you would like to throw a party at home but you are worried about disturbing your quiet neighborhood because too much noise and they could end up calling the police. Thanks for thee WIRELESS NOISE DETECTOR it will let you know if the music is too loud. How? If there is noise detected outside it means that your neighbors could hear it. Oh my goodness! By now I am completely sure that I have just drawn your interest in this wonderful device.
Supplies
Bellow the list of materials or BOM:
- Two Arduino Pro Mini 3.3V 8MHz
- A bluetooth module HC-06, it will be the slave
- A bluetooth module HC-05, it will be the master
- A integrated circuit 74HC595, 8 bit shift register
- A DIP socket of 16 pins
- A noise sensor KY-037 with digital output
- Two switches
- Eight leds (two green, three yellow and three red)
- Eight resistors about 220 Ohms
- Two wire terminal blocks
- Two battery holders for 3 batteries of type AAA
- Six batteries of type AAA
- Two drill boards
- Pins (female and male)
- Dupong wires and wire
- Soldering tin
- A solder
- FTDI or USB to serial UART interface and its computer wire
- Polymeter
- Cello tape
Once you have them, it is time to start. Are you ready? Firstly we will focus on the Bluetooth modules and its configuration, then how to program Arduino Pro Mini and finally its integration.
Part 1, Bluetooth


HC-05 and HC-06 are bluetooth modules that can be used with Arduino easily. At first sight, they look quite similar even they use the same board, but there are some differences such as:
- HC-06 does not have a button switch
- HC-06 just have 4 pin headers
- HC-06 just works as slave, whereas HC-05 can work either as slave or as master
For its configuration we will use UART port and AT commands, it has to be wired as indicated in the picture, it will also let you upload the sketches into the Arduino Pro Mini. I would like to comment to upload the programs you can connect the DTR pin, but if your UART interface does not have that pin you can also push the Arduino Pro Mini reset button (red one) until the moment the compilation has finished and the upload has started.
The HC-05 will be the master and the HC-06 will be the slave. It means the HC-05 initializes the connection. Take into account a slave cab be connected to one master, but a master can be connected to one or more slaves. In this case, following the next configuration steps the master will just connect to just one slave.
Part 1-1. AT Commands for HC-06 (slave):

IMPORTANT REMARK: When you upload a sketch pick out the board Arduino Pro Mini and the processor ATmega328P (3.3V, 8MHz).
Upload the sketch into the Arduino Pro Mini then open the Serial Monitor with NL&CR and 9600baud.
AT+LADDR
It lets you get the MAC address, jot down the value in paper. I my case a got 7FE101008182.
AT+BAUD
It lets you get the baud rate. In case the result is not 4, type AT+BAUD=4 and check that it is finally 4.
Downloads
Part 1-2. AT Commands for HC-05 (master)

Upload the sketch into the Arduino Pro Mini, then open the Serial Monitor with NL&CR and 9600baud. When you power this module you have to push its button previously and keep it for about two seconds to be able to process the following AT commands:
AT+ROLE
It lets you get if it is configurated as master or slave. If the result is not 1, type AT+ROLE=1 and check that it is finally 1.
AT+CMODE
It lets you know if master configuration is one to one or one to some. If the result is not 1, type AT+CMODE=1 and check it is finally 1.
AT+BIND=XXXX,YY,ZZZZZZ
XXXX,YY,ZZZZZZ is the MAC address of the HC-06, you have to type it according to that format. In my case I typed AT+BIND=7FE1,01,008182.
AT+UART
It lets you get the baud rate. If the result is not 9600,0,0 you have to type AT+UART=9600,0,0 and then check the result.
Downloads
Part 2. Programming Arduino Pro Mini
One Arduino Pro Mini is connected to the HC-06 and the noise sensor and the other one is connected to the HC-05 and leds. What is the gist of the used code? There is a variable that stores how many times the noise has been detected during a period of time.
You can use the same wiring as we used for Bluetooth to upload the sketches.
Part 2-1. Code of the Arduino Pro Mini With the HC-06 and Noise Sensor
It is based on interruptions, where the value of a variable increases when the input signal (pin 2) goes HIGH, that signal comes from the digital output of the noise sensor. After a fixed time that can be configured, if its value is more than zero it means noise has been detected and the data is sent out to the other Arduino Pro Mini that has a function as a indicator. The range is from 1 to 8, of if it is higher than 8 it is modified to 8. When the value is zero the data is not send out. In short, the slave sends out data periodically as long as its value is more than zero.
Downloads
Part 2-2. Code of the Arduino Pro Mini With the HC-05 and Leds

The range of values that it received and process if from 1 to 8, turning on as many leds as the value. Take into account the sort of data that it receives is char that is why we rest '0' to the result. If after a configurable period of time, 1 second by default, we have not received any data all the leds turn off.
There are 2 proposals depending on the use or not of the integrated circuit 74HC595 8 bit shift register. I recommend its use because it will let the Arduino have more available pins for future developments.
Option 1: Without 74HC595
We use the control structure SWITCH..CASE twice for each value that receives. One for turn on the number of leds indicated and the other to turn off the rest of them.
Option 2: With 74HC595
We use 5 pins of the Arduino to control the leds instead of 8 and we also let available the pin 7QS for future implementations such as adding more leds. It is important to bear in mind upcoming designs although in this case we do not need pin 7QS.
If we compare with the option 1, we tell apart the sketch is a bit simpler and we will require less ins of the Arduino but the wiring is a bit more complicated. We also use the control structure SWITCH..CASE but just one in order to put into the 74 HC595 as many ones or high levels as it is indicated in the data. We have previously reset the content of the register in 74HC595. As you can also see, the DS pin is high level all the time, we play with MR pin.
Step 3. Wiring







It is time to wire all the components. Take your time and be patient, I suggest you using the polymeter to ensure that the different elements are well-soldered. Please, do not forget to solder all the grounds.
After soldering the different elements, we will cover the circuit side with cello tape in order to avoid shortcuts. and connect the pins.
NOTE: I have soldered it with the integrated circuit 74HC595
Final Result and Demo


As you can see, we have done it! we have done our own WIRELESS NOISE DETECTOR! We have used Bluetooth connectivity that will let us have a maximum distance roughly 100 metros.