Internet-Enabling a Lamp with the Raspberry Pi

lampcontrol

[Jack] sent in his writeup for internet enabling a home lamp. While we will certainly have some comments saying this is too simple, it does a great job of breaking things down to the basics. For those that aren’t confident in their electronic skills, this is an easy hack to a commercial device that greatly expands it’s capabilities. [Jack] started with a cheap wireless outlet controller. By opening the remote and wiring each switch to a 2N222A transistor, you can very easily control the remote from the GPIO pins on the Raspberry Pi. In [Jack’s] case, he set up a web page using Flask that allows quick on/off control.

Of course, this method can be used in any number of instances where you have a wireless controller, from small lamps to garage doors. Given it’s simplicity, anyone can do it with even basic skills. If you’re a beginner who’s been itching to do some home automation, follow [Jack’s] writeup and check an item off your todo list!

30 thoughts on “Internet-Enabling a Lamp with the Raspberry Pi

  1. It’s probably easier and cheaper to use Arduino with cheapo 433MHz transmitter, but if this is supposed to be just one of the many things this RasPi will be used for, why not :)

  2. Why the fuck?

    Seriously, I’m getting so tired of seeing those “let’s patch to the buttons” type of things. Yes they are hacks, but there are at least 20 of them around the Internet, probably 10 or more on Hackaday.

    It’s a hack indeed, but it’s honestly a stupid hack. Google for around 15 seconds and you will find that you can control the transmitter directly – Either by buying one, or just patch a single cable directly into it.

    There is a port of the popular Arduino RC-Switch library:

    https://github.com/r10r/rcswitch-pi

    1. I’m guessing why he’s hacking the transmitter and not the receiver but it makes sense not to muck around in a box where mains voltage is present, especially for people with basic electronic skills… the audience that this hack is meant for.

    2. Calm down, buddy. Out of the thousands of posts on HackADay, some of them are going to be simple. It’s seriously not a big deal. What’s your problem?

    3. Just bridging the switches saves the bother of looking up, or, if the info isn’t available, reverse-engineering the standard for yourself. And this way you don’t have to buy a transmitter, it’s already in the remote! It should also work with any other transmitter he might buy later.

      This way works fine and it’s probably the easiest. He’s got a simple wireless system to control his house from a Ras Pi. It could be better but it’s still pretty good!

    4. I’m usually with you on these, but I’d give the guy a break because:
      1 – It’s quite a simple to do solution
      2 – He’s done it quite neatly
      3 – No arduinos
      4 – Pi is similar price & far easier to internet & more re-usable for other cooler stuff
      5 – Everyone’s gotta start somewhere
      6 – HaD at least showed a trace of awareness that this one is a bit WTF, a departure from their usual blind acceptance of batshit insane / dangerous / pants-on-head-retarded crap “because hack”.

  3. Silly implementation, 433MHz modules are trivial to drive from the RPi even without soldering – as poster above says rcswitch-pi. Did it myself, works nicely.

  4. Using a RasPi for this is way overkill. You could use something cheaper, like a multitide of Arduino clones.
    Next week, “Controlling a lamp using an IBM Mainframe zEC12 and Cisco 6500 switch.”

    1. The alternatives aren’t cheaper if you already have the Pi.

      Does anyone else have enormous trouble coming up with projects to use to learn stuff? Like, when I want to learn a programming language I usually end up saying “I know, I’ll make a….uh…fuck” then go do something else.

  5. Arduino clone would require an Ethernet shield as they don’t have that
    built-in. Depending on what clones clones you are buying, you may end up
    paying more than a $35 RPi. Then there is the software side. Most lazy
    software types just like to use a scripting language instead ofd messing
    with C.

    IMHO most of these internet enabled projects are better off modding with
    a $20 router. You get wireless, a case, an Ethernet cable and a wallwart
    for that price not “each sold separately” (TM).

    1. Routers are my favorite way to do it as well! you can get a router for half the price of the pi(without memory card, adapter and power supply) and i bet that if you cut the part of the remote with the radio in it you can fit everything in the router case.

      1. and by the time the router shows up in the mail, the rest of us have already finished the project with existing materials and moved on to more interesting stuff

    2. So you can make it go Arduino -> Frankenstein Router -> Normal Router -> Internet connection? Two routers can connect to each other and give you an internet connection?

      1. Yes, of course. To the Normal Router, the “Frankenstein” is just another normal client.

        In fact, you have a single router on your home, you’re already doing that: your router is connected to the ISP’s router, which is connected to a router of a Tier 1/2 ISP, etc. The whole Internet is routers all the way down.

  6. The LAN port of the Frankenstein Router can be hooked up to the LAN port
    of your regular router that talks to the internet. You have to disable
    the DHCP and assign a static IP to the Frankenstein Router.

    Ditch the Arduino! The Frankenstein Router has a processor running linux
    already and can run scripts and/or cross compiled programs.

  7. I did same thing, I’m powering the transmitter from my Pi directly using the 5V rail. Works fine with great range. No need for transistors just soldered the pins directly to the switches.

    1. That depends on how the switches are scanned, wouldn’t work if they were matrixed. This way is more compatible. Still, whatever works!

  8. Apparently hacks are not worthy unless they are well planned and executed using only the most optimal of materials, in which case of course they are not hacks any more. So I guess hacks don’t actually exist.

  9. If you want to make a living writing, then learn some basic things first :
    “device that greatly expands it’s capabilities”
    “Given it’s simplicity, anyone”
    Is it so hard to understand that “it’s” is short for “it is” ?!

  10. Neat! I’m seeing more and more of these on hackaday and it’s exciting. There was another post from today (12/13/13) where someone did a similar project, but utilized a Sonic Screwdriver. I did something similar, using the same exact RF controllers as you did, a few years ago! I wrote up an instructable on it, but never thought of submitting it anywhere. Awesome to see that others thought this was a neat idea too! Here is the link to my instructable, in case anyone wants to tear that to shreds too!

    http://www.instructables.com/id/Arduino-Remote-Control-Lights-with-Universal-Remot/step7/Disguise-Your-Creation-To-Fit-In-Your-Space/

    1. ****I also wrote a website for mine, but used .NET (since I’m more versed in that), but found it too cubmersome early on…so I removed that functionality and just stuck with the IR from my remote. :)

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