ryanchen2134
Posts: 1
Joined: Mon Jul 26, 2021 8:08 pm

How do I make 2-way light switch automated with a RPi?

Mon Jul 26, 2021 8:25 pm

I'm bored and I have a spare RPi Zero lying around from a past project. I know messing around with electricity lines is dangerous, but I'm willing to take the risk. I've also got a multimeter lying around for testing.

How would I go around with replacing one of the two switches with a relay and a RPi / IR receiver and IR remote?
Attachments
Switch.jpg
Switch.jpg (91.38 KiB) Viewed 456 times

pcmanbob
Posts: 11685
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: How do I make 2-way light switch automated with a RPi?

Tue Jul 27, 2021 2:35 pm

HI.

If you don't understand how to replace a 2 way switch with a change over relay which is essentially a 2 way switch , then you don't have the required knowledge or training to work with mains voltages.

It may not be you that gets killed but a member of your family, you could even burn your house down.

Please don't play with mains voltages just because you are bored and have a spare RPi Zero lying around from a past project.

That all I have to say , rant over.

If you really must do this go look up 2 way lighting circuits on the web, so no one on this forum is not responsible should anything bad happen.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 14140
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: How do I make 2-way light switch automated with a RPi?

Wed Jul 28, 2021 11:53 am

ryanchen2134 wrote:
Mon Jul 26, 2021 8:25 pm
, but I'm willing to take the risk.
Are you also willing to electrocute someone else?

I have just one suggestion (other than don't do stuff you are not allowed to do) and that is to separate the task of changing the switch to a PI controlled relay in two separate tasks,
  • controlling the relay with a PI (the safe and more challenging part
    and
  • replacing the mains switch with your relay
Controlling Relays can be tricky, I would first study this sticky: viewtopic.php?f=91&t=83372&p=1225448#p1225448

Then after you are satisfied the relay works like you want, hire an electrician to replace the mains switch with your relay, who can safely asses if your relay is suitable, and can safely do the dangerous work, or can convince you that what you want to do is a silly idea, and convince you not to do it. :mrgreen:

Return to “Automation, sensing and robotics”