# ARDUINO IR REMOTE CONTROLLED RELAY

1,438

7

this circuit works with both AC and DC current. Once the circuit gets an IR signal from a remote, ( you need to register the remote numbers in the code.) the relay will turn ON and if u again give that same signal, it will turn off. the code is at the bottom of this project.

### Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

## Step 1: THESE ARE THE COMPONENTS U NEED,

• arduino pro mini
• 5v relay
• BC547 transistor
• 1K RESISTOR
• 220ohm resistor
• 10k resistor
• 100ohm resistor
• LED
• 5v- 9v power supply.

## Step 2: CIRCUIT DIAGRAM

in this case, i have made a PCB of my own and it works both with AC and DC current.The PCB has a rectifier bridge and a few capacitors to convert the AC current to DC. the link for the pcb that i made will be in the description. if you are going to purchase the PCB, you need to get more components to help convert the AC to DC. the first image of this is only DC current ,the last one though shows the full circuit diagram with the AC to DC conversion.

the link to purchase the PCB will be at the end of this project :)

## Step 3: THE CODE

• u need to download the arduino IR library to do this project.

IR REMOTE LIBRARY

the code will be here below in the description. in this case, u need to put the numbers of your remote code.

example : got to ir remote examples> ir dumpinfo > upload the code.

once uve uploaded the dump info code, simply get the results from ur remote and pu it in this code.

```#include <IRremote.h>int RECV_PIN = 3;
int RELAY_PIN2 = 8;IRrecv irrecv(RECV_PIN);
decode_results results;void dump(decode_results *results) {
int count = results->rawlen;

}void setup()
{
pinMode(RELAY_PIN, OUTPUT);
pinMode(13, OUTPUT);
digitalWrite(13,LOW);
Serial.begin(9600);
}int on = 0;
unsigned long last = millis();#define BUTTON_1 0xFF30CFvoid loop() {
if (irrecv.decode(&results)) {

if (results.value == BUTTON_1)
{

on = !on;
digitalWrite(RELAY_PIN2, on ? HIGH : LOW);
digitalWrite(13, on ? HIGH : LOW);
dump(&results);
}

else{
digitalWrite(13,LOW);
}
}```

## Step 4: TO ORDER THE PCB

if u purchase this PCB, I recommend u to use "PCBWay". the order link is below. and pls read the discription in the page :)

thank u.

hope u enjoyed this project. and if there are any questions, pls leave them in the comments section.

Participated in the
Arduino Contest 2019

## Recommendations

• ### Internet of Things Class

21,623 Enrolled