How to Deal With Noisy Neighbors

98,493

119

154

Intro: How to Deal With Noisy Neighbors

My next door neighbors have recently been playing their music really loud so that I can hear it through the walls. I've gotten tired of having to bang on the walls each time to get them to quiet down, so I decided to automate some payback. The premise is that my device will listen for loud music playing through the wall, and when the volume breaks a pre-defined threshold and hears sustained music for 10 seconds it will start playing a CD player with annoying music and blast it back at them. After playing for a certain period of time it will pause the music and go back into monitoring mode. If the neighbors are still loud it will blast the music again and again indefinitely.

Watch the video to see the device in action!

Step 1: Supplies

I used the following items for this device:

1  Breadboard
1  Arduino  Uno
1  5v power source to power the Arduino (I powered it through USB from my laptop)
1  Electret microphone
1  Green 10 LED bar graph (individual LEDs will work too)
1  Red 10 LED bar graph (individual LEDs will work too)
1  Orange LED (or any other color)
1  NPN Transistor 2N3904 or similar
2  0.1uF capacitor
1  100k ohm resistor
2  10k ohm resistor
13 220 ohm resistor (Or whatever will run your LEDs at 5v)
1 CD player
2 Big ol' speakers
Connector wire

I ran out of outputs with the Arduino Uno so my volume meter only uses 2 of the red bars. An Arduino Mega would provide more outputs and make a better volume meter.

Step 2: Setting Up the Circuit

I fed the electret microphone signal through a simple preamp circuit that I found online, then into an analog input on the Arduino. The LEDs are driven directly by the Arduino outputs. To control the music I tapped an output into the play/pause button on my CD player. With my particular CD player the signal needed to be held high at 5V and dropping it down to ground activated the button.

You can download the Fritzing file of the circuit I set up.

Step 3: Programming the Arduino

You can download the attached sketch and load it onto your Arduino. The program will automatically run on powerup.

Some important notes about the code:

Line 7
const int threshold = 320;
This sets the threshold for triggering the playback. It should be low enough so that the neighbor's music makes our graph go into the red, but high enough so ambient noise won't set it off (like a loud car outside). Play around with this value to set it just right.

Line 9
2,3,4,5,6,7,8,9,10,11,12,13};
These are all of the outputs that make up the LED bar graph. If you use more than I did, you will need to add the extra ports here.

Line 14
const long waitTime = 10000.0;
This is the 10 second wait period to avoid false alarms. You can change this as needed (the value is in milliseconds).

Line 15
const long cancelTime = 4000.0;
This is what defines "continuous" music during the waiting period. If the music stays below the threshold for 4 seconds then it cancels the waiting period and goes back to monitoring. You can change this as needed (the value is in milliseconds).

Line 16
const long playTime = 30000.0;
This is how long the annoying music will be played. It is set for 30 seconds but you can change this as needed (the value is in milliseconds).

Line 37
digitalWrite(playPin, HIGH);
This is the CD player control output. With my CD player the play/pause button needed a constant 5V and dropping it to ground would trigger the button. So here I am setting the pin high initially. If your CD player signal needs to be normally low, you can just delete this line.

Line 46
ledLevel = map(sensorReading, 200, threshold, 0, ledCount);
The 200 here eliminates ambient noise. When it was 0 the first couple LED bars would stay on constantly.

Line 83-85 and 91-93
digitalWrite(playPin, LOW);
delay(200);
digitalWrite(playPin, HIGH);
Again, this is for m y CD player which needed a normally high signal. If your CD player signal needs to be normally low, you need to swap the LOW and HIGH.

Step 4: Installing the Device

Once the circuit is all wired up and the Arduino is programmed, you are pretty much ready to go. I used masking tape to attach the microphone to the wall facing the neighbors. Make sure the CD player is on so that pressing the play button once will start the music. 

That's pretty much it! You can leave the system on while you are at home (although your own noise might trigger it), or set it and forget it when you leave.

