ALEX LYND Portfolio Blog Support Me
IR-Tester
An IR value grabber with Arduino

Description

Have you ever needed to grab a quick IR value from a remote or test if your IR LED's are working? IR-Tester is a small keychain-sized project I created to test my IR LED's and remote controls. IR-Tester is AVR based, using an Arduino Nano as the processor, reading IR values through an IR reciever module, and outputting the code in binary and hex to an OLED.

What can I do with it?

With IR-Tester, you can test any device using infrared LED's, including TV remotes, or regular IR LED's.

Parts List

Software

I wrote the code in the Arduino IDE, and am using the IRremote library to read the IR values, and Adafruit's GFX and SSD1306 library.

#include <IRremote.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

const int RECV_PIN= 7;  // IR data pin
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup(){
  Serial.begin(9600);
  irrecv.enableIRIn();
  irrecv.blink13(true);
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.clearDisplay();
  display.println("IR Reader by Alex");  // start screen.
  display.println("V 1.1");
  display.display();
  delay(500);
  display.clearDisplay();
  display.display();
}

void loop(){
  if (irrecv.decode(&results)){
        display.setTextSize(1);
        display.setTextColor(WHITE);
        display.setCursor(0,0);
        display.clearDisplay();
        diplay.print("Hex: ");
        display.println(results.value, HEX);  // print IR code in Hex
        display.println();
        display.println("Binary:");
        display.println();
        display.println(results.value, BIN);  // print IR code in Binary
        display.display();
        irrecv.resume();
  }
}

Links

www.000webhost.com