You are on page 1of 5

Food

Living

Outside

Play

Technology

Workshop

TV Volume Loudness Guard using Arduino


by techbitar on February 10, 2013 Table of Contents TV Volume Loudness Guard using Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Intro: TV Volume Loudness Guard using Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 1: PROJECT PARTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 2: WIRING THE TV LOUDNESS GUARD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 3: DECODE YOUR REMOTE CONTROL BUTTONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 4: PREPARE THE ARDUINO PROGRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 2 3 3 4 5 5

http://www.instructables.com/id/TV-Volume-Loudness-Guard-using-Arduino/

Author:techbitar
Did I unplug the solder iron?

Intro: TV Volume Loudness Guard using Arduino


INTRODUCTION What can be more annoying than those TV commercials on steroid? Here you are watching your favorite TV show when all of a sudden you are ambushed by a very loud TV commercial sending you scrambling for the remote control to turn down the volume. These panic attacks repeat round the clock day and night. In some countries it's now illegal for broadcasters to blast the volume during commercials. But in many others, this TV audio terror is still legal. I hope my TV Volume Guard will mitigate some of this rudeness. The TV Volume Loudness Guard will listen to your TV and if the volume goes higher than a certain level, it will bring it lower. There are many uses for this gadget such as keeping the TV volume down when you are in a different room while the kids are watching their favorite music channels. Or when someone blasts the stereo system. The TV Loudness Guard will be ready to keep a lid on it. The TV Loudness Guard should be part of every Big Brother's bag of tricks :) HOW THE GADGET WORKS I place my Arduino TV Volume Loudness Guard close to the TV set to monitor the volume. When the volume loudness exceeds a certain threshold (set by me), my gadget sends a Volume Down remote control code to to my TV--or any other remote controlled gadget for that matter--until the TV volume falls below the pre-set level. WORKFLOW There are three steps to make use of the TV Loudness Guard: 1. Capture & decode your remote control Volume Down buttons (or any other remote function). This feature is included in my gadget. 2. Update the TV Loudness Guard Arduino program with the remote control button code captured from step 1 and upload the program to your Arduino. 3. Power the TV Loudness Guard on and place it next to your TV. Fine-tune the parameters of the Arduino program until you get the desired results.

Step 1: PROJECT PARTS


HARDWARE GOduino III or Arduino Uno. You should be able to get this project to work with most Arduinos with some tweaking. Sound Sensor ($4 from ebay). I used Seeed's sound sensor IR 940nm LED Transmitter .($0.10 from ebay) IR Receiver 38Khz 3-pin not the 2-pin LEDs. ($1 from ebay) I got mine from Tayda2009. 1K Ohms resistor. Breadboard. Jumper wires. Power: you can use USB power or any battery that can source 7V to 12V and over 500mA. SOFTWARE The Arduino IDE (Download from http://arduino.cc/en/Main/Software)

http://www.instructables.com/id/TV-Volume-Loudness-Guard-using-Arduino/

IRremote library. Download from https://github.com/shirriff/Arduino-IRremote and extract the content of the zip file to folder Arduino\libraries\IRremote

Image Notes 1. IR Receiver (RX) 2. IR Transmitter (TX) 3. Sound sensor microphone.

Step 2: WIRING THE TV LOUDNESS GUARD


SOUND SENSOR GND pin ---> Arduino GND pin VCC pin ---> Arduino 5V pin SIG pin ---> Arduino A0 pin IR TRANSMITTER LED Cathode ---> Arduino GND Anode ---> 1K Ohms ---> Arduino pin 3 (PWM) NOTE: I forgot to add the 1K ohms resistor to my prototype but it's wise to include it. IR 38KHZ RECEIVER (FACING YOU) Right Pin ---> Arduino 5V pin Middle Pin ---> Arduino GND pin Left Pin ---> Arduino 11 pin (PWM)

Image Notes 1. This resistor is missing from my prototype and you should include it.

