1

I'm looking to get started on Raspberry Pi programming and thought of a DIY project that I could do.

Basically, I want to control the light socket switch to on/off via a remote control. The switch looks something like this:enter image description here

What I plan to do is mount a device on the socket switch. This device is connected wirelessly to a raspberry Pi controller via local network. An android app in a phone/tablet connected (also wirelessly via local network) to the raspberry Pi controller is used to control the device. For example, when user press 'ON' in the app, the device would push the bottom part of the button of the socket switch and top part of the button when 'OFF'.

Constraints

  1. I have at least 2 socket switches that I want to control so I prefer to have multiple of those devices connected to just one raspberry Pi controller instead of having one raspberry Pi mounted on each socket switches.
  2. I've googled on some tutorials on raspberry Pi but they all seem to make use of relay switches and rewiring the wires to them. I'm living in a rented room so I am not allowed to mess around with the electrical wiring inside the socket.
  3. My budget is around US$50 but this is just a minor constraint. As long as constraints 1 and 2 are fulfilled, I'm all ears.

What devices and hardware should I prepare and which tutorial would be useful in carrying out this project?

2 Answers2

2

I think you're definitely not taking one of the easy routes! If you're wanting to make reversible changes to the light switch, that would really be the way to go.

However, there isn't really any reason what you're proposing shouldn't work, but some initial questions come to mind:

  • How stiff is the light switch?
  • How had you planned on mounting the device to the switch?
  • Does the switch need to still be operated manually?

The first thing that came to mind is a servo physically controlling he light switch, some quick googling found this. You could use an idea like that and make the mounting line up with the screws that hold the switch to the wall. It's quite cumbersome, but I'm sure it'd work.

As soon as you have the physical operation working, it's a simple matter of making a bit of code to control it. I've written some code that would do it over websockets, but there are other examples in other languages, depending on what you're most comfortable with and what your full requirements are.

If there was some way you could get permission (or not, as the case may be), you can leave the switch in-place and achieve your desired result with only minor changes. The nicest thing about this method, is that you can just interrupt one of the connections from the switch, and not only control the light, but reroute the switch to a different GPIO as a manual override for when your landlord comes to visit and needs to turn on the light.

Since that second part is not specifically answering your question, I haven't gone into a lot of detail, but it needs to come with the usual "Playing with AC mains voltages" warning.

calcinai
  • 179
  • 1
  • 13
-2

I would recommand a Raspberry Pi Zero (cause the form factor) and then insert it in the switch witch a relay, for example this miniatur relay then you can bridge the original switch circuit without any problem and can still let the original circuit work.

Some like this easy bridge, you can modify it althoughyou living rented in this room, the only thing you need is to remove it if you cancle your rent.

Alternativ relays for a ready to use solution will be relay with phoenix contact. You get the with phoenix contacts or with screws. A other way will be RF relays, but then you need a test build to get the RF frequences and commands, after that you can use the Pi with an RF module to send the commands.

If you need a curcuit diagram how to bypath your curcuit just ask, me and many other with elektrical knowledge can help your here... its nothing magical just stay save and turn off the safetyswitch befor work ;)

Broatcast
  • 14
  • 2