110v Relay to Control Arduino?

Im making a project that needs to detect if 110v is applied then have the arduino control a servo depending on if the 110v "switch" is on or off. I've seen modules that control 110v relays, but apparently in my noobness Im not sure what to look for when it comes to running that in reverse.

Basically, if 110v is detected, servo moves 180 clockwise. When 110v is off, servo moves back to original position (180 counterclockwise).

Feel free to flame me for being a noob, and thanks in advance!

CJ

A simple 110 volt detector could be a cheep, low power wall plugg producing 5 volt......

Not clear what you need here. A similar situation occurs though when the Arduino is keeping an eye on mains power - i.e. if there's a power outage, do this.

Obviously the Arduino will need non-mains power. Then people use a wall-wart to transform mains A/C into 5VDC or similar so it's something the Arduino can test.

Edit: Which is just a long winded version of what Railroader said.

Thanks for the advice.

Here's the scoop.. Im doing something not so "up to code" in my newly built basement bath/laundry room. I have no easy way to run another vent for the exhaust fan outside, so I bought one of those Deflecto dryer boxes. My idea was to use my Creality Ender 3 Pro to build an exhaust "flap" mech that will attach to that dryer box. When I flip on the fan switch in the bathroom, the exhaust "flap" will open, allowing moisture from the shower etc to be blown out. When the exhaust fan is off, the flap will be pulled securely shut not allowing any dryer lint or exhaust into the exhaust fan duct. The washer electric is on a seperate circuit so I can pull the power from that for running the arduino and servo mech.

Hope that gives an idea as to what Im trying to do... I can run a power line directly from my exhaust fan to the "relay", just not sure what relay to get or how to apply this concept. Really dont want to run an extra "outlet" and a wall wart just for this purpose, would like to use a relay if possible.

110V is a very common control voltage in industry. Get a 110 actuated relay, heres some examples - 110 relays

You could go socket mounted (you will need to buy the socket separately and wire from that), or you could go for something through hole that fits on your breadboard. I personally would go socket because that means I can keep the 110 as far away from the arduino as possible.

==

What if the dryer is running when you need the bathroom exhaust?

Not sure what an Arduino is needed for here but I suppose an Arduino can do just about anything!

What sort of servo do you propose to use? Not an “SG90” I suspect, you will want something more substantial.

A “gearmotor” with two limit switches controlled by a 110 VAC relay would sound more appropriate.

If you really want to detect 110 VAC for an Arduino, you want a PC814 optocoupler. You can use an 0.1 µF mains rated capacitor and a 1k resistor in series with the input and connect the output between an Arduino pin and ground using INPUT_PULLUP.

Or this:

(Hint - it will work just as well at 110 V :grinning: )