Anda di halaman 1dari 5

Explore

(/) (/)

(/tag/type-id/)

Create

(/about/submit.jsp)

Contestslet's (/contest/) make

Community

(/community/)

Login

(/you/)

share what you make > (/about/submit.jsp)

Step 4: Sending the Signals

(/files/deriv/FUC/KT35/GVP28W2Z/FUCKT35GVP28W2Z.LARGE.jpg)

About This Instructable


Now once you have the codes that you want, and have uploaded the program with the signal you want to send, all you have to do is hook up the IR LED to pin 13 and then to ground similar to the schematic in the picture. You don't need the resistor if you have a Duemilanove Arduino because it has a built in resistor for PIN 13 so you don't have to worry. This can also be done with an ATTINY 8 pin microcontroller to cut down on size. I have one but I'm not sure how to use it yet. Now I will be showing you a real-world example on how to do this. AGAIN, THIS IS NOT MY CODE, I just copied and pasted to make it easier to understand. So I got this code when I pressed the channel up button on my Comcast remote. This is the kind of remote that you will have if you have the small black boxes that use the small black remotes. They act as an analog to digital converter box that only can change channels. Here is the Serial Monitor code: Received: OFF ON 36328 usec, 280 usec 820 usec, 300 usec 1580 usec, 320 usec 640 usec, 240 usec 2740 usec, 240 usec 1280 usec, 240 usec 1240 usec, 240 usec 1120 usec, 240 usec 2600 usec, 240 usec 12740 usec, 240 usec 840 usec, 240 usec 980 usec, 240 usec 700 usec, 240 usec 700 usec, 240 usec 720 usec, 240 usec 2460 usec, 260 usec

13,849 views 26 favorites

Posted: Dec 3, 2011 License:

