License

Public Domain

Recommend Projects

IR HOME AUTOMATION SYSTEM WITH RELAY

10 months ago 237
  • Description
  • Documents
  • BOM
  • Attachments
  • Members
  • Comments

Description

u can use this sheild for an arduino nano. all u need to do is get the components and solder them.then upload the code. and when u pres a button u can switch ON_OFF the relay.just download the ir remote lib and go to examples>ir remote> ir Relay. u can further upgrade it how much ever u want! pls like.

ir remote lib



```/*
 * 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
 */

#include 

int RECV_PIN = 11;
int RELAY_PIN = 6;

IRrecv irrecv(RECV_PIN);
decode_results results;

// Dumps out the decode_results structure.
// Call this after IRrecv::decode()
// void * to work around compiler issue
//void dump(void *v) {
//  decode_results *results = (decode_results *)v
void dump(decode_results *results) {
  int count = results->rawlen;

}

void setup()
{

  pinMode(RELAY_PIN, 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_1)
    {

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

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

  }

Documents

Sheet_1

ARDUINO NANO SHEILD FOR IR HOME AUTOMATION SYSTEM

BOM

None

Attachments

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

Comments (0)

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.