Project tutorial

Control Home Appliances Through web or mobile © GPL3+

Now Control Home Appliances using Web and Mobile from anywhere.

  • 3,238 views
  • 2 comments
  • 6 respects

Components and supplies

Apps and online services

gadgetProgrammers web api services
Using web services and web portal to on off switch
Processing Direct Exe file
Please run Exe file for windows only for now

About this project

Idea Behind Project

There are lot's of projects which turn on and off your Electric devices using Arduino (with very complex circuit diagrams) but there are no clues how to control Electric devices through Web or Mobile phone(using simple circuits) and if there is any way to do this, its very long and tedious. So someone needs to take a long step, so i decide to take long step first to cut other people efforts. To accomplish this i've created a common web platform by which you can control any of your devices with very simple steps without any programming other than Arduino and working with circuits with relay only. So this was the core Idea behind this great project. It's one of the good examples of DIY projects that can be implemented by anyone easily and it will cost less than $5, because it uses only a 5v Relay and some wire/plugs.

How It Works?

We've created a open and free Web platform by using that you can easily manage your Electrical devices or Automate your Home Appliances very easily.It can be very useful device. Suppose if you are out of the house and you have forgotten to turn On/Off any of the Appliances, there are no worries because you can control it from your mobile phone or desktop by accessing website's page.To use this Project you only need to copy and paste the Arduino code which reads Serial input from processing and controls relay that helps in turning On / Off the appliance . So there might be a question in your mind that how the Relay and Arduino program is working and what to do with processing ? Let's find out answers step by step.

Programming and Circuit

From Arduino Side:

We are using Arduino to read serial inputs from Processing program and Writing it to Serial port to on and off the Relay device or circuit we've made. As you'll see the code below in which we are reading data from serial which is coming from processing and checking with some of our data which if we get "1" then switch on the relay or if its "0" then switch off Relay device.How relay works is our next step.

//Some of the part of actual code
if(Serial.available()>0){ //Reading Serial data
     readSerial = Serial.read(); 
     delay(100); 
     if(readSerial == '1'){ //if its 1 then switch on the relay
       digitalWrite(RELAY1,HIGH); 
     } 
     if(readSerial == '0'){ //If its 0 then switch off the relay
       digitalWrite(RELAY1,LOW);; 
     } 

Working Of Relay: (If already know you can skip)

How to use relay for controlling AC?AC is alternating current 220v (india) which powers the ac lights. Arduino cannot control high volt n amp, but a relay can do this job, which is the sole design of it. so we are using relay as switch to control high power devices.What is NO,NC and COM in relay?

  • COM = Common Connection
  • NC = Normally Closed Connection
  • NO = Normally Open Connection

I have explained NO,NC and COM elaborately below, refer it if you feel it bit confusing.We're going to use NO Normally Open Connection

  • COM - Common connection it is the centre terminal, It is hot as power to the load is connected at this terminal.
  • NO (Normally open) - It acts like a switch,since it is open - there will be no contact between COM and NO, When we trigger the relay module, it connects to COM by the electromagnet inside the relay and supply to the load is provided,which powers up the light.Thus the circuit is closed until we trigger the state to low in relay.
  • NC (Normally closed) - It is always in contact with COM, even when relay is not powered.when we trigger the relay it opens the circuit, so the connection is lost. it behaves just opposite to NO.

From Processing Side:

Here Processing code is the heart of our project which is communicating with both of the applications viz. Web application and Arduino you imagine it as a bridge or postman of old days who collect your mail from mail box and deliver it to given address. Here Processing is calling an API which is created by us at http://www.parikshacrack.com/gadgetProgrammers/homeAutomation/xxxxx

(Site we are using is only demo purpose) by calling this api through processing software we'll get our switch current state which we'll read in processing and send it to Arduino program as earlier discussed and at last Arduino write it to Board.From Web/Mobile Side:To access web we are using gadgetprogrammers platform as given below:

Goto: http://www.parikshacrack.com/gadgetProgrammers/homeAutomation

Go here and switch on and off your device it will be read by your processing code.

Circuits: As shown in Diagram

  • Connect Pin 7 of Arduino to Relay IN1.
  • Connect 5v of Arduino to Vcc of Relay.
  • Connect AC Power one end wire to Common Pin of relay (middle one)
  • Connect Lamp(Bulb) one end pin with NC Pin of Relay
  • Connect one Left extra wire from Lamp and another Left extra wire from AC wire to main AC power supply.

Steps to Run Project

  • Copy and paste Arduino code as given to Arduino editor.
  • Upload the code to Arduino .
  • Download Processing zip and choose ext file according to your OS.
  • Now run exe (For windows) file from zip of processing according to your os.
  • Goto Web

http://www.parikshacrack.com/gadgetProgrammers/homeAutomation

Press button to on and off lights.

Final Words

Hoooray! If everything goes alright you will see your lights work.

Thanks For your time and if you have any question or query please shout in comments.

Custom parts and enclosures

circuitdiagram_tRPxERkCY3.tiff
circuitdiagram_tRPxERkCY3.tiff

Schematics

Pin Diagram
Pin connections with Arduino to Relay
pinconnections_bN2A04yM0t.tiff
Ciruit Diagram of Lamp With Relay
Ciruit diagram of lamp with realy c30mn2nbas

Code

Arduino CodeArduino
Please paste this code in arduino editor
#define RELAY1  7    
char readSerial;                    
void setup()
{
  Serial.begin(9600);
  pinMode(RELAY1, OUTPUT);
}
void loop(){
  char readSerial;
 // delay(1000);
  if(Serial.available()>0){
      readSerial = Serial.read();
      delay(100);
      Serial.println(readSerial);
      if(readSerial == '1'){
        //Serial.println("ASDF");
        digitalWrite(RELAY1,HIGH);
      }
      if(readSerial == '0'){
        digitalWrite(RELAY1,LOW);;
      }
  }
   
}

Comments

Similar projects you might like

Development Board for AtTiny MCU

by Vincenzo G.

  • 188 views
  • 0 comments
  • 6 respects

The Magnetic Field and RGB Tester

Project tutorial by Kutluhan Aktar

  • 432 views
  • 0 comments
  • 6 respects

Version 2.0 Advanced Attendance System (Without Ethernet)

Project tutorial by GadgetProgrammers

  • 3,158 views
  • 5 comments
  • 44 respects

How To Use DS18B20 Water Proof Temperature Sensor

Project showcase by IoTBoys

  • 269 views
  • 0 comments
  • 4 respects

Control LED Using Your Voice Command

by IoTBoys

  • 1,209 views
  • 1 comment
  • 12 respects
Add projectSign up / Login