Find all your DIY electronics in the MakerShed. 3D Printing, Kits, Arduino, Raspberry Pi, Books & more!

final for juliann with tape

I’m sick of hearing about overexposed personalities like Kim Kardashian and Sarah Palin, so I came up with this Arduino-based solution to mute my TV anytime these celebrities are mentioned. I call it The Enough Already. It reads the closed-captioning text that’s piggybacked on your TV signal, scanning for whatever keywords you choose. Build one and it can mute the audio whenever your keywords appear, or even turn off the TV altogether!

I have nothing against Donald Trump and Kim Kardashian, but in the summer of 2011, I was getting rather sick of hearing about both of them. Donald Trump was deciding whether or not to run for president and Kim Kardashian was planning her (ill-fated) wedding. At the same time, I was experimenting with the video signals that came through the composite video output of my cable box. Since my TV was on much of that time, I was starting to get a little sick of hearing people talk about them and decided I needed to develop a way to filter them out.

During my experimentation, I learned that the closed-captioning text transcriptions that are broadcast for the hearing impaired are sent along with the picture signal. I used Nootropic Design’s Video Experimenter Shield for Arduino and their accompanying tutorial to decode the closed captioning text, and then I used Ladyada’s infrared tutorial to learn how to mimic my remote control’s mute command to silence the television’s audio when certain keywords were mentioned. For me, it was TRUMP, KARDASHIAN, and SHEEN. Of course, you can have your version of Enough Already mute the audio based on whatever keywords you like. You could also have it turn off the TV altogether.

Functional Overview

The Enough Already combines the code for two existing Arduino tutorials with a little bit of added code to watch for keywords and control the timing of the mute commands. In order to read the closed captioning data, Nootropic Design provides an excellent tutorial for their Video Experimenter Shield for Arduino. Combined with Ladyada’s tutorial on receiving and transmitting infrared commands, the Enough Already can control the TV based on the words that are spoken during the broadcast.

About Closed Captioning

You’ve probably seen closed-captioning text transcriptions before, if not on your own TV, then on a muted TV in a bar or restaurant. Most modern NTSC televisions are capable of decoding this text data that’s transmitted along with the picture signal in a broadcast. NTSC picture signal contains 525 lines: 486 are the viewable picture and the rest are used for synchronization (the vertical blanking interval) and for data. The Electronic Industries Alliance’s specification, EIA-608, defines how closed captioning data is transmitted on line 21 of the video signal, outside of the viewable picture. Two characters can be transmitted per field and there are two fields (odd and even lines) per frame. Since NTSC runs at 29.97 frames per second, it’s fast enough to send the closed captioning text.

While NTSC has been mostly phased out by digital broadcast standards, cable boxes and digital converters output NTSC video in order to accommodate older televisions. These converters also convert closed captioning data to the EIA-608 standard.

» More on how to use closed-captioning data: makezine.com/go/evertzcc and makezine.com/go/nootropiccc

Related

Steps

Step #1: Set up the hardware.

