Turning a light off over the Internet

Because reaching over a few feet to turn off a switch is too much to bear for [Bruce], he connected his desk lamp to the Internet. It’s a pretty cool build that’s the perfect tutorial for connecting just about anything to the internet.

For his build, [Bruce] used an Arduino with a relay attached to an output pin. When the Arduino receives a signal on its serial port, a tiny voltage is applied to the relay, turning on the light.

This could have been done with an Arduino Ethernet, but the PHP script [Bruce] went with is a little more¬†versatile. Whenever someone pulls up this digital light switch web page, they can turn [Bruce]‘s desk lamp on and off.

For an introduction to connecting bare bones projects to the Internet, we’re really liking [Bruce]‘s build. Just try no to go crazy with that link and leave the failure testing to the professionals. You can check out the demo video after the break.

Comments

  1. Neoxy says:

    Have to try this with my setup. Great tuturial. Thanks

  2. Adam says:

    A live cam to see this is actually turning the lamp on and off would be great…aswell as seeing the effect of my rapid switching…the fact the page is named example.php gives me doubts :-( ….

  3. ColinB says:
  4. dopple says:

    I just turned off his light. I feel god-like in my power.

  5. doragasu says:

    I made something similar some time ago, using an OpenWRT powered Fonera and some relays:

    http://kernelhacks.blogspot.com/2012/04/fonera-plugstrip.html

  6. undersampled says:

    It would be nice if the page used ajax, so it wouldn’t keep reloading the page and the stream applet. Also, it would be cool if the switch graphic would switch with the status of the lamp, but that would be a bit more coding I think.
    Also, I love things like this where I can give input to an output somewhere across the world. :D And cheers for surviving the flood.

  7. kukulele says:

    you should put the stream on a different page, so it doesn’t get interrupted by the refresh of the page, when you flip the switch.

  8. Isotope says:

    I put a webcam on a servo turret in my apartment a couple weeks ago. You should look into using jQuery to asynchronously send POSTs to your PHP page. That way you avoid the whole page refreshing. I’m sure you can find some useable examples by googling.

  9. Wuola says:

    Sorry, it was me. Created ON OFF http request loop. Project working fine. Good job.

  10. mur1010 says:

    Now I will try to make contact by flipping the switch with Morse patterns…or send him the Arecibo message…

  11. Neil Cherry says:

    Not to knock this down at all but this has been done many times. There’s Misterhouse, there’s BlueLave (X10 with The Firecracker), there’s a very long list on my web site, … I think you get the point.

    Of course in a few weeks I hope to contribute something to this list of Arduino and something does Home Automation. I just hope to have a bit more than this.

  12. Filipe YaBa Polido says:

    Oh curl… you’re so naughty doing endeless loops and sending on / off GETs.
    Sorry Bruce :) just a 5 minute prank.

  13. Scott says:

    I think he’s regretting it: http://i.imgur.com/xq90Z.png (screenshot)

  14. roboman2444 says:

    could just put the lightswitch graphic with php stuff in an iframe below the stream… that would be the simple way to do it

  15. Tom the Brat says:

    Am I making your crazy turning your lamp on and off?

  16. Eventhorizon says:

    OMG, when I read the title I thought this post was about SOPA and PIPA again. You know? internet killers?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 91,402 other followers