Header Ads

Header ADS

8CH IR Remote Controller With I2C EEPROM Using Arduino

Infrared (IR) Receiver

Here's the pinout for almost every 3-pin IR Receiver:
ir-receiver
There are many different manufacturers of IR Receivers and some have different pinouts:


IR-Receivers-900

Note: The following library must be installed in your Arduino installation for this to work! CLICK HERE - IR REMOTE CONTROL: ARDUINO LIBRARY

Unzip folder into Libraries. RENAME folder IRremote.

Ardunio Pindetails:

ATMEGA328-900
Features:
  1. On/Off Using Remote control
  2. Store the On/Off Status to EEPROM
  3. On/Off Status Recall at startup
  4. error free program
  5. Low cost
  6. etc....

PCB Layout:
Untitled

Note: In the program don't forget to change your remote code to work other wise wont work, In this program i am using samsung tv remote. if you want to use without change remote you can use samsung tv remote controller. For PCB etching Click here to download the PDF file. For Program code Click here

Actual board




Bill of Material:
1. Atmega 328 - 1Nos
2. Eeprom 24C02 (smd) - 1Nos
3. ULN2803 - 1Nos
4. Tsop 1738 - 1Nos
5. 12V Pcb relay - 8Nos
6. L7805 - 1Nos
7. Diode 1N4007 - 13Nos
8. Ceramic cap 104 - 13Nos
9. Diode 1N4048  - 1Nos
10. Resistor 10K - 2Nos
11. Resistor 200 - 1Nos
12. SMD Resistor 10K - 2Nos
13. SMD Resistor 330 - 1Nos
14. LED - 1Nos
15. Capacitor 1000Mfd - 2Nos
16. Capacitor 200Mfd - 1Nos
17. Capacitor 4.7Mfd - 1Nos
18. 3pin terminal block connector - 9Nos
  

/*8 channel IR Remote Controller*/
#include "IRremote.h"
#include 

extEEPROM eep(kbits_4, 1, 16,0x50);   //I2C EEprom Initialization
int receiver = 11; // IR Pin Connected to arduino pin no 11
/* Variable Declaration for Store incoming Values */
int on1;
int on2;
int on3;
int on4;
int on5;
int on6;
int on7;
int on8;

int Relay1 =8;
int Relay2 =7;
int Relay3 =3;
int Relay4 =4;
int Relay5 =20;
int Relay6 =21;
int Relay7 =5;
int Relay8 =6;

IRrecv irrecv(receiver);
decode_results results;
void setup() {
// put your setup code here, to run once:

pinMode(Relay1, OUTPUT);
pinMode(Relay2, OUTPUT);
pinMode(Relay3, OUTPUT);
pinMode(Relay4, OUTPUT);
pinMode(Relay5, OUTPUT);
pinMode(Relay6, OUTPUT);
pinMode(Relay7, OUTPUT);
pinMode(Relay8, OUTPUT);

irrecv.enableIRIn();

delay(100);

eep.begin(twiClock400kHz);
on1 = eep.read(1);
digitalWrite(Relay1, on1 ? HIGH : LOW);
on2 = eep.read(2);
digitalWrite(Relay2, on2 ? HIGH : LOW);
on3 = eep.read(3);
digitalWrite(Relay3, on3 ? HIGH : LOW);
on4 = eep.read(4);
digitalWrite(Relay4, on4 ? HIGH : LOW);
on5 = eep.read(5);
digitalWrite(Relay5, on5 ? HIGH : LOW);
on6 = eep.read(6);
digitalWrite(Relay6, on6 ? HIGH : LOW);
on7 = eep.read(7);
digitalWrite(Relay7, on7 ? HIGH : LOW);
on8 = eep.read(8);
digitalWrite(Relay8, on8 ? HIGH : LOW);
delay(100);
}

void loop() {
// put your main code here, to run repeatedly:

if (irrecv.decode(&results))
{
translateIR();
irrecv.resume();
}
}
void translateIR(){

switch(results.value){

case 0xE0E021DF:
on1 = !on1;
digitalWrite(Relay1, on1 ? HIGH : LOW);
eep.write(1, on1);
delay(100);
break;

case 0xE0E7A05F:
on2 = !on2;
digitalWrite(Relay2, on2 ? HIGH : LOW);
eep.write(2, on2);
delay(100);
break;

case 0xE0E9609F:
on3 = !on3;
digitalWrite(Relay3, on3 ? HIGH : LOW);
eep.write(3, on3);
delay(100);
break;

case 0xE0E070EF:
on4 = !on4;
digitalWrite(Relay4, on4 ? HIGH : LOW);
eep.write(4, on4);
delay(100);
break;

case 0xE0E0506F:
on5 = !on5;
digitalWrite(Relay5, on5 ? HIGH : LOW);
eep.write(5, on5);
delay(100);
break;

case 0xE06050AF:
on6 = !on6;
digitalWrite(Relay6, on6 ? HIGH : LOW);
eep.write(6, on6);
delay(100);
break;

case 0xE0E130CF:
on7 = !on7;
digitalWrite(Relay7, on7 ? HIGH : LOW);
eep.write(7, on7);
delay(100);
break;

case 0xE0E6B04F:
on8 = !on8;
digitalWrite(Relay8, on8 ? HIGH : LOW);
eep.write(8, on8);
delay(100);
break;

case 0xE0E040BF:
on1 = 0;
on2 = 0;
on3 = 0;
on4 = 0;
on5 = 0;
on6 = 0;
on7 = 0;
on8 = 0;
digitalWrite(Relay1, LOW);
eep.write(1, on1);
digitalWrite(Relay2, LOW);
eep.write(2, on2);
digitalWrite(Relay3, LOW);
eep.write(3, on3);
digitalWrite(Relay4, LOW);
eep.write(4, on4);
digitalWrite(Relay5, LOW);
eep.write(5, on5);
digitalWrite(Relay6, LOW);
eep.write(6, on6);
digitalWrite(Relay7, LOW);
eep.write(7, on7);
digitalWrite(Relay8, LOW);
eep.write(8, on8);
delay(100);
break;

default:
break;
}
delay (100);
}

No comments

Powered by Blogger.