Start here, Make a project!
This blog shares various useful Projects made by Kuman and Kuman's specially invite writers. If you like, welcome to contribute to us, and get paid.
By Kumantech | 05 July 2017 | 462 Comments

Arduino Infrared Remote Control Experiment

An infrared-receiver is a component which receives infrared signals and can independently receive infrared ray and output signals compatible with TTL level. It's similar to a normal plastic-packaged transistor in size and suitable for all kinds of infrared remote control and infrared transmission.
 
Experiment 1
Components needed:
1 * KUMAN Uno board
1 * USB data cable
1 * Infrared-receiver
1 * Remote controller
1 * 3-Pin anti-reverse cable
 
Experimental Steps:
Step 1: Build the circuit


Note: Here you need to add a library. Refer to the description in LIBRARY
Step 2: Compile the code
Step 3: Upload the sketch to the KUMAN Uno board
Now, press the Power key of a remote control, and both the LED attached and that connected to pin 13 on the KUMAN Uno board will light flashing. Then, the code values for the corresponding key are printed in the serial port monitor in the arduino ide
 
Program code:
/*
date:2017.6.27
IDE versions:1.7.7
Function: get the code value of each key of the remote control
*/
 
#include
 

int LED=13;
int RECV_PIN = 11; // Infrared receiving head is connected to Arduino 11 pin
 
IRrecv irrecv(RECV_PIN);
 
decode_results results; // Objects used to store encoding results
 
void setup()
{
Serial.begin(9600); // Initialize serial port communication
irrecv.enableIRIn(); // Initial infrared decoding
pinMode(LED,OUTPUT);
}
 
void loop()
{
if (irrecv.decode(&results))
{
digitalWrite(LED,HIGH);
delay(100);
digitalWrite(LED,LOW);
Serial.println(results.value, HEX);
irrecv.resume(); // Accept the next encoding
}
}


 1、Infrared receiving head introduction
What is the infrared receiver head?
From the infrared remote control signal is a series of binary pulse code. In order to make it from other infrared signal interference in wireless transmission process, usually first its modulation on the specific carrier frequency, and then by the infrared emitting diodes emitted, and the infrared receiving device to filtering the clutter, they receive the specific frequency signal and restore it to the binary pulse code, also is demodulation.

Working principle
The built-in receiver will transmit the infrared emission tube light signal into a weak signal, this signal through the IC internal amplifier amplification, and then through the automatic gain control, band-pass filtering, demodulation, waveform shaping after the original encoding to restore the original signal output by the receiver signal output pin input to the electrical appliances on the encoding recognition circuit.

Pin and connection of infrared receiving head

The infrared receiving head has three pins as follows:
When using the VOUT to the analog port, GND received the experimental board GND, +5v. received the VCC on the experimental board
 
Experiment 2
Components
1 * KUMAN Uno board
1 * USB data cable
1 * Infrared-receiver
1 * Remote controller
1 * LCD1602
1 * LED
1 * 9-Pin anti-reverse cable
Line connection diagram:



Program code:
/*
Date:2017.6.27
IDE version:1.7.7
Function:LCD displays coded value from remote control
*/
 
#include   
#include
#include
 

int LED=7;
decode_results results; // Use for saving object of the encoding results
int RECV_PIN = 11; // Integrated Infrared receiver connects to Aduino 11# pin
 
IRrecv irrecv(RECV_PIN);
LiquidCrystal_I2C lcd(0x3F,16,2);
 
void setup()
{
    //Serial.begin(9600); // Initialize serial port communication
    irrecv.enableIRIn(); // Initialize infrared decoding
    lcd.init();                 
    lcd.backlight();
    pinMode(LED,OUTPUT);
}
 
void loop()
{
    lcd.setCursor(0,0);               
    lcd.print("IRremote test");  
    lcd.setCursor(0,1); 
    lcd.print("code:");
    if (irrecv.decode(&results))
    {
         digitalWrite(LED,HIGH);
         delay(100);
         digitalWrite(LED,LOW);
         lcd.setCursor(5,1);
         lcd.print(results.value, HEX);
         irrecv.resume(); // Receive next coding
    }
}

 

Recently Reviews

Read More

Leave a Reply

Your email address will not be published.Required fields are marked. *
Name
E-mail
Content
Verification code
POPULAR BLOG