Wally_Z (/member/Wally_Z/)
My Youtube (http://www.youtube.com/user/wjz10595) (/member/Wally_Z/) Follow 11 Bio: I like to tinker with electronics. I like to mod, hack, and learn how something works by taking it apart. More by Wally_Z

(/id/Giant-USB-Flash-Drive)

(/id/Arduino-Police-LightsATMega-2650-Version)

(/id/How-to-make-ArduinoPolice-Lights) Tags:

700 usec, 240 usec 700 usec, 240 usec 14904 usec, 260 usec 820 usec, 240 usec 1660 usec, 240 usec 700 usec, 260 usec 2740 usec, 240 usec 1240 usec, 240 usec 1260 usec, 240 usec 1100 usec, 240 usec 2620 usec, 240 usec 12720 usec, 260 usec 840 usec, 220 usec 2080 usec, 240 usec 1780 usec, 260 usec 700 usec, 240 usec 700 usec, 240 usec 2480 usec, 240 usec 700 usec, 240 usec 700 usec, 240 usec Here is the code that I made from the raw data by putting the code in: // This sketch will change the channel every ten seconds so you can be doing other things //while watching tv and not having to change the channel, like being on a laptop and having //it cycle through the channels so you have free hands. //We all know pressing a button is so hard, so why not make it automated? int IRledPin = 13; // LED connected to digital pin 13 // The setup() method runs once, when the sketch starts void setup() { // initialize the IR digital pin as an output: pinMode(IRledPin, OUTPUT); Serial.begin(9600); } void loop() { SendChannelUpCode(); delay(20*1000); // wait twenty seconds (20 seconds * 1000 milliseconds) Change this value for different intervals. } // This procedure sends a 38KHz pulse to the IRledPin // for a certain # of microseconds. We'll use this whenever we need to send codes void pulseIR(long microsecs) { // we'll count down from the number of microseconds we are told to wait cli(); // this turns off any background interrupts while (microsecs > 0) { // 38 kHz is about 13 microseconds high and 13 microseconds low digitalWrite(IRledPin, HIGH); // this takes about 3 microseconds to happen delayMicroseconds(10); // hang out for 10 microseconds digitalWrite(IRledPin, LOW); // this also takes about 3 microseconds delayMicroseconds(10); // hang out for 10 microseconds // so 26 microseconds altogether microsecs -= 26; } sei(); // this turns them back on } void SendChannelUpCode() { // This is the code for the CHANNEL + for the TV COMCAST delayMicroseconds(36328); pulseIR(280); delayMicroseconds(820); pulseIR(300); delayMicroseconds(1580); pulseIR(320); delayMicroseconds(640); pulseIR(240); delayMicroseconds(1280); pulseIR(240); //Time off (LEFT column) //Time on (RIGHT column)

IR (/tag/type-id/category-technology/keyw ord-ir/) TV (/tag/type-id/category-technology/keyw ord-tv/) Arduino (/tag/type-id/category-technology/keyw ordarduino/) arduino (/tag/type-id/category-technology/keyw ordarduino/) remote control (/tag/type-id/categorytechnology/keyw ord-remote control/) remote (/tag/type-id/category-technology/keyw ordremote/) control (/tag/type-id/category-technology/keyw ordcontrol/)

Related
RemoteJack: Arduino awaits in ambush to thwart unwanted TV channel changes (/id/RemoteJackArduino-awaits-in-ambush(/id/RemoteJackArduino IR remote control decryption (/id/Arduino-IRremote-control-decryption/) by techbitar (/member/techbitar/) (/id/ArduinoTV Volume Loudness Guard using Arduino (/id/TVVolume-Loudness-Guardusing-Arduino/) by techbitar (/member/techbitar/) TV Remote Controlled Car (/id/TV-Remote-ControlledCar/) by kschroeter
(/member/kschroeter/)

(/id/TV-

(/id/TV-

(/id/Bose-

Bose Wave Radio II Arduino Remote Clone (/id/BoseWave-Radio-II-ArduinoRemote-Clone/) by loganemakf

See More (/tag/type-id/?q=)

<-------DO NOT MIX THESE UP

How to control your TV with an Arduino!

delayMicroseconds(1240); pulseIR(240); delayMicroseconds(1120); pulseIR(240); delayMicroseconds(2600); pulseIR(240); delayMicroseconds(12740); pulseIR(240); delayMicroseconds(840); pulseIR(240); delayMicroseconds(980); pulseIR(240); delayMicroseconds(700); pulseIR(240); delayMicroseconds(700); pulseIR(240); delayMicroseconds(720); pulseIR(240); delayMicroseconds(2460); pulseIR(240); delayMicroseconds(700); pulseIR(240); delayMicroseconds(700); pulseIR(240); delayMicroseconds(14904); pulseIR(240); delayMicroseconds(820); pulseIR(240); delayMicroseconds(1600); pulseIR(240); delayMicroseconds(700); pulseIR(260); delayMicroseconds(2740); pulseIR(240); delayMicroseconds(1240); pulseIR(240); delayMicroseconds(1260); pulseIR(240); delayMicroseconds(1100); pulseIR(240); delayMicroseconds(2620); pulseIR(240); delayMicroseconds(12720); pulseIR(260); delayMicroseconds(840); pulseIR(220); delayMicroseconds(2080); pulseIR(240); Download (/id/How-to-control-your-TV-with-an-Arduino/?download=pdf) delayMicroseconds(1780); (/id/How-to-control-your-TV-with-an-Arduino/step3/Interpreting-the-Signals/) pulseIR(260); delayMicroseconds(700); pulseIR(240); delayMicroseconds(700); pulseIR(240); delayMicroseconds(2480); pulseIR(240); delayMicroseconds(700); pulseIR(240); delayMicroseconds(700); pulseIR(240);

by Wally_Z (/member/Wally_Z/) See All (/id/How-to-control-your-TV-with-an-Arduino/?ALLSTEPS) Jump To 4 Steps Favorite

Remove these ads by Signing Up (/account/gopro?sourcea=removeads&nxtPgName=Sending+the+Signals&nxtPg=/id/How -tocontrol-your-TV-w ith-an-Arduino/step4/Sending-the-Signals/)

Previous (/id/How-to-control-your-TV-with-an-Arduino/step3/Interpreting-the-Signals/) Next

Post Comment

c1c2c3 (/member/c1c2c3/) says: Do you need a resistor to go to the IR led?


(/member/c1c2c3/)

Oct 7, 2012. 3:01 AM

Reply (CYV54J4H7UQJLDX)

Wally_Z (/member/Wally_Z/) (author) says: Dec 5, 2012. 9:01 AM Not if you hook the IR LED up to pin 13. Pin 13 on MOST arduino's 5 already has a resistor on it. If you're (/member/Wally_Z/) not sure if it has a resistor, you should use a 100ohm just to be safe.

Reply (CO9LXFZHABC7WK2)

jabujavi (/member/jabujavi/) says:

Jun 24, 2012. 7:22 AM

Reply (CMK9D74H3QFJC35)

(/member/jabujavi/)

I have a questions. Why use delayMicrosecond and don't simply delay? The value of delay is in ms, is not?

(/member/carlos.camposalcocer/)

carlos.camposalcocer (/member/carlos.camposalcocer/) says: Reply (C564I1MH4I7VYE8) Jul 18, 2012. 7:26 PM ms=milliseconds us=microseconds

jabujavi (/member/jabujavi/) says: FAIL Thanks, I work with us many times (/member/jabujavi/) and in this case didn't see it... Jul 19, 2012. 1:30 AM
Reply (CFV7CLCH4AGKNKM)

wmain (/member/wmain/) says: You could define a typedef as


(/member/wmain/) typedef struct irCode {

May 1, 2012. 8:50 PM

Reply (CUP2YVGH1PISXEP)

int off; int on; } codes[34]; codes[0] = {36328, 280}; . . . codes[33] = {700, 240}; then use this code to send it for (cx=0; cx<34; cx++) { delayMicroseconds(codes[cx].off); pulseID(codes[cx].on); }

About Us
Who We Are (/about/) Advertise (/advertise/) Contact (/about/contact.jsp) Jobs (/community?categoryGroup=marketplace&category=jobs_internships) Help (/community?categoryGroup=Help)

Find Us
Facebook (http://www.facebook.com/instructables) Youtube (http://www.youtube.com/user/instructablestv) Twitter (http://www.twitter.com/instructables) Pinterest (http://www.pinterest.com/instructables)

Resources
For Teachers (/teachers/) Artists in Residence (/group/air/) Sponsorships (/sponsorship/) Forums (/community/) Answers (/tag/type-question/)

Mobile
Download our new apps for iOS and android!

Visit Our Store (http://store.instructables.com/)

let's make

Go Pro Today (/account/gopro?sourcea=footer) Android (http://usa.autodesk.com/adsk/servlet/pc/index?id=20781545&siteID=123112) (https://play.google.com/store/apps/details? Terms of service (/tos.html) | Privacy Policy (http://usa.autodesk.com/privacy/) | Mobile Site (http://m.instructables.com) id=com.adsk.instructables) iOS (https://itunes.apple.com/app/instructables/id586765571)

Anda mungkin juga menyukai