Using the Infrared Sensor Beacon Mode



Infrared Sensor
Remote Infrared Beacon

In Beacon mode, the Infrared Sensor can detect the approximate position of the Remote Infrared Beacon (IR Beacon) in front of the sensor. The sensor can give you the beacon’s Proximity (relative distance from the sensor) and its Heading (angle from the direction the sensor is pointing). You could use the Beacon mode, for example, to make your robot seek out and drive toward the IR Beacon.

Turn on the Beacon and Choose a Channel
Turn the beacon on by pressing the Beacon Mode button on the top of the IR Beacon. The LED Indicator will turn on and stay on. The beacon will stay on and transmit continuously until you press the Beacon Mode button again to turn it off.

Choose one of the four channels from the Channel Selector. The Infrared Sensor will only detect a beacon on the channel that you specify in your program.
Infrared Sensor Beacon Mode Data
In Beacon mode, the Infrared Sensor gives the following data:
DataTypeValuesNotes
Detected LogicTrue/FalseTrue if an IR Beacon is detected on the specified channel, otherwise False.
Proximity Numeric0 to 100The relative distance to the beacon. 0 means very close, and 100 means far away. The Proximity will be 100 if the beacon is not detected at all.
Heading Numeric-25 to 250 means the beacon is directly in front of the sensor, negative values are to the left, and positive values are to the right.
Tips and Tricks
The values for Proximity and Heading do not correspond directly to specific distances and angles. The values will depend on the strength of the signal and other factors.
Example
This program will make a robot start driving when the IR Beacon is on and gets close enough to the Infrared Sensor. It uses the Wait block in the Infrared Sensor – Compare – Beacon Proximity mode to wait for the Proximity to be less than 20, then it drives forward for 2 seconds.
Infrared Sensor Beacon Mode Blocks and Modes
The table below shows all of the programming blocks and modes that you can use with the Infrared Sensor in Beacon mode.
BlockModeUse
Wait Infrared Sensor – Compare – Beacon HeadingWait for the beacon to be detected and for the Heading to reach a specified value.
Wait Infrared Sensor – Compare – Beacon ProximityWait for the beacon to be detected and for the Proximity to reach a specified value.
WaitInfrared Sensor – Change - Beacon HeadingWait for the beacon Heading to change by a specified amount.
WaitInfrared Sensor – Change - Beacon ProximityWait for the beacon Proximity to change by a specified amount.
Loop Infrared Sensor – Beacon HeadingRepeat a sequence of blocks until the beacon Heading reaches a specified value.
Loop Infrared Sensor – Beacon ProximityRepeat a sequence of blocks until the beacon Proximity reaches a specified value.
SwitchInfrared Sensor – Beacon HeadingChoose between two sequences of blocks depending on the beacon Heading.
SwitchInfrared Sensor – Beacon ProximityChoose between two sequences of blocks depending on the beacon Proximity.
Infrared SensorMeasure - BeaconGet the beacon Heading and Proximity on Numeric data wires, and the Detected state on a Logic data wire.
Infrared Sensor Compare – Beacon HeadingCompare the beacon Heading to a threshold, and get the result on a Logic data wire.
Infrared Sensor Compare – Beacon ProximityCompare the beacon Proximity to a threshold, and get the result on a Logic data wire.
IR Beacon Mode
Quick links