PrevNext
Enough Already! The TV Celebrity SilencerEnough Already! The TV Celebrity SilencerEnough Already! The TV Celebrity SilencerEnough Already! The TV Celebrity Silencer
  • Place the Video Experimenter Shield onto the Arduino. (If you bought the shield as a kit, you'll need to solder it together first.)
  • Using a composite video cable, connect your video source output to the video input on the shield. Connect the video output from the shield to the video input on your television.
  • Set the Output Select switch on the Video Experimenter Shield to “Overlay.”

Step #2: Set up the Arduino software.

PrevNext
Enough Already! The TV Celebrity SilencerEnough Already! The TV Celebrity SilencerEnough Already! The TV Celebrity SilencerEnough Already! The TV Celebrity Silencer
  • Download Nootropic Design’s Enhanced TV Out Library (nootropicdesign.com/ve/#library), unzip it, and drop it into the libraries folder that’s in your Arduino folder.
  • Download the Enough Already project code here and open it in the Arduino IDE.
  • Enable your television’s closed captioning to ensure that your video source is sending closed captioning data. Not all broadcasts will transmit closed captioning.
  • Upload the code to the Arduino and open the serial monitor. Set the baud rate of the serial monitor to 57,600 bps.

Step #3: Adjust the shield.

PrevNext
Enough Already! The TV Celebrity SilencerEnough Already! The TV Celebrity SilencerEnough Already! The TV Celebrity SilencerEnough Already! The TV Celebrity Silencer
  • Adjust the larger potentiometer on the shield until you see the flickering bits displayed on the top of your TV screen.
  • Check in the serial monitor, and you’ll see the text coming in. (Imagine what else you could do with this data!)
  • Adjust the smaller potentiometer with your screwdriver if the formatting of the text looks odd, or if you see other data such as the title of the program.

Step #4: Learn your IR mute command.

PrevNext
Enough Already! The TV Celebrity SilencerEnough Already! The TV Celebrity SilencerEnough Already! The TV Celebrity Silencer
  • Adafruit Industries has an excellent tutorial on how to use infrared commands with your Arduino. You just need a breadboard, an IR sensor, some jumper wires, and your TV remote control. You can follow along at makezine.com/go/adafruitir to adjust the project code’s SendMute()function to match your TV remote’s mute command. Here's how I set up a simple test circuit and tweaked the code.
  • Place the infrared sensor in the breadboard, facing to the right. Connect pin 3, the top pin, to the Arduino’s 5V pin. Connect the middle pin, pin 2, to the Arduino’s ground pin, and connect the bottom pin, pin 1 to the Arduino’s digital pin 2. This pin will send the output of the sensor to the Arduino.
  • Download Ladyada’s Raw IR Decoder sketch for Arduino and upload it to your board. Open the Serial Monitor and set the baud rate to 9,600 bps. When you see the text “Ready to decode IR!” in the Serial Monitor, point your remote at the sensor and press the mute button. The Serial Monitor will output the pattern of infrared pulses that your television understands as "mute." Copy this information into a text document.
  • Now we’ll use this information to write functions that will take care of sending the IR command to mute the TV. Open Ladyada’s Intervalometer code in Arduino. Follow the formatting in the SendCanonCode() function to pulse the IR according to the output you saved in the text document. To make this easier, look for a pattern. Many remote controls send the same command 2 times in a row.
  • Upload your code to the Arduino and attach the IR led to pin 13 and ground. If your TV mutes and unmutes every 3 seconds, you know you’ve got it right.
  • Rename the function SendCanonCode() to SendMute()and paste it into the Enough Already code. As you can see, this sketch is simply a modified version of the example code for the Video Experimenter Shield that you uploaded before.

Step #5: Put it all together.

PrevNext
Enough Already! The TV Celebrity SilencerEnough Already! The TV Celebrity SilencerEnough Already! The TV Celebrity Silencer
  • In the keyWords array near the top of the sketch, change the keywords that you want to mute for. Be sure to also change the value for NUMBER_OF_KEYWORDS so that it matches the number of keywords you’re searching for. Upload the code to your Arduino.
  • Connect the anode of the IR LED (longer lead) to pin 13 and the cathode (shorter lead) to ground.
  • With the composite video cable from your video source going into your Video Experimenter Shield, connect a power supply to the Arduino, and your Enough Already is ready to go. Point the infrared LED toward your television and enjoy the silence!

Step #6: Using it.

PrevNext
Enough Already! The TV Celebrity Silencer
  • Note: Only the infrared LED needs to have a line of sight to the television, so you can also place the Enough Already inside your entertainment center and use longer wires to put the LED wherever it needs to be to point at the TV.
  • If your video source has multiple outputs, you can connect your television directly to the video source through one of those outputs. The Enough Already does not need to pass the signal along to the television in order for it to work. Whenever it finds one of your keywords in the closed captioning track, it will mute the television for 30 seconds and it will keep the television muted until the name isn’t mentioned for a 30 seconds.
  • Of course, you can easily customize this project to change the amount of time it’s muted for and what you want the TV to do. You could have it change the channel or turn the television off altogether! Whatever you do, I think you’ll enjoy TV a little more now that you’re in better control!
Matt Richardson

Matt Richardson

Matt Richardson is a San Francisco-based creative technologist and Contributing Editor at MAKE. He’s the co-author of Getting Started with Raspberry Pi and the author of Getting Started with BeagleBone.


blog comments powered by Disqus
Follow

Get every new post delivered to your Inbox.

Join 28,207 other followers