Step 2: Getting Pulse Codes From Your TV Remote

In order to send channel changing codes from your Arduino you'll have to read your remote's channel changing codes... on your Arduino!  Here's how we'll get that done.

First you'll need to download IRremote.zip below and unzip it into your Arduino's, "Library," folder.  I'm using Arduino version 0018 and my directory looks like this;

This is Ken Shirriff's infrared library that's capable of recording and displaying raw pulse codes.  Since it gives raw codes instead of only specific company protocols it should work with any remote sending IR pulses.

Next set up your Arduino like the picture.  If you're looking at the black lense of your 38kHz IR Receiver:
the leftmost Receiver pin gets jumped to Arduino digital pin 11
the middle Receiver pin gets jumped to Arduino Gnd
the rightmost Receiver pin gets jumped to Arduino 5V

Then plug your Arduino into your computer and open your Arduino software.  From the File menu select;
Click on the Upload button and once your sketch is uploaded to your Arduino click on the Serial Monitor button.  There's a picture pointing out these buttons if you get lost.

Now point your remote at the 38kHz Receiver and you should see your Serial Monitor come to life when you push a button.  We'll want to click the remote buttons 0 through 9 one at a time and save the pulses we get from each so we can clean them up and put them in our Arduino sketch later on.
<p>What a time to be alive!:) Science!:)</p>
You just gave me an idea for a device to be placed in the bathroom, to indicate to others (wife, specifically) when it is &quot;safe&quot; to enter.
I bought 4 of these off of ebay! thanks Schmidtn. I was able to calibrate the tuner module so that every time my sister farted, Oprah turned on. <br> <br>j/k
Can't wait to try these!
LOLOLOLOL!! <br>so cool <br>i wish i had an Arduino........
Have you officially named this amazing creation of yours? It needs a name worthy of its ingenuity and awesomeness. The assmote?
i have an arduino nano from http://www.dealextreme.com/p/arduino-nano-v3-0-81877 its uber cheap the only down side is it takes a while to arrive but its worth the wait and kinda wanna make this at some point
Totally deranged. I Love it!<br>Instead of connectting to a TV, one could connect to claxon horn and flash warning lights and switch on a fan. Never sneak one by again.
Yes, it's a pretty cool platform for doing just about anything once a fart is picked up.
LOL its great for zapping
was that a REAL fart????
Yes it was, the gas sensor will only change the channel if it smells a real fart.
Hello Schmidtn, <br>I am using 0021 and an Uno . I read some more on line and in the end copied into Hyperterminal. I didn't copy it right ( it was late at night) so the code didn't work right. I will try again and keep you posted . <br>I also wanted to compliment you on your step by step approach to putting a project like this together and testing it as you go along...very wise! It also makes it much easier to trouble shoot each step as opposed to when the project is complete and a puff of magic smoke is all there is to show for it. <br>Thumbs up and bravo, <br>Build_it_Bob
Yes, please keep me (us) posted. I'm interested to see how it turns out. <br><br>Also, thank you for the kind words.
Sucess using Hyperterminal and copy paste . I just had to make sure the commas were correct and then it worked for a samsung tv power off/on command . I removed power from the arduino , re-powered and tried it again a few times and it worked each time . This is something that can now be expanded and used in other projects ! <br>Yea Team! <br>Arduino coupled with good instructables ( and teachers!) make for awesome learning. <br>Many Thanks! <br>Build_it_Bob
hahaha good one
I am trying to &quot;Copy&quot; the readings and can't seam to highlight them ?? Is there a step that i am missing? <br>Thanks for your help with this as i was able to to decode my Sherwood RC-119 remote by disconnecting pin 11 every time I seen the NEC 32 bit code come up on the serial monitor. <br>Build_it_Bob
So you can't highlight the pulses in the serial monitor window? Are you using the version 0018 IDE? When I did this project I pushed each button, one at a time, and then copy/pasted the entire thing over into a notepad document. If it wont let you do that (and this would really suck) you might have to enter them in by hand.<br><br>It should work just like copying something from a normal word document, just highlight everything and Ctrl+C it, then go over to your notepad doc and Ctrl+V.
most epic device ever made!
Now put it in a chair :) it would be a funny prank xD Nice job!
prrrrrrrrrrrrrrrrrrrrrr, prrrrrrr, prrrrrrrrrrrrrrrrrrrrrrrrrr,prrrrrrrrrrrrrrrr,prrrrrrrrrrrrrrrrrr,prrrr,=well job in electronics, change your diet, Instructables Admin open the f@T## windows!!!!!!!!!!!!!!
You should add a mode that changes the channel based on the intensity of the fart. Like channel 1 when its a silent but deadly and channel 999 for the loudest and longest in duration.
Loudest and longest isn't always most powerful though. But the SBD should get extra points for its potency. Total fart power reflects a combination of 3 variables -- intensity, spread, and persistence. If there were a way for the sensor to reward farts that were terribly stinky, covered a large area, and/or lingered profusely, that would be the ultimate.
You could do that. I'm assuming a more intense fart would linger longer, so I'd start a timer when the CH4 Methane sensor's Alarm triggers HIGH and stop the timer when it triggers LOW. Then, based on how big the number on the timer got up to, you would used that timer value to set the TV channel. Bigger number = higher channel. You could make a party game out of it.
what if theres multipul farts would it then channel surf for him?
Yes, within a limit. There's a one minute debounce for the fart to clear out. So, as long as the farts are a minute apart, he could channel surf by farting.
NOW, we're talkin' I like where this is going
better than a &quot;Clapper&quot;
Speaking of clapper, that would be interesting to link it to the light's so the light's flicker when every they fart.
or mount the vibrating unit from a &quot;Magic Fingers&quot; to the frame of the chair they're sitting on . . .
In Australia you can buy a fart remote unit from Jaycar for $12.95 AUD. http://www.jaycar.com.au/ Cat No: GH1088.
That's not the same as this at all... Try reading things closer next time..
Not the same, but fart related. He was just trying to contribute. It's better if our maker family is nice to each other and less judgemental.
Aw come on, Vmod wasn't being rude. Very diplomatic and neutral with a helpful suggestion. I'll take whatever flak ensues if my comment to the MadCobbler is misinterpreted. (This is not an attempt to &quot;troll.&quot;) Have a great day Mr. MadCobbler!
No problem, just a difference of opinion. I just thought telling Questor to &quot;read things closer next time&quot; was a bit confrontational and making an assumtion on the intent and purpose for his posting. I felt Questor was not &quot;off topic&quot;, but just providing info about another fart related gadget (admittedly not a remote, or in the same league though) for those that might be interested. Sorry if I have caused a stir, I certainly don't want to cause a distraction to Schmidtn's fine project. I'm done. - Peace out. -
well a fart machien could be of use if your fartless an wanted to test it as your ajusting the settings or even if you just plainly wanted to swich the channel right befor a climax in a stupid show he was watching when you wanted to watch barrny the dinisor insted . just a thought ....
that is an electronic whoopee cushion
specially designed for this guy http://www.youtube.com/watch?v=qJDbLWROTII
The problem is, many channels don't actually exist, and entering them gets you nowhere. What you would need to do is compile a list of all the channels that work, and have it choose from those. Of course, you could always set it to something specific, say, Nicktoons...
I actually did make it so it only changes the TV to real channels that work. To alter the code to work with your TV provider's channel listing go to, &quot;Step 4: Test Your Remote&quot; and follow the instructions under &quot;Work to do on your sketch&quot;
Oops... *facepalm* Apparently I missed that... .
Fartastic idea !!!
This has to be the most ridiculously amazing inventions since breathing. I applaud your skill and humor. Good job. *****
Agreed. Ridiculous, amazing, etc. But the breathing part is getting harder every time the sensor is triggered! Finally, something we *might* be able to call the first non-commercial use of Smell-o-vision. Keep up the good work everybody, between this and the &quot;coin slot detector&quot; we may be able to integrate warning lights into the back pocket design of future fashions- and save the rest of us from an assault from the rear! Phew! Enough!
Got a vids? :D
I've tried but there's a couple problems. There's a lot going on in a one second span. From filming the initial tute, to the red LED lighting up on the CH4 Methane sensor, to the TV changing channels. Also there's a one minute debounce where you can't trigger it again. I'll keep trying and if I get anything promising I'll YouTube it and add a link.
Oh... My... God...<br> <br> I could totally see someone going:<br> <br> *pfrrt!*&nbsp; &lt;click&gt; &quot;What the...&quot;<br> <br> (cautiously) *pfffffrt?* &lt;click&gt; &quot;What in the...&quot;<br> <br> (straining) *pffffrrrrrrrSPLAT* &quot;God dammit...&quot;&nbsp; &lt;click&gt;
ingenious better than a whoopie cushion or a fart machine awesome.
Sometimes I wish instructables had a like button.

About This Instructable




Bio: Former custom bike manufacturer, spent four years in the military and now I'm an Industrial Engineer spending my free time thinking up things to ... More »
More by Schmidtn:How To Have A Talking Dog Zombie Overrun Gingerbread House Fart Operated Random Channel TV Remote 
Add instructable to: