Does anyone know of a light switch which can be controlled using the RPi and also manually. Assuming that the RPi sends a signal thru a relay which connects to the light switch. The switch will turn on the light. The switch should be similar to the traditional light swiches the only difference must be that it could be triggered using the RPi relay signal as well. Does a switch like this exist in the market or will I have to make one myself?


You're not real clear on how much you want to put into this. i.e. Do you want something just to play around with or a real "up to code" switch installed in your house? The way you describe using the relay, it sounds to me like you want the Pi to behave like a three-way switch where either the flip-switch on the wall or the RPi can turn the light on or off at any time. It sounds like you want more than just our little RPi relay hooked up in parallel to a regular switch.

I may have to try to make one of these, too, you've got me intrigued. I think my approach would be this z-wave interface also available on Amazon. They seem to have lots of modules available at [not the highest] prices, including 3-way wall switch. I also like that they specifically mention Linux and RPi in their interface description.

Good luck & have fun!

| improve this answer | |
  • Yeah. U've got the right idea. Without using the RPi connected to the relay which connects to the light. I want to use the existing traditional light switch connected to the light. Which could also be operated using the RPi. Meaning the switch can be human hand triggered and also RPi triggerd.The only thing RPi would have to do is to send a small signal to the Switch. I am asking whether a swich like this exists in the market. The 'Z wave' seems to be a bit out of my budget tho. Thanks – Charindu Edirisuriya Apr 5 '17 at 16:37

If you don't mind that flipping the switch or relay—regardless of direction—changes the current state (off→on or on→off) of the light, you can wire the switch and the relay together in the traditional two-switch arrangement used, e.g., at the top and bottom of a flight of stairs.

You'll need a double-throw switch and a double-throw relay, wired like this:


simulate this circuit – Schematic created using CircuitLab

If you need to know the selected state of the light from the position of the switch or relay, this won't work. In that case the easiest solution is probably to have only the relay control the light and to use the switch as a sense input to the Pi. (A existing standard household switch can be wired up to ground or raise to VCC a digital input pin, though of course you'll want to disconnect it from all the AC power circuits first!)

| improve this answer | |
  • This seems like a good idea. I'll do it and let you know how it goes :) Thanks. – Charindu Edirisuriya Apr 5 '17 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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