License

Public Domain

Recommend Projects

ARDUINO NANO HOME AUTOMATION SYSTEM

1 year ago 672
  • Description
  • Documents
  • BOM
  • Attachments
  • Members
  • Comments

Description

THIS IS A SIMPLE ARDUINO IR HOME AUTOMATION SYSTEM IN WHICH IT CAN ACTIVATE OR DEACTIVATE 2 RELAYS INDUVIDUALLY OR SEPERATELY.

THE IR REMOTE USED FOR THIS PROJECT HAS A RANGE OF 8m BUT THE NAME AND DETAILS ARE NOT SPECIFIED. SO I FOUND A PICTURE OF IT ON THE INTERNET SO U CAN SEE WHICH ONE IT IS IR REMOTE FOR ARDUINO

button 0 = ALL RELAYS ARE OFF. button 1 = RELAY1 IS ON/OFF. button 2 = RELAY2 IS ON/OFF. button CH/OK = RELAY1 AND RELAY2 ARE ON.

WARNING DO NOT POWER THE DEVICE WITH THE POWER SUPPLY PORT WHILE THE ARDUINO IS SEPERATELY ON WITH A USB CABLE.

FOR AN EXAMPLE, THIS PROJECT CAN BE USED TO CONNECT A DOMESTIC ELECTRONIC LIGHT OR FAN. I HAVE TRIED IT :)

the code is below at the comment section. i tried to put the code here but it didnt come right so i sent it as a comment

and the library name is IRremote.h

Documents

Sheet_1

NEW_PCB

BOM

ID Name Designator Footprint Quantity
1 5ffba375a47748b7bdd3088d49f8102a U1 ARDUINO NANO V3 1
2 2191314250ed43a796b57d45825575c3 R1,R2 AXIAL-0.3 2
3 5aebc7e3f77345b98376c4da09a72092 RELAY1,RELAY2 RELAY-SL-SRD 2
4 37ec56f422ebe99d464b5e64e2029adc P1,P2 WJ2EDGVC-5.08-3P 2
5 d53dd3a70a82db255b59b7e17aa3ff18 P3 WJ2EDGVC-5.08-2P 1
6 0b6ea66f1a77ef3069b26dadb3d73791 P4 HDR-1X2/2.54 1
7 21f8f80a3f7c3c2b00b33f71a31ff6ef P5 HDR-3X1/2.54 1
8 5197eb2f389c4639963a16ab68c782f8 Q1,Q2 TO-92(TO-92-3) 2
9 514f9d8bda96e38b6ca325286b5248c8 U2 TO-220(TO-220-3) 1
10 b518ee25eba44eaabaa940db475b65a6 SW1 DSWB01LHGET 1
11 2191314250ed43a796b57d45825575c3 R3 AXIAL-0.3 1
12 e08526e65b5e407b8e637a308d00f78f LED1 LED-3MM/2.54 1

Attachments

None
Success
The owner does not allow comments in this project now

Comments (2)

Daniel Avery Reply

 this  is the new code for this project,




#include

int RECV_PIN = 10;
int RELAY_PIN = 6;
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(RELAY_PIN2,OUTPUT);
  pinMode(13, OUTPUT);
    Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

int on = 0;
unsigned long last = millis();

#define BUTTON_1 0xFF30CF
#define BUTTON_2 0xFF18E7
#define BUTTON_3 0xFF7A85
#define BUTTON_0 0xFF6897
#define BUTTON_OK 0xFF629D

void loop() {
  if (irrecv.decode(&results)) {
    if (results.value == BUTTON_2)
    {

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

    if (results.value == BUTTON_1)
    {

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

     if (results.value == BUTTON_OK)
    {

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

    irrecv.resume(); // Receive the next value
  }
}
Daniel Avery Reply

the library name is   \

goToTop
你现在访问的是EasyEDA海外版,使用建立访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow
We use cookies to offer you a better experience. Detailed information on the use of cookies on this website is provided in our Privacy Policy. By using this site, you consent to the use of our cookies.