Step 3: DECODE YOUR REMOTE CONTROL BUTTONS


There are many remote control protocols out there supported by leading vendors such as Sony, NEC, Panasonic, etc. If your TV is not a brand name, chances are its remote control adheres to one of the popular remote control protocols supported by the leading vendors. Since our gadget needs to simulate sending a Volume Down remote control command whenevr the TV volume is too high, we need to figure out what's the code for any particular TV remote. This is done easily using the example program provided by the IRremote library. With the TV Loudness Guard gadget fully wired, connect your Arduino to your PC. From the Arduino IDE, load the example file IRrecvDump which can be found under menu File/Examples/IRremote Open the Arduino IDE serial monitor. Point your remote control at the IR LED receiver (3 pin) and press the Volume Down button. You will see numbers being displayed on the Serial Monitor. Record the short number generated when you pressed your remote button. In my case, the volume down button was 1CE3E817 and the bit count (e.g. 32 bit) which I will see in my Arduino program. You need to change my remote code with your captured remote control code for your Volume Down button.

http://www.instructables.com/id/TV-Volume-Loudness-Guard-using-Arduino/

Image Notes 1. This is the code for my remote's Volume Down button. And next to it is the data size which is 32-bit. I will need this info to plug into the Arduino program that will be used to transmit this code back to my TV.

Step 4: PREPARE THE ARDUINO PROGRAM


REMOTE BUTTON CODE Place the decoded remote button here #define REMOTE_CODE (PLACE YOUR REMOTE CODE PRECEDED BY "0x") NOISE LEVEL DETECTION Change the noise threshold here #define NOISE_LEVEL (adjust the value from 0 to 1024. Start with 500 then fine-tune the number) VOLUME CHANGE SPEED Change how many times the remote code is transmitted to the TV. If you want more drastic change, increase this number. If you want a more gradual change in volume, lower this number. #define REPEAT_TX (any integer from 1 to as many as you want. Start with 5 then fine tune) THE ARDUINO CODE Cut and paste the code below into your Arduino IDE //================================================= /* PROJECT: TV Volume Guard AUTHOR: Hazim Bitar (techbitar) DATE: FEB 9, 2013 CONTACT: techbitar at gmail dot com LICENSE: My code is in the public domain. IRremote library: copyright by Ken Shirriff http://arcfn.com */ #include <IRremote.h> #define SOUND_SENSOR_PIN A0 // sound sensor connected to this pin #define LED 13 // LED used to blink #define NOISE_LEVEL 350 // level of noise to detect from 0 to 1023 #define REPEAT_TX 5 // how many times to send the remore code #define REMOTE_CODE 0x1CE3E817 // remote code to send IRsend irsend; // instantiate IR object void setup() { pinMode(LED, OUTPUT); } void loop() { int soundLevel = analogRead(SOUND_SENSOR_PIN); // read the sound sensor if(soundLevel > NOISE_LEVEL) // compare to noise level threshhold you decide { digitalWrite(LED,HIGH); // blink LED delay(200); for (int txCount = 0; txCount < REPEAT_TX; txCount++) { // how many times to send the remote code irsend.sendNEC(REMOTE_CODE , 32); // Send NEC remote code. Change to suit your remote protocol

http://www.instructables.com/id/TV-Volume-Loudness-Guard-using-Arduino/

delay(200); } } digitalWrite(LED,LOW); // blink LED }

Related Instructables

Arduino IR remote control decryption (video) by techbitar

RemoteJack: Arduino awaits in ambush to thwart unwanted TV channel changes (Photos) by techbitar

How to control your TV with an Arduino! by Wally_Z

TV Remote Controlled Car by kschroeter

Arduinopowered A-10 stick grip remote w/Emergency Party Button! by spikec

See Infrared LED Light with an iPhone 4... by TechShopJim

Advertisements

http://www.instructables.com/id/TV-Volume-Loudness-Guard-using-Arduino/

You might also like