{"id":421,"date":"2013-08-30T22:16:07","date_gmt":"2013-08-30T20:16:07","guid":{"rendered":"http:\/\/labalec.fr\/erwan\/?p=421"},"modified":"2015-03-05T18:32:08","modified_gmt":"2015-03-05T17:32:08","slug":"use-your-arduino-as-an-infrared-remote","status":"publish","type":"post","link":"https:\/\/labalec.fr\/erwan\/?p=421","title":{"rendered":"Arduino : use it as an infrared remote"},"content":{"rendered":"<p>A quick article around my adventures with the Arduino.<\/p>\n<p>This time, lets play with infrared.<\/p>\n<p>More precisely lets catch IR signals and send them back.<\/p>\n<p>The IR sensor can be found <a href=\"http:\/\/dx.com\/p\/tsop1838-ir-infrared-37-9khz-receiver-18m-range-2-7-5-5v-135045\" target=\"_blank\">here<\/a>.<br \/>\nThe IR emitter can be found <a href=\"http:\/\/dx.com\/p\/38khz-ir-infrared-transmitter-module-for-arduino-135040\" target=\"_blank\">here<\/a>.<\/p>\n<p>You can use 2 arduino or built it all on one arduino (if so, add a object.enableIRIn() after each send or you wont be able to receive after the 1st send).<\/p>\n<p>Here below the wiring and a quick and dirty sketch for sending.<\/p>\n<p>Now go and place with your remotes !<\/p>\n<p><a href=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/08\/ir_receiver_sender_bb.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-457\" alt=\"ir_receiver_sender_bb\" src=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/08\/ir_receiver_sender_bb-300x180.png\" width=\"300\" height=\"180\" srcset=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/08\/ir_receiver_sender_bb-300x180.png 300w, https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/08\/ir_receiver_sender_bb-1024x615.png 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Sketch to send signals with your IR emitter.<\/p>\n<pre>\r\n\/*\r\n* IR LED must be connected to Arduino PWM pin 3.\r\n*\/\r\n\r\n#include <remote.h>\r\n\r\nIRsend irsend;\r\n\r\nvoid setup()\r\n{\r\nSerial.begin(9600);\r\n}\r\n\r\nvoid send(int code)\r\n{\r\nfor (int i = 0; i < 3; i++) {\r\nirsend.sendNEC(code, 32); \/\/ code, length\r\ndelay(40);\r\n}\r\n}\r\n\r\nvoid loop() {\r\nsend(0x11223344);\r\ndelay(5000);\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A quick article around my adventures with the Arduino. This time, lets play with infrared. More precisely lets catch IR signals and send them back. The IR sensor can be found here. The IR emitter can be found here. You can use 2 arduino or built it all on one arduino (if so, add a <a href='https:\/\/labalec.fr\/erwan\/?p=421' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[27],"class_list":["post-421","post","type-post","status-publish","format-standard","hentry","category-arduino","tag-infrared","category-18-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=421"}],"version-history":[{"count":9,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/421\/revisions"}],"predecessor-version":[{"id":1610,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/421\/revisions\/1610"}],"wp:attachment":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}