Infrared

Infrared

What is Infrared and how is it used?

Infrared is basically a color our eyes cannot perceive but is around us everywhere. Infrared is used in many different products, such as telescopes to see distant planets and gases. Weather satellites use infrared to show us images of storms. Infrared is also used in night vision to see objects in the dark.

In the IR Receiver module and remote control, infrared is used to communicate between the remote control and the IR Receiver.  The invisible infrared light emits from the remote control when a button is pressed. This light turns on and off very fast. The IR Receiver has a light sensor, which can see these light flashes and then convert those pulses into information. Since an infrared module must ‘see’ the invisible light it only works within the same room. IR light does not go through walls.

Setup:  You will need a BrainPad Pulse or BrainPad Tick and then the BrainClip Kit containing the BrainPad IR Receiver, and the IR remote control.

Connect the BrainPad as shown in the diagram.

Each time the button on the remote control is pressed a new number is sent to the IR receiver, which the BrainPad uses in the code the user creates. In our code example, the BrainPad buzzer will make a sound and display the ‘Return Code’ of the button pressed as long as the number received isn’t ‘100’, which means nothing was pressed.

var speaker = Sound(Buzzer, 0.2, 80);
var ir = Infrared(P8);

while(true){
    var i = In(ir);
    if(i !=100){
        Out(speaker, 1000);
        Print(i);
    }
    Wait(0.5);
}
speaker = Sound(Buzzer, 0.2, 80)
ir = Infrared(P8);

while True:
    i = In(ir)
    if i != 100:
        Out(speaker, 1000)
        Print(i)
    Wait(0.5)

BrainStorm

What other technologies use IR? Can you think of any ways to program the remote to do different things?