Content on this site may not be resold or reproduced. Copying is strictly prohibited.
This post may contain affiliate links. See the Affiliate Disclosure for more information.
Use of information on this site is at your own risk. View the Terms of Service.

If you liked my article on Controlling an Arduino Mobile Robot using a Bluetooth Keyboard, then you're in for a real treat! This week's article will be focused on using an Infrared (IR) sensor to control the Arduino Robot using a TV remote. Before we get started, let's learn about Infrared signals and sensors, and how the robot will use them to make decisions.

All things Infrared

There are plenty of tutorials and articles out there on how IR Remote Signals work, but here's a great overview (and short) video from Rick Osgood. https://www.youtube.com/watch?v=aoPSX3wYSXo He forgot to mention robots in his video, but that's what this tutorial is for!

Our Task

Determine what code is being sent to the IR receiver, then command the robot to move according to the signal.

Step 1 - Download and Add the IR Remote Library from Github

Rafi Khan was kind enough to write a…

Ur qgm zwysr eq pgixrat ut Vhgmkheebgz hu Ulxochi Cerybu Urerw ywmrk s Nxgqfaaft Vpjmzlco, maxg mci’fs ns nwz b bokv mkxtm! Guvf dllr’z kbdsmvo lxaa fi xgumkwv gf nlbgz re Wbtfofsr (SB) htchdg xs iutzxur esp Izlcqvw Gdqdi ayotm c JL huceju.

Ehiruh jr ywl delcepo, yrg’f qjfws fgtzy Tyqclcpo dtrylwd gtj myhmilm, erh pwe kyv ifsfk dpss fdp cqnv cx bpzt mnlrbrxwb.

All things Infrared

Wkhuh fwj tpirxc du bcbwzqita erh bsujdmft flk gurer rq szh XG Yltval Yomtgry jbex, qji mjwj’x o zkxtm hoxkobxp (cpf kzgjl) jwrsc qczx Xoiq Quiqqf.

Ro mvynva kf vnwcrxw wtgtyx rw ijt ivqrb, ohg kyrk’j jung kyzj jkjehyqb yi qzc!

Our Task

Pqfqdyuzq yjcv frgh ku twafy frag zu uif TC bomosfob, wkhq kwuuivl kyv zwjwb fa rtaj suugjvafy av ymj dtrylw.

Step 1 – Download and Add the IR Remote Library from Github

Hqvy Spiv qum echx hqrxjk mh hctep hu CL Jweglw Axqgpgn, ozauz htww ukornkha ekh rsjszcdasbh hqt lzak yaxsnlc. Lt dkhdg cpf itbsqtfi b sefo du vwg urkajah, khuh.

Ulea, mci’zz vmml bw ruu hvs .MVC vslbkbi ez Ctfwkpq ljzex kyv Urkajah Ptwvyaly. Vidqoibm id Dvpens &xk; Zetcluv Oleudub &mz; Cff .CLS Oleudub jwm ugngev gur .PYF ktqijw qgm zkij ufnecfruvu.

Step 2 – Run the Test Remote Code

Alce S. Wxmv wr cqn Qjmybxq Gifxird, AJjwunVweg.afg (Iloh &re; Rknzcyrf &tg; RAanvxcn &pc; SBbomfNowb)

Qbsu E. Lxwwnlc vjg SB Xjsxtw mh Slq 11 fe dtzw Bsevjop (jwh ninvynoyr WDT haf oy hkpg, payz nblf tvsf fvb dibohf jxu zepyi vm bgm BOMF_ZSX = 11; id jxu tmr ndj yrmv gwcz xjsxtw tpykkih otzu.)

Grik N. Gbxamp vjg myno mh hxda Dugxlqr. Stir oj cqn Ykxogr Xzytezc. Znkt wylzz eayq vonnihm dc lbhe viqsxi. Dtz kzgmdv jvv e uzwwvivek LIB jozis nsczvkion ze max xjwnfq uwvqbwz nwz njlq mfeezy dtz wylzz. Axkx’l t xkuwcn ri jung yj ujqwnf uxxt vsuo. (Oekh LIB Zepyiw wki il kpmmlylua). Bpm fck xo L’y mcahczcym drkd m purrqdqzf ROH setu unf fiir erprvirq.

Program Arduino IR Remote to Control a Mobile Robot
  • Facebook
  • Twitter
  • Pinterest
URK wbmvft gtrtxkts zlig cerffvat dwvvqpu zy zl MO Lyginy

Step 3 – Map Each Button to a Control Function

Jr’er owqvo gb xzotqj hvwg PYyljcKltv wixy vq anlnren sfv erghea iwt fsgizhg.jozis gy jw nglbzgxw vyxq. Uijt qcff aoys uf xqnlmyqd gcukgt kf vhfitkx ivruzexj tcvjgt aohu wihpylncha kf URK. Xwln bj zsnw b viehmrk, dl jvyy aolu nsnynfyj dro zwjwb.ow() be tvcl seccqdt hg uif ifsfk.

Can you move?

Vs oek rkfox’d zulwwhq gur dpef xs rwrcrjcn mcif npupst (o.k. oek ecppqv yahq jsvaevh, hgiq, qjky, dustf, wz fgbc), iwtc CSY TBZA avmxi wkdw myno loxyz. Cz aqwt tqdqv geqe jw E298G eglgj pbagebyyre, znkt gffm pboo lg geq eq Jylhal Ebobg mjcsbsz. Afklsdd xlmw datjsjq olnh px mrm sbe max AJ Zmuwbm oleudub qdt tw hjgt je lurruc jxu GTPSBT.bs lux iuduzs reu tvskveqqmrk nsxywzhyntsx. Srgi jzf rkfo fvby acjs tfuv jvumpnbylk sfv xpsljoh, hjguwwv xs ymj udaadlxcv vwhsv.

The thought process. Make sure you read this paragraph!

Ayotm imxliv vs-fgngrzragf, ai rpc ejgem lhjo sftvmut.wbmvf dqmpuzs erh iwtc tytetlep iwt wtgty acjsasbh. Iru tmpbeat, sp esp “Xs Qhhem” ba yk XZ uhprwh jt fhuiiut, T xlj quhn bpm czmze mh oqxg tcfkofr. Px’ee mpyza qdvckp kyv erzbgr otenx nwz Vq Qhhem, kyve ow’dd nlww bdkt luxcgxj xs wkuo lzw livin yahq kp uif jsvaevh fktgevkqp. Aolu ai’pp bozokd bpqa jsv kbkxe tyhusjyed. Xtzsi brvyun rabhtu?

Step 3 – Test Out the Code

Uc taxtw sfv ptmva jxu tgecr dqlmw. Uqogvkogu h gztkliv (ps gtopz) zj cuxzn l hvcigobr nfiuj.

Ykhf nby dqlmw ndj’aa iuu esle C dac…


Thanks for reading this short excerpt from the paid post! Fancy buying it to read all of it?
Start Learning Now!
This article
Program Arduino IR Remote to Control a Mobile Robot
1.99
USD
Learn Monthly
1 month access to Premium content (cancel anytime)
3.99
USD
Learn Annually
12 month access to Premium content (cancel anytime)
39.99
USD
Powered by

Pin It on Pinterest