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.
[youtube=http://www.youtube.com/watch?v=ULmMASScJvo&w=470]
Have to try this with my setup. Great tuturial. Thanks
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 🙁 ….
I’ll make a stream webcam
Just like Sheldon and the TBBT gang.
I swear they got that from my house! 😉
I just turned off his light. I feel god-like in my power.
I made something similar some time ago, using an OpenWRT powered Fonera and some relays:
http://kernelhacks.blogspot.com/2012/04/fonera-plugstrip.html
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. 😀 And cheers for surviving the flood.
the switch is standing in the right position
but the light is flashing like crazy here
and the webcam stream isn’t that fast (so it doesn’t match the switch’s status)
skype/msn is a lot faster
but when you press the button the light change’s instantly
Be sure to tell us when HaD DDOSs a lamp.
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.
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.
Sorry, it was me. Created ON OFF http request loop. Project working fine. Good job.
Now I will try to make contact by flipping the switch with Morse patterns…or send him the Arecibo message…
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.
Oh curl… you’re so naughty doing endeless loops and sending on / off GETs.
Sorry Bruce 🙂 just a 5 minute prank.
no problem
Hehe! lol
I think he’s regretting it: http://i.imgur.com/xq90Z.png (screenshot)
could just put the lightswitch graphic with php stuff in an iframe below the stream… that would be the simple way to do it
Am I making your crazy turning your lamp on and off?
OMG, when I read the title I thought this post was about SOPA and PIPA again. You know? internet killers?
I miss read it as “Turning the lights off on the internet” like shutting down the internet of some sort.. :/