0% found this document useful (0 votes)
10 views

Lesson 15 IR Receiver Module

This lesson teaches how to connect an IR Receiver Module to an Arduino UNO R3 for wireless control. It includes required hardware, code for decoding IR signals, and step-by-step instructions for building the circuit and uploading the code. The document also explains the principles of infrared communication and provides a sample code to interpret remote control signals.

Uploaded by

Euronymous
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Lesson 15 IR Receiver Module

This lesson teaches how to connect an IR Receiver Module to an Arduino UNO R3 for wireless control. It includes required hardware, code for decoding IR signals, and step-by-step instructions for building the circuit and uploading the code. The document also explains the principles of infrared communication and provides a sample code to interpret remote control signals.

Uploaded by

Euronymous
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Lesson 15 IR Receiver Module

Introduction

In this lesson,you will learn how to connecting the IR Receiver to the UNO R3
to have wireless control of your project.

Hardware Required

 1 * RexQualis UNO R3

 1 * IR receiver module

 1 * IR remote

 3 * F-M Jumper Wires

Principle

IR Receiver Module

Infrared (IR) communication is widely used and easy to implement wireless


technology that has many useful applications. The most prominent examples
in day to day life are TV/video remote controls, motion sensors, and infrared
thermometers.

There are plenty of interesting Arduino projects that use IR communication too.
With a simple IR transmitter and receiver, you can make remote-controlled
robots, distance sensors, heart rate monitors, DSLR camera remote controls,
TV remote controls, and lots more

Infrared radiation is a form of light similar to the light we see all around us. The
only difference between IR light and visible light is the frequency and
wavelength. Infrared radiation lies outside the range of visible light, so humans
can’t see it:

Code interpretation

#include "IRremote.h"

int receiver = 11; // Signal Pin of IR receiver to Arduino Digital Pin


11

/*-----( Declare objects )-----*/

IRrecv irrecv(receiver); // create instance of 'irrecv'

decode_results results; // create instance of 'decode_results'

/*-----( Function )-----*/

void translateIR() // takes action based on IR code received

// describing Remote IR codes

switch(results.value)

{
case 0xFFA25D: Serial.println("POWER"); break;

case 0xFFE21D: Serial.println("VOL STOP"); break;

case 0xFF629D: Serial.println("MODE"); break;

case 0xFF22DD: Serial.println("PAUSE"); break;

case 0xFF02FD: Serial.println("FAST BACK"); break;

case 0xFFC23D: Serial.println("FAST FORWARD"); break;

case 0xFFE01F: Serial.println("EQ"); break;

case 0xFFA857: Serial.println("VOL-"); break;

case 0xFF906F: Serial.println("VOL+"); break;

case 0xFF9867: Serial.println("RETURN"); break;

case 0xFFB04F: Serial.println("USB SCAN"); break;

case 0xFF6897: Serial.println("0"); break;

case 0xFF30CF: Serial.println("1"); break;

case 0xFF18E7: Serial.println("2"); break;

case 0xFF7A85: Serial.println("3"); break;

case 0xFF10EF: Serial.println("4"); break;

case 0xFF38C7: Serial.println("5"); break;

case 0xFF5AA5: Serial.println("6"); break;

case 0xFF42BD: Serial.println("7"); break;

case 0xFF4AB5: Serial.println("8"); break;

case 0xFF52AD: Serial.println("9"); break;


case 0xFFFFFFFF: Serial.println(" REPEAT");break;

default:

Serial.println(" other button ");

}// End Case

delay(500); // Do not get immediate repeat

} //END translateIR

void setup() /*----( SETUP: RUNS ONCE )----*/

Serial.begin(9600);

Serial.println("IR Receiver Button Decode");

irrecv.enableIRIn(); // Start the receiver

}/*--(end setup )---*/

void loop() /*----( LOOP: RUNS CONSTANTLY )----*/

if (irrecv.decode(&results)) // have we received an IR signal?

translateIR();

irrecv.resume(); // receive the next value

}/* --(end main loop )-- */


Experimental Procedures

Step 1:Build the circuit

There are 3 connections to the IR Receiver.

The connections are: Signal, Voltage and Ground.

The “-” is the Ground, “S” is Signal, and “+” pin is Voltage 5V.

Connect the 5V and ground of the Arduino to the 5v and ground of the IR
receiver and the pin 11 of the Arduino to the signal pin of IR receiver.

Schematic Diagram
Step 2: Open the code:IR_Receiver_Module_Code
Step 3: Attach Arduino UNO R3 board to your computer via
USB cable and check that the 'Board Type' and 'Serial Port' are
set correctly.

Step 4: Load the Library:IRremote


Step 5:Upload the code to the RexQualis UNO R3 board.

Step 6:Open the Serial Monitor then you can see the data as
below:

(How to use the Serial Monitor is introduced in details in


Lesson 0 Preface)
Then, the remote control is aligned with the IR receiver and
the corresponding numbers and symbols are displayed on the
monitor
If it isn’t working, make sure you have assembled the circuit
correctly, verified and uploaded the code to your board.For
how to upload the code and install the library, check Lesson 0
Preface.

You might also like