Arduino Web Switch _ Turn Your Kettle on via Internet _ Www.hobbyist.co

download Arduino Web Switch _ Turn Your Kettle on via Internet _ Www.hobbyist.co

of 9

Transcript of Arduino Web Switch _ Turn Your Kettle on via Internet _ Www.hobbyist.co

  • 8/10/2019 Arduino Web Switch _ Turn Your Kettle on via Internet _ Www.hobbyist.co

    1/9

    Arduino Internet Web Switch

    This wonder kit allows you to control any electric appliance from the internet.

    What does that mean ?

    That means you can turn ON/OFF any appliance at your home from your iphone, Android

    the world..As long as you have access to a web browser.

    Woooo..aint that an amazing power to lay your hands on.

    What would I do with a Web Switch ?

    I would do these:

    Boil water for my coffee right from my bed with my Iphone

    Turn on my Home heatpump when I leave to home from Work,

    My home is warm and cozy by the time I arrive :)

    Water my garden when I am on vacation

    Rest I leave to your creative imagination to fill in............

    What does the kit consist of ?

    Arduino UNO

    This is the CPU where the code and the webserver runs

    1.

    Cool kit which gives life to the l ights and makes them dance to the tune of the music..

    no Web Switch : Turn your kettle ON via Internet | www.hobbyist.... http://www.hobbyist.co.nz/?q=web-switc

    9/20/2014Print to PDFwithout this message by purchasing novaPDF (http://www.novapdf.com/)

    http://www.hobbyist..../http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.hobbyist..../
  • 8/10/2019 Arduino Web Switch _ Turn Your Kettle on via Internet _ Www.hobbyist.co

    2/9

    Ethernet shield

    This shield allows the Arduino to talk to any other device connected via Internet.

    The shield has an ethernet port which will be later used to connect the ethernet cable.

    1.

    Sensor Shield

    This shield provides modular plugins to connect loads of things you want to control

    For this example we will interface a Relay module to control power appliances

    1.

    no Web Switch : Turn your kettle ON via Internet | www.hobbyist.... http://www.hobbyist.co.nz/?q=web-switc

    9/20/2014Print to PDFwithout this message by purchasing novaPDF (http://www.novapdf.com/)

    http://www.hobbyist..../http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.hobbyist..../
  • 8/10/2019 Arduino Web Switch _ Turn Your Kettle on via Internet _ Www.hobbyist.co

    3/9

    Relay Module

    This module allows the Arduino to turn ON/OFF power appliances

    Read more about relays here

    1.

    Building the Arduino Web Switch

    Stacking the shields

    Place the Arduino at the bottom as below

    no Web Switch : Turn your kettle ON via Internet | www.hobbyist.... http://www.hobbyist.co.nz/?q=web-switc

    9/20/2014Print to PDFwithout this message by purchasing novaPDF (http://www.novapdf.com/)

    http://www.hobbyist..../http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.hobbyist..../
  • 8/10/2019 Arduino Web Switch _ Turn Your Kettle on via Internet _ Www.hobbyist.co

    4/9

    Plug the Ethernet Shield on top of the Arduino ( this is also called stacking , as we keep

    Arduino )

    Once thats done it would look like this.

    Next step is to stack the height extender pins into the Ethernet shield ( This is necessary

    sensor shield pins on to the Ethernet shield )

    Once the height extender pins are plugged into the Ethernet shield it will look like the pi

    no Web Switch : Turn your kettle ON via Internet | www.hobbyist.... http://www.hobbyist.co.nz/?q=web-switc

    9/20/2014Print to PDFwithout this message by purchasing novaPDF (http://www.novapdf.com/)

    http://www.hobbyist..../http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.hobbyist..../
  • 8/10/2019 Arduino Web Switch _ Turn Your Kettle on via Internet _ Www.hobbyist.co

    5/9

    Stack the Sensor Shield on top of the Ethernet shield, as shown in pic below.

    Wiring the Relay Module

    Use the cable provided and connect it to the relay module as shown below

    no Web Switch : Turn your kettle ON via Internet | www.hobbyist.... http://www.hobbyist.co.nz/?q=web-switc

    9/20/2014Print to PDFwithout this message by purchasing novaPDF (http://www.novapdf.com/)

    http://www.hobbyist..../http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.hobbyist..../
  • 8/10/2019 Arduino Web Switch _ Turn Your Kettle on via Internet _ Www.hobbyist.co

    6/9

    Connect the other end to the Sensor shieldpin number 8, VCC and GND

    TEST: Power up the arduino and you should see the GREEN led on relay module glowing

    and make sure everything is correct.

    Relay testing

    We are about to test if the wiring is good and the relay turns ON and OFF.

    Load this program into the arduino from this link.

    What does this program do?

    This program turn ON the RELAY module for a 3 secs and turns it OFF for another 2 secs

    How do you know if the relay is turning on?

    You hear a click every time the relay operates and you see the RED led glowing every ti

    This test should test if the wiring it good and the arduino is able to control the relay.

    Getting your Internet Web Switch to go.......

    no Web Switch : Turn your kettle ON via Internet | www.hobbyist.... http://www.hobbyist.co.nz/?q=web-switc

    9/20/2014Print to PDFwithout this message by purchasing novaPDF (http://www.novapdf.com/)

    http://www.hobbyist..../http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.hobbyist..../
  • 8/10/2019 Arduino Web Switch _ Turn Your Kettle on via Internet _ Www.hobbyist.co

    7/9

    Now that all the modules are tested, we are almost there..

    The last bit which needs doing is to load the Web Switch code and turn your kettle on!

    Follow the steps below in order

    Download Ethernet shieldlibrary into libraries folder present in Arduino IDE instal

    This step adds the library for getting the Ethernet Shield to work

    Connect a Ethernet cable from the Arduino Ethernet shield to your PC/Laptop

    Load this code (link provided on purchase) onto the Arduino.

    Open up your favorite browser and copy this address onto it:

    http://192.168.1.25

    You will see the webpage shown below on the browser. This page is hosted on your Ardu

    yes that tiny little piece of hardware can host a webpage :)

    Now you can click the button on the page and hear your relay turn ON/OFF,

    You are now able to control the Arduino via the Browser.

    Turning the kettle ON!

    Now we have a working Arduino Web Switch which can be controlled from a browser,

    To control the Kettle you will need to connect the Relay as a switch for the Kettle.

    Disclaimer: any modification work that involves high voltages should be done by a certif

    provided by Hobbyist Ltd "as is" with no warranty of any kind whatsoever. It is your resp

    proper functioning of your devices and applicances. Should you have any concern about

    professional for advice.

    The wiring is as below:

    no Web Switch : Turn your kettle ON via Internet | www.hobbyist.... http://www.hobbyist.co.nz/?q=web-switc

    9/20/2014Print to PDFwithout this message by purchasing novaPDF (http://www.novapdf.com/)

    http://192.168.1.25/http://www.hobbyist..../http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.hobbyist..../http://192.168.1.25/
  • 8/10/2019 Arduino Web Switch _ Turn Your Kettle on via Internet _ Www.hobbyist.co

    8/9

    VIDEO of the completed kit in action

    Get a WebSwitch for yourself?

    no Web Switch : Turn your kettle ON via Internet | www.hobbyist.... http://www.hobbyist.co.nz/?q=web-switc

    9/20/2014Print to PDFwithout this message by purchasing novaPDF (http://www.novapdf.com/)

    http://www.hobbyist..../http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.novapdf.com/http://www.hobbyist.co.nz/?q=web-switch-tutorialhttp://www.hobbyist..../
  • 8/10/2019 Arduino Web Switch _ Turn Your Kettle on via Internet _ Www.hobbyist.co

    9/9

    #def i ne RELAY_PI N 8 / / Some damn probl em when i use 13, swi t ched t o 8 whi ch works!

    voi d set up( ) {

    / * Set up Ser i al */ Ser i al . begi n( 9600) ; pi nMode( RELAY_PI N, OUTPUT) ;

    di gi t al Wr i t e( RELAY_PI N, 0) ; / / swi t ch on LED del ay( 10) ;

    }

    voi d l oop( ) { i f ( di gi t al Read( RELAY_PI N) == LOW) { di gi t al Wr i t e( RELAY_PI N, 1) ; del ay( 3000) ; } el se { di gi t al Wr i t e( RELAY_PI N, 0) ; del ay( 2000) ;

    }}

    http://www.hobbyist.co.nz/sites/default/files/webswitch/code/Tes

    http://www.hobbyist.co.nz/sites/default/files/webswitch/code/Test_Rela...http://www.hobbyist.co.nz/sites/default/files/webswitch/code/Test_Rela...