Simple IR Reciver

Simple IR Reciver

A simple IR receiver setup controlling 2 LED by a relay board

  • 1,246 views
  • 0 comments
  • 7 respects

Components and supplies

Necessary tools and machines

Apps and online services

About this project

This Project was inspired to automate my room by installing this into my roof and controlling everything via remote. It is a simple project but very effective in the means that with through a relay board it can control anything in your house.

It works by deciphering IR codes sent by the remote. It then sends an output corresponding with the code received. The output goes to the relay and powers the LED. This can be applied to any electrical device.

Demonstration

Code

Code for IR ReceiverC/C++
It is a custom made code for the IR Receiver made from IR Receive Demo.
/*
* IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
* An IR detector/demodulator must be connected to the input RECV_PIN.
* Version 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* http://arcfn.com
*/
//code added to decode buttons from Duinotech remote
// only slightly modified from Library example
#include <IRremote.h>
#include <IRremote.h>
int RECV_PIN = 9;
IRrecv irrecv(RECV_PIN);
IRsend irsend;
decode_results results;
void setup()
{
 Serial.begin(9600);
 irrecv.enableIRIn(); // Start the receiver
 pinMode(2, OUTPUT); // Set pin to output
 pinMode(4, OUTPUT); // Set pin to output
 Serial.println("Starting"); // Print "Starting"
}
void loop() {
 if (irrecv.decode(&results)) { // If results are decoded
   Serial.println(results.value, HEX); // print result value
   switch(results.value){
   case 0xFF629D: 
   Serial.println("UP"); 
   irsend.sendSony(0xA32AB931, 12);
   break;
   case 0xFF22DD: Serial.println("LEFT"); break;
   case 0xFF02FD: Serial.println("OK"); break;
   case 0xFFC23D: Serial.println("RIGHT"); break;
   case 0xFFA857: Serial.println("DOWN"); break;
   case 0xFF6897: 
   Serial.println("1"); 
   digitalWrite(4, HIGH);
   break;
   case 0xFF9867: 
   Serial.println("2"); 
   digitalWrite(2, HIGH);
   break;
   case 0xFFB04F: Serial.println("3"); break;
   case 0xFF30CF: 
   Serial.println("4"); 
   digitalWrite(4, LOW);
   break;
   case 0xFF18E7: 
   Serial.println("5"); 
   digitalWrite(2, LOW);
   break;
   case 0xFF7A85: Serial.println("6"); break;
   case 0xFF10EF: Serial.println("7"); break;
   case 0xFF38C7: Serial.println("8"); break;
   case 0xFF5AA5: Serial.println("9"); break;
   case 0xFF42BD: Serial.println("*"); break;
   case 0xFF4AB5: Serial.println("0"); break;
   case 0xFF52AD: Serial.println("#"); break;
   break;
   {
delay(3000); //delay for 3 seconds
   }
 }
  irrecv.resume(); // Receive the next value
 }
 delay(100);
}

Schematics

Diagram
A diagram for the IR Receiver, this does not include the rest of the circuitry
Irreceiver xcizghlild

Comments

Similar projects you might like

Simple Voice Recognition

Project showcase by Treebug842

  • 1,580 views
  • 1 comment
  • 13 respects

Simple Programmable Robotic Arm

Project showcase by Ryan Chan

  • 49,020 views
  • 63 comments
  • 145 respects

Arduino: Switching ON/OFF Appliances Using IR Remote

Project showcase by Naman Chauhan

  • 8,526 views
  • 0 comments
  • 117 respects

IR Remote Controlled Home Automation

Project tutorial by suhail jr

  • 10,123 views
  • 5 comments
  • 17 respects
Add projectSign up / Login