Possibility for convert 120VAC toggle switch to send signal arduino

Hello there.

Completely new to this arduino world but just wondering if i can achieve the following:

Washing machine currently power on by 120VAC DPDT 3 Position On-Off switch.

Would it possible to piggy back from on-off switch to send signal to arduino to start counting time and then at certain point (eg: 13min) to activate relay module to send signal to another 120vac switch to rapid advance to next cycle?

I think second part would be possible but i am just not sure about the first part.
I understand 5VDC push button can send signal to Arduino but not sure about 120VAC switch.

Any guidance would be MUCH appreciated.

Use an optical isolator to connect the mains AC voltage to the 5V Arduino.

However playing with mains is not a beginners project, mains is very unforgiving on mistakes.

Thank you so much replying back to me.

instead of using optical isolator, would it be possible to use 120V AC Coils or solid state relay (120vac input > 5VDC) to energize Arduino input?

Is there such thing for solid state relay from 120vac to 5v?

Thank you so much again

Depending on how the switch is wired, sometimes there is no neutral in the switch box which means you can't get AC "power" at the switch. But. ignoring that...

instead of using optical isolator, would it be possible to use 120V AC Coils or solid state relay (120vac input > 5[v]VDC) to energize Arduino input?

Yes, you can use a transformer to both step-down and safely-isolate the high-voltage from the low-voltage. But transformers are AC so you need a diode on the secondary (low voltage side) and you may want to add a capacitor to get "smooth" DC (which means you are essentially making a power supply), and you may need a voltage regulator, voltage divider, or over-voltage protection circuit to keep the voltage safely-down to 5V.

Or, you can buy a 5V power supply.

A regular electro-mechanical or solid-state relay will also provide isolation. I don't know how easy it is to find a solid state relay that's "operated" by 120VAC, but can switch low-voltage DC. (It's easy to find solid state relays that work the other way around.) A regular relay can switch AC or DC (sometimes with different ratings) but solid state relays only work with one or the other.

You don't get voltage out of a relay, but you can use a pull-up resistor just like you do with a regular switch.

Wow! so much information that i can actually use! thank you so much!

This is the schematic that my washing machine currently wired. I was hoping when start button is pressed (120VAC travels), it sends signal to Arduino to start timer. I was hoping i could also use buck converter https://www.amazon.ca/DROK-Switching-Transformer-Converter-Wide-range/dp/B01LENMPUO similar to this (i know this converts to 12v). Not supplying the power but send signal.

Not that simple i supposed.

Thank you!

I was hoping i could also use buck converter DROK AC 85-264V DC 110-370V to DC 5V 12V 1A Isolated Switching Power Supply, AC to DC Power Transformer Adapter with Dual Output, 120V 110v ac to 12v DC Converter Support Wide-Range AC DC Input : Amazon.ca: Electronics similar to this

Yes you could but this is way way overkill for what you want / need. As it outputs 12V and not 5V you need two resistors in a voltage divider circuit to cut the output down to 5V. You would be better looking for a power supply with a 5V output.

The problem with this sort of thing is that it takes so little current there will be a delay of several seconds between turning it off and the output disappearing.

Your circuit shows a double pole switch so that will be fine, you will be able to get both sides of the mains.

Again, Thank you so much for replying back to me grumpy. Your insight on this would be much appreciated.

Now, the real questions is, what i wanted to do is NOT Powering Arduino but sending SIGNAL by pressing 120 VAC double pole switch to start time delayed relay.

if i buy something like this

Would this be enough to send 120vac to 5Vdc to send digital signal to Arduino? (just like push button that came with starter kit)

Thank you so much!

Oh Just the thought, since it's DPDT 3 Position On-Off switch, can i just connect second set of switch to aruduino to read current position of switch? I assume the second set of 3 poles connection at the switch is independent set meaning no 120vac current.

Middle pin to grn and other pin to digital/analog input?

Thank you again

Sky078:
Oh Just the thought, since it's DPDT 3 Position On-Off switch, can i just connect second set of switch to aruduino to read current position of switch? I assume the second set of 3 poles connection at the switch is independent set meaning no 120vac current.

Technically correct, but we would still be anxious about the close proximity of the mains and Arduino connections, both on the outside and inside of the switch itself.

Thank you so much for your insight.

Any recommendation to protect Arduino from the main? Should it get second set of switch to detect the location of the main switch?

Thank you

if i buy something like this
Switching Voltage Regulator AC 85-265VAC to 5V 700mA DC only 20 x 30mm 4260474033638 | eBay

Would this be enough to send 120vac to 5Vdc to send digital signal to Arduino? (just like push button that came with starter kit)

Yes but this still has the problems outlined in reply #5.

Thank you again grumpy.

I am not looking for powering up arduino with 120vac switch, I just wanted to arduino to read position of switch (for example position one to send signal to arduino to start timer)

Since its Dpdt switch (currently one set it connected to 120vac) i can technically use other set of switch to send signal to arduino digital input to trigger action right?

Thanks again

Since its Dpdt switch (currently one set it connected to 120vac) i can technically use other set of switch to send signal to arduino digital input to trigger action right?

Yes, providing that nothing else is connected to that pole of the switch. Your diagram suggested that both sides of the mains was being switched, which is what you would normally expect.

Grumpy_Mike:
Your diagram suggested that both sides of the mains was being switched, which is what you would normally expect.


OK, which switch is it?

Hello paul

Thank you so much for your reply!!! Its the middle switch where it says advance and start.
First set (which you see on 1,2,3) is for providing 120vac.

I was thinking using 4,5,6 to send signal to arduino to start timer

Would that be okay?

So sorry for noob question and thank u so much for ur reply

As posted in #8.

Its the middle switch where it says advance and start.

So nice to know. I assumed the top one so please ignore my comments about the switch.

Grumpy_Mike:
So nice to know. I assumed the top one so please ignore my comments about the switch.

Thanks grumpy

So in theory, my planned project is feasible enough?

Technically 120vac should not effect second set of switch where i can connect directly to arduino to trigger when button is pressed right?

Thank you so much!

Technically 120vac should not effect second set of switch where i can connect directly to arduino to trigger when button is pressed right?

That is right but I would echo what Paul said in reply #8.

I would use those actual mains contacts to drive an opto isolator just to be on the safe side. You never know when you could get leakage across the two throw sets of connections, as a result of ageing, mechanical damage or moisture ingress to the switch housing.

This is one of those occasions where yes it would work but no it could be safer.

Grumpy_Mike:
That is right but I would echo what Paul said in reply #8.

I would use those actual mains contacts to drive an opto isolator just to be on the safe side. You never know when you could get leakage across the two throw sets of connections, as a result of ageing, mechanical damage or moisture ingress to the switch housing.

This is one of those occasions where yes it would work but no it could be safer.

Thank you so much Grumpy.

If i buy wall wart that will take in 120VAC and output 5VDC (pull it apart) and connect to digtal/analog signal side of arduino would be safer option?

Then i can take signal from 1,2,3 switch side connect to wall wart that translate into 5vdc and then connect to arduino.