Share

    Recommendations

    • Audio Contest 2018

      Audio Contest 2018
    • Plastics Contest

      Plastics Contest
    • Electronics Tips & Tricks Challenge

      Electronics Tips & Tricks Challenge

    154 Discussions

    0
    None
    rprice16

    2 years ago

    I thought maby a thermal camera and a directional speaker but I can't afford that

    0
    None
    rprice16

    2 years ago

    I thought maby a thermal camera and a directional speaker but I can't afford that

    0
    None
    rprice16

    2 years ago

    This still doesn't fix my problem of my naibour repeatedly slamming there door early in the mornings.

    0
    None
    Niriqsha

    3 years ago

    Hey,
    How did you connect the CD player to the arduino?
    My CD player has 220v normal electricity connection while on the breadboard I have 5V due to Arduino.
    So I can't figure how to play pause using Arduino. Could you explain?
    Thanks

    0
    None
    thassaj

    6 years ago on Introduction

    Fantastic - I have had noisy neighbors over the years and have used various amusing techniques to get them to shut up. Borrowing the kilowatt linear amplifier from the local ham radio club was a winner: I put the VOX (voice operated switch) on to a sensitivity such that once the noise got annoying it would key up the transmitter in AM mode and overload the stereo. The guy "learned" not to turn up his stupid stereo, and finally took it into the shop where they said "nothing is wrong with your stereo" - he was enraged that they didn't believe him that whenever he turned it up there was this thundering bassy sound :-)

    One guy played his TV too loudly so I wired some SN 7400 gates up with a capacitor to make an RF square wave oscillator with lots of nice harmonics. I just needed to tune the capacitor and poof - TV signal gone. Wouldn't work with cable obviously :-)

    2 replies
    0
    None
    sbrown9578thassaj

    Reply 4 years ago on Introduction

    Would had been better to get one of those TV be gone switches. Turn it off on him when it is too loud.

    0
    None
    thassajsbrown9578

    Reply 4 years ago on Introduction

    Dude this was in the 1980s - no such thing as a TV be gone switch then (though the 7400 chip oscillator was close...)

    0
    None
    atlantica

    6 years ago on Introduction

    Wouldn't it be easier to punch him in the face and tell him if he ever plays it loud again you'll be back angrier? One time fix. 0 Dollars.

    6 replies
    0
    None
    sbrown9578atlantica

    Reply 4 years ago on Introduction

    Not a one time fix, would end up paying for it in more ways than one. Going to jail and being sued for damages.

    0
    None
    Treknologyatlantica

    Reply 6 years ago on Introduction

    Rather than punching him/her, would you not be better to borrow a dB meter and keep a record, so that you can have the neighbor charged with endangering your own hearing?

    0
    None
    geneoramaTreknology

    Reply 6 years ago on Introduction

    First, annoying noises are rarely loud enough to be dangerous. Second, there are surprisingly few legal remedies for noise pollution (especially if it's from a business)

    And then when you wake up in hospital with multiple broken bones and permanent disfigurement, you're told by the police that the guy you punched is actually a long time boxer.

    0
    None
    tmalta

    5 years ago on Introduction

    thassaj, t=your comment below....can you explain how to do this and what to buy to put it together? I need help....now, urgent!
    thassaj says: Jun 14, 2012. 11:24 AMReply
    Fantastic - I have had noisy neighbors over the years and have used various amusing techniques to get them to shut up. Borrowing the kilowatt linear amplifier from the local ham radio club was a winner: I put the VOX (voice operated switch) on to a sensitivity such that once the noise got annoying it would key up the transmitter in AM mode and overload the stereo. The guy "learned" not to turn up his stupid stereo, and finally took it into the shop where they said "nothing is wrong with your stereo" - he was enraged that they didn't believe him that whenever he turned it up there was this thundering bassy sound

    1 reply
    0
    None
    sbrown9578tmalta

    Reply 4 years ago on Introduction

    I wish I had had your ingenuity. I asked everyone I knew for advice and everything failed. Smart, I agree with Honda 100 thumbs up.

    0
    None
    sbrown9578

    4 years ago on Introduction

    OMG, I had this problem. The kid next door played his stereo loud, living in a condo, the walls are thin and others didn't know exactly where the noise is from unless it is your wall that is vibrating, kept calling the cops on me. I tried something similar to what you are doing. It didn't work. The kid started turning his stereo on as loud as possible and leaving the house. His mom worked at the post office and one day when she came home I tried to talk to her about it but she just shrugged me off. Cops at the house several times pounding on their door. It made the noise that much louder. They never did anything about it. Unless the parents experience the same thing they aren't going to do anything. They moved out of their room and gave the kid access to the room closest to our adjoining wall. I couldn't even put my condo up for sale because any prospective buyers wouldn't even consider living next to them. I had many walk away. I ended up where I stopped paying my mortgage, lived there as long as possible and later filing bankruptcy. Bancruptcy sounds worse than it actually was. Nothing was as terrible as living there. I hope that kid grew up and had horrible neighbors like he was.

    0
    None
    Honda Enoch

    5 years ago on Introduction

    I give this 100 thumbs up I hate annoying neighbors like that. I had some that lived under me that would blast their TV at 3am I started stomping around so hard it knocked their stuff off the walls and their light fell off the ceiling.

    0
    None

    Try taking a Vibratory Sander, (with the sandpaper removed) mount the sander to a 3/16 thick 12"x12" steel plate. Then mount that steel plate to the wall or ceiling facing your neighbor’s unit. Now make a circuit that activates the sander “off beat” to the beat being projected by your neighbor. Now you have a wall, that will vibrate “off beat” to your neighbors tune, essential screwing up every tune he plays too loudly.