Read the Remot Control Using IR Sensor

by MrSottong in Circuits > Arduino

1332 Views, 1 Favorites, 0 Comments

Read the Remot Control Using IR Sensor

IMG_7193.JPG

Hello, all

In the previous article I wrote about how to use the "IR Obstacle Avoidance Sensor".

And in this article I will write another function of this IR sensore.

IR Obstacle Avoid Sensor has 2 main parts, namely IR emitter and IR Receiver. And in this article I will only enable the IR Receiver.

I will use it to read data sent by Remote control.

Require Components

IMG_7176.JPG
IMG_6882.JPG
IMG_6885.JPG
IMG_6886.JPG
IMG_7197.JPG

Required components:

Required library:

  • IRremote

Read this article to find out how to add libraries to Arduino "Add Library"

Connect the IR Sensore to Arduino

wiring.png

IR Sensore to Arduino

VCC ==> +5V

GND ==> GND

OUT ==> D2

Programming

Sketch.png

Before you begin sketching, make sure the "IRremote" Library is installed. So that no errors occur when you try the Sketch that I gave.

Below is a sketch that you can use:

#include

int RECV_PIN = 2; IRrecv irrecv(RECV_PIN); decode_results results;

void setup() { Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver }

void loop() { if (irrecv.decode(&results)) { Serial.println(results.value); irrecv.resume(); // Receive the next value } delay(100); }

If you need the file, you can download it below:

Downloads

Result

Read Remote Control Using IR Sensore
A.png

Point the remote control towards the IR receiver. Then press a few buttons.

Serial monitor will display data from the remote button that is pressed.

The data we get from this experiment can be used for other cool things. For example, controlling the LED with the remote, turning on the fan, etc.

thank you for reading, goodbye in the next article