Reading IR with an Arduino

It’s really simple! We’ll use the following library from Rafi Khan:

Then we need a microcontroller like an Arduino UNO and an IR receiver module.
I’m using the KY-022 IR receiver module from AZdelievery. You can get it here.

Also wiring is not a big deal:

ir receiver wiring with an Arduino

The sketch is really simple:

#include <Arduino.h>
#include <IRremote.h>

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

void setup(){

void loop(){
  if (irrecv.decode(&results)){
        Serial.println(results.value, HEX);

Voila… ready any ir remote!


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *