I gave up on using my Pi as a VPN'd NAS, since the CPU is too slow to handle OpenVPN (see here Low bandwidth internet over VPN).

So I want to set it up to do (all of) the following:

  1. Control a light switch
  2. Switch my speaker system between either of two audio inputs (laptop or desktop)
  3. Link to my Android phone through an app, allowing me to control the Pi to do (1) and (2) through my phone

I have a fair amount of programming expertise, but I'm pretty inexperienced when it comes to hardware/electronics, so I'd really appreciate some help -- specifically whether you think it's possible to build interfaces on the Pi that allow me to do the above.

  • #3 shouldn't be too hard if you are comfy with java; although you could just make a web interface, in which case you wouldn't have to write a platform specific client.
    – goldilocks
    Commented Feb 11, 2013 at 19:55
  • 1
    Sounds reasonable. Get back to us if you encounter any problems along the way :)
    – Jivings
    Commented Feb 11, 2013 at 19:56
  • 1
    I think Jivings is trying to tell you to break this project down into steps and ask more specific questions as you go. Eg, probably something about the hardware required to control a lightswitch will get you answers.
    – goldilocks
    Commented Feb 11, 2013 at 20:56
  • Anything specific you need help with or you are trying to get someone to point you to how-tos for each of the three easy things? :)
    – abolotnov
    Commented Feb 11, 2013 at 21:37
  • You can do all that using HTML5, jQuery with Node.JS(for system level script execution) but can also be PHP that does the same, they both will drive Perl, C or Bash scripts. Getting it all together is the problem. So start with LAMP stack for webpages. Then make a a script or two. Lastyly get Web to execute your script. Good luck
    – Piotr Kula
    Commented Feb 12, 2013 at 8:36

2 Answers 2


I assume that when you say "light", you mean a plug-in-an-outlet light. To do that, I'd use a GPIO pin to control this relay-switched power cord and plug your light into it.


And, you'd be supporting an awesome open source hardware company like Adafruit (with whom I'm not affiliated).


Specifically on the light switch question, you could use z-wave devices for this. Raspberry Pi can act as a Z wave controller using Open Z wave as software. You'd need either a usb open z wave dongle or possibly you could wait for this GPIO add on to become available.

There are a lot of z wave lighting nodes available but I can't add any more links to google is your friend for that.

Once you've got the Pi controlling any given function, adding a front end accessible via an android device should be a relatively simpler task along the lines of ppumkin's comment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.