Interfacing with 120v AC signals

Hello, I'm currently attempting to interface an Arduino with a device that utilizes 120V AC signaling to detect which button is being pressed (inputs). I've explored a few methods, but each has its own set of problems. Here's a summary of the issues I've encountered with each approach:

  1. AC → Full bridge rectifier → voltage divider → Arduino: The main problem with this method is that it requires sharing a common ground, making it non-isolated. This raises concerns about safety and interference, which can become quite complicated to address.

  2. AC → Rectifier → voltage divider → Optocoupler → Arduino:
    In this approach, using an optocoupler introduces isolation, but it draws a significant amount of current (8+ mA) from the voltage divider. This leads to heat dissipation issues and necessitates higher wattage resistors, which may not be optimal.

  3. AC → Hall effect sensing IC → Arduino:
    While the Hall effect sensing IC is accurate in measuring current, it may not be the ideal choice for detecting voltage signals since the signals usually have minimal current draw (perhaps a few mA at most).

  4. Digital isolator: I'm not very familiar with this method, so I am unsure of its suitability and how it addresses the challenges posed by the other methods.

I would appreciate any advice or suggestions on how to effectively interface the 120V AC signaling device with the Arduino while ensuring safety, isolation, and minimal interference.
Thank you!

I would use an AC optocoupler, with an appropriate current limiting resistor for the input.

2 Likes

Is there any method that does not involve much heat? There will be over 1 watt of heat dissipation for the 10mA needed for the optoisolator

I'm not sure I understand: are you simply trying to gauge if mains voltage is on or off, or does the AC signal vary (i.e. are you measuring AC voltages that change)?

no. Present or not present.

Use a USB power cube. Convert AC to a 0 or 5V signal. Your signal is isolated and you get a logic level signal to work with.

10 mA is not needed, especially if detection is the only goal. You could probably get away with 1 mA peak, which requires a 120K resistor, dissipating much less heat.

A capacitor can also be used to limit current, and dissipates no heat.

tricky to know what value. plus ceramic caps can fail short...

I can protect with a 1A fuse. but what value ceramic cap to use?

not an option. System already uses 120v ac signaling. Do not want to modify existing circuitry, only interface. Arduino is powered with isolated DC power supply.

Right... Bad idea! The problems come when the neutral and hot get mixed-up (which can happen with certain power plugs or extension cords). It's illegal to make a "product" like that unless the entire thing is enclosed in an insulated box with no connections coming-out (no USB, etc.).

This seems to be the most popular solution. The "voltage divider" is usually just one resistor in series with the the opto-isolator's internal LED. But it needs to be a 1 or 2W resistor. And if you don't have an "AC" opto-isolator, You also need a reversed diode across the LED to protect against reverse voltage.

You can also use a step-down transformer (with a rectifier, and usually a voltage divider, etc.). A long time ago I made a light dimmer (with a different microcontroller) and since I built my own power supply, I tapped-into the transformer secondary to get an isolated zero-crossing/phase-detection signal. But if you don't already have a transformer this is probably less energy-efficient than a resistor feeding an opto-isolator. And it' bulkier and more expensive.

Is there any non-photo related solution? Silicon based ? mosfet ? digital isolator?

I think so far jremington has the best solution. But finding the right value ceramic cap for 120v AC is tricky.

How is this not an option? If you are trying to determine if a 120 VAC signal is present, it is the same as determining if mains voltage is present in a receptacle.

USB power cubes are cheap and include a transformer and associated circuitry: cut one open and take out the guts. Where the prongs connect, connect two wires instead (or whatever you require to connect to the circuit you are trying to gauge). The output is simply two wires (Vcc and GND) which you interface to your Arduino as a digital signal. Add a current limiting resistor and a 100nF decoupling capacitor for safety.

I am talking about a system that has multiple buttons. Having a power cube connected to each input is impractical plus these are just signal circuits, not power.

I agree, given the assumption of "ceramic". A 1 uF cap will pass about 1 mA rms at 120VAC, 60 Hz. Review impedance formulas.

You don't suggest electrolytic.. do you?
not bi-polar.

Please try to be professional, and not kill yourself.

No. Really now, what did you mean by

?
is there a different type of capacitor that you have in mind?

"Class Y" fail open circuit.

thanks!
Have any idea what jremington meant by "given the assumption of "ceramic" "?