If you’ve gone through Robotics with the BOE Shield-Bot [1], there’s lots you can do with what you've already learned! For example, in Chapter 7 [2], you used infrared parts from a TV remote and TV for object detection. Well, gee, since you’ve already got the IR receiver that’s designed to detect TV remote button presses, why not set your BOE Shield-Bot up for TV remote control?
Better still, make it so that you can configure your robot for different behaviors by just pressing a few buttons. Press Power and then 3, and it follows objects, just like in Chapter 8, Activity 2. [3] Press Power than 2, and it will roam and avoid objects. Press Power and then 1, and you’re back to controlling it with the TV remote’s buttons.
The Shield-Bot needs only one IR receiver and a resistor to receive control signals from an infrared remote.
(1) Fully assembled and tested BOE Shield-Bot (two options, below):
(1) Sony-programmable Universal Remote, #020-00001 [6]
Important! The remote you are using MUST be configured to send Sony-compatible infrared signals.
The Arduino code provided for this project makes the BOE Shield-Bot recognize Sony IR remote signals only! For example, the BRIGHTSTAR universal remote sold by Parallax is programmed by holding the SET-UP button down until an LED on the remote lights up, then entering the code 605. Different models of remotes may use different codes and configuration methods. Check your remote's docs!
In this mode, use buttons 1-9 to drive the robot in different directions. Note that the sketch still uses the IR emitter/receiver pairs to check for an obstacle in front. If you try to drive your Shield-Bot into a wall, it won't let you. Smart robot!
In this mode, the Shield-Bot uses its IR emitter/receiver pairs to roam autonomously and avoid obstacles.
In this mode, the Shield-Bot uses its IR emitter/receiver pairs to maintain a set distance from a stationary or moving object in front of it. The robot will follow your hand or another robot.
The infrared receivers on the BOE Shield-Bot read the infrared signals sent by the remote. The remote flashes its IR LED on/off very rapidly—at 38.5 kHz—for certain periods of time, with periods of off-time in between.
The IR receivers on the Shield-Bot are tuned to look for 38.5 kHz signals. While these IR signals are detected, the receivers send a LOW signal to the Arduino I/O pin. In between these IR bursts when the signal is not detected, the receivers send a HIGH signal to the Arduino I/O pin/. The Arduino sketch measures the lenghts of the HIGH and LOW signals, and decodes them to know which button on the remote was pressed. Each button corresponds to different navigation instructions for the Shield-Bot servo motors. Pretty slick!
Links
[1] http://learn.parallax.com/ShieldRobot
[2] http://learn.parallax.com/node/299
[3] http://learn.parallax.com/node/337
[4] https://www.parallax.com/product/130-35000
[5] https://www.parallax.com/product/32335
[6] http://www.parallax.com/product/020-00001
[7] https://learn.parallax.com/sites/default/files/content/shield/IR/Sony_IR_Shield_Multi_Bot_v0_83.zip