Things used in this project

Hardware components:
A000066 iso both
Arduino UNO & Genuino UNO
×1
181 02
Adafruit Standard LCD - 16x2 White on Blue
×1
SPDT 5 V Relay
I am using two of them; But you can you up to 8!
×2
11026 02
Jumper wires (generic)
×1
IR receiver (generic)
×1
IR Remote
×1
Bourns 3362p 1 103lf image 160px
Single Turn Potentiometer- 10k ohms
×1
Mfr 25fbf52 221r sml
Resistor 221 ohm
×1
Software apps and online services:
Ide web
Arduino IDE

Schematics

Schematics for the project
Home automation schematics bb xwjlj421ng
Simulator on 123 Circuits

Code

CodeC/C++
/*******************************************************************************     Program can be used to find the IR codes of different IR remotes so that        they     
    can be used for making further developments in the IR Remote control based       
    projects.
    Copyright (C) 2017  Techduino
    
    Please use 5V SPDT relay for absolute compatibility.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or any   
    latervversion.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses.
*******************************************************************************/

#include <IRremote.h>      //including infrared remote header file
#include <LiquidCrystal.h>    //including LCD header file

#define code1  16582903   // code received from button 1
#define code2  16615543   // code received from button 2
#define code3  16580863   // code received from "power button"

LiquidCrystal lcd(12,10,7,6,5,4);

int RECV_PIN = 11;        // the pin where you connect the output pin of IR sensor 
IRrecv irrecv(RECV_PIN);
decode_results results;

int app1 = 3;         //fan pin
int app2 = 2;         //bulb pin
int status[] = {0,0};
/* the initial state of appliances is OFF (zero) 
the first zero must remain zero but you can 
change the others to 1's if you want a certain
appliance to be ON when the board is powered;
you can increse the elements in the array to add
more appliances.*/
 
void setup()
{
  Serial.begin(9600);
  lcd.begin(16,2);          // Start the LCD
  irrecv.enableIRIn();        // Start the IR receiver
  
  pinMode(app1, OUTPUT);
  pinMode(app2, OUTPUT);
  
  lcd.setCursor(0,0);     
  lcd.print("Made by Techduino");   // Made by Techduino
  delay(1500);
  lcd.clear();
  
  lcd.setCursor(3,0);
  lcd.print("Arduino IR");      //Arduino IR Switch Board
  lcd.setCursor(2,1);
  lcd.print("Switch Board");
  delay(1500);
  lcd.clear();
  
  lcd.setCursor(0,0);
  lcd.print("(1) Fan : OFF");     //Showing intial status on LCD
  lcd.setCursor(0,1);
  lcd.print("(2) Bulb : OFF");
  
}
 
void loop() 
{
  if (irrecv.decode(&results)) {
    unsigned int value = results.value;
    switch(value) {
      
       case code1:
         if(status[1] == 1) {           // if first app is ON then
            digitalWrite(app1, LOW);      // turn it off when button is pressed
            status[1] = 0;              // and set its state as off
            lcd.setCursor(10,0);      //printing status on LCD
            lcd.print("OFF");
          }
      
        else {                          // else if first app is OFF then
              digitalWrite(app1, HIGH);   // turn it on when the button is pressed
              status[1] = 1;            // and set its state as ON
              lcd.setCursor(10,0);    //printing status on LCD
              lcd.print("ON ");
           }
              break;
      
      
       case code2:
         if(status[2] == 1) {
            digitalWrite(app2, LOW);
            status[2] = 0;
            lcd.setCursor(11,1);      //printing status on LCD
            lcd.print("OFF");
         } 
      
        else {
              digitalWrite(app2, HIGH);
              status[2] = 1;
              lcd.setCursor(11,1);      //printing status on LCD
              lcd.print("ON ");
           }
              break;
              
       case code3:
         if(status[1] == 1 && status[2] == 1) {
            digitalWrite(app1, LOW);      
            status[1] = 0;              
            lcd.setCursor(10,0);      
            lcd.print("OFF");

            digitalWrite(app2, LOW);
            status[2] = 0;
            lcd.setCursor(11,1);      
            lcd.print("OFF");
           }

         else {
               digitalWrite(app1, HIGH);   
               status[1] = 1;            
               lcd.setCursor(10,0);    
               lcd.print("ON ");

               digitalWrite(app2, HIGH);
               status[2] = 1;
               lcd.setCursor(11,1);      
               lcd.print("ON ");
         }
      
    }
    Serial.println(value);      
    irrecv.resume();       // Receive the next value
  }
}

Credits

Final logo rl7ewgj91n
Techduino

Doing B.Tech. in Computer Science and Engineering from SRM University. A tech enthusiast and Arduino lover! 'Techduino' is my pen name.

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Arduinomated Car Parking with Voice Assistance in Smartphone
Intermediate
  • 250
  • 9

Full instructions

Make an assistant which tells you about how much to drive backwards without any collision through your smartphone by Arduino and 1Sheeld.

Raspberry Pi Motion Tracking Gun Turret
Intermediate
  • 56
  • 4

Full instructions

A motion tracking airsoft or nerf gun turret with autonomous and manual operation modes, controlled by a Raspberry Pi.

Reducing Arduino Power Consumption
Intermediate
  • 119
  • 5

Full instructions

One the most important feature of portable electronics should be long battery life. We can reduce the current drawn by several ways.

Arduino Like Function on Kinetis K82 Freedom Stupid Board
Intermediate
  • 19
  • 2

Protip

1000 of K82 Freedom Boards are collecting dust because of the hobbyist unfriendly IDE, pump up the duds with easy Arduino-like functions.

Particle Photon Based Security System with Alerting
Intermediate
  • 1,321
  • 20

Full instructions

Be alerted to any door or window opening and closing in your house on your smart phone.

Sigfox Forest Fire Detector
Intermediate
  • 2,590
  • 16

Full instructions

How to prevent forest from burning? A small Sigfox signal can prevent natural disasters. We will use an Arduino MKRFOX + a flame detector.

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaFree StoreBlog