Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Muhammad_Munir
Published © GPL3+

Remote Control for Home Appliances

How to connect RF Remote Control for Home Appliances.

IntermediateFull instructions provided1 hour97
Remote Control for Home Appliances

Things used in this project

Hardware components

Arduino Nano
×1
Relay module
×1
RF433mhz Remote Receiver
×1
Jumper wires
×1
Bread Board
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Diagram

Code

Code

Arduino
#define r1 A0
int relay1 = LOW;
#define r2 A1
int relay2 = LOW;
#define r3 A2
int relay3 = LOW;
#define r4 A3
int relay4 = LOW;

int Button1 = 9;
int Button2 = 10;
int Button3 = 11;
int Button4 = 12;

void setup()
{
  pinMode(r1, OUTPUT);
  pinMode(r2, OUTPUT);
  pinMode(r3, OUTPUT);
  pinMode(r4, OUTPUT);

  pinMode(Button1, INPUT);
  pinMode(Button2, INPUT);
  pinMode(Button3, INPUT);
  pinMode(Button4, INPUT);

  digitalWrite(r1, HIGH);
  digitalWrite(r2, HIGH);
  digitalWrite(r3, HIGH);
  digitalWrite(r4, HIGH);

}
void loop()
{

  if (digitalRead(Button1) == HIGH)
  {
    relay1 = ~ relay1;
    digitalWrite(r1, relay1);
    delay(250);
  }
  if (digitalRead(Button2) == HIGH)
  {
    relay2 = ~ relay2;
    digitalWrite(r2, relay2);
    delay(250);
  }
  if (digitalRead(Button3) == HIGH)
  {
    relay3 = ~ relay3;
    digitalWrite(r3, relay3);
    delay(250);
  }

  if (digitalRead(Button4) == HIGH)
  {
    relay4 = ~ relay4;
    digitalWrite(r4, relay4);
    delay(250);
  }


}

Credits

Muhammad_Munir

Muhammad_Munir

77 projects • 50 followers
I am Arduino programmer, also expertise in ESP32 and 8266 wifi modules.

Comments