Changing switch to be Arduino controlled

Hello all, I'm new here and would like to ask if it is possible to change the switch(circled in red) to be controlled by an Arduino module, connected to a relay, while the main plug is connected to the main power supply of 240V. Would that damage the Arduino module in any way?

Yes, use a relay, and be very careful when working with mains voltages. Those modules are designed to isolate the circuits.

By the way, that's a US style plug. Didn't know the US is using 240V nowadays, or are there other 240V countries that use those plugs? (China uses them, but their mains is 220V).

2 Likes

Yes, you can use an Arduino mini, a 5V switch source and a micro relay, and a SMD transistor (or SMD Mosfet) to drive relay.

Or can use an ESPxx, a 3,3V switch source and a micro relay, and a SMD transistor (or SMD Mosfet) to drive relay.

If you want build your own:
https://www.circuitbasics.com/build-an-arduino-controlled-power-outlet/

OR

https://a.co/d/2G30L8X

We aren't. That's a 120 single phase plug.

@newb6623 You might be better off making a relay switched outlet with an optoisolated relay and controlling the relay with an Arduino. Then you can just plug your device into that outlet.

Thanks for the replies thus far! What I was planning with my group was to utilise an Arduino to act as a switch to control the on/off function so as to adjust the brightness of a Philips lamp automatically. As such, do I need other sensors, and do I connect them directly to the relay or to the Arduino?

Just curious, is an optoisolated relay controlled by an Arduino similar to a switch? If it is, then why not replace the original switch? Also, is a relay switched outlet easier to build compared to a Arduino switch?

Yes, a relay is a switch. I recommended against opening that switch as it's part of a more expensive device and if there is an issue with the quality of the conductor or anything else, having your works in a different box is just easier. You want to break the hot leg with your relay; which wire in that switch is the hot leg? In an outlet in the US it's the black wire, much easier to see.

Not only that, but with a 2-relay board, you can split the top outlet off from the bottom and have each outlet controlled independently for about $1 more on the overall cost of the project.

Google "remote controlled power outlet".
Cheap, safe, and they come with a remote. Like this one.
The Arduino can act as a remote, or you can get a WiFi enabled model.
Leo..

2 Likes

How's that going to work? If that switch just turns the lamp on and off.

Any dimming that isn't done by sequences of on/off that mean something to electronics in that lamp won't happen with your plan.

So does the lamp have dimming capability controlled by "gestures" played on the on/off switch?

Just curious.

a7

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.