ESP32 no contact dual channel voltage detector

I need to make a power return monitor for the utility mains at my house so I know when to return to grid power from generator power during outages. I found a super simple circuit using an LM386 amplifier chip, however the LM386 has a minimum VCC of 5V, which isn't going to work with a 3.3V ESP module. I also need to sense both legs of the utility side, have had issues where one leg comes back up well before the other leg. Already had that issue fry one furnace control board :frowning:. I specifically want to use an ESP module for the ability to send notifications beyond simple status indicator lamps for the two legs, the entire device needs to be as small as possible to fit inside the service panel, and I will likely expand the functionality to include energy monitor as well in the future.

The built in 20x gain setting and 1/2 Vcc output offset saves a decent number of passives and board space with the LM386, so if any of the EEs in the crowd know of a good dual channel amplifier option with feature parity and 3.3V compatibility, I'd be very grateful for the recommendations!

And if you're worried about my ability to work with mains voltage, I just replaced the meter pan and service panel (100a to 200a service upgrade), and added the generator inlet and breaker interlock, on my own a couple of months ago and passed code inspection without issue, so I'm good :rofl:

I live in the US, so do not quite understand what kind of a power system would be designed so that can happen. Can you explain a bit?

Use AC-input optocouplers, one for each leg.

I have the same question about how two legs of a line manage to come up at different times. In what part of the world does that happen?

I also live in the US. Split phase 120V/240V. We had a tree come down on the main line that feeds our side of the street a couple blocks down the road, and it ripped one hot leg off the transformer, but not the other hot and neutral. So we had one leg dead, one leg and neutral live for a two block stretch (my house is the end of that main line). My furnace is fed by all three conductors, as the blower motor is 240V, but the control board runs off 120V. Apparently the leg that went dead was the one feeding the control board and something with how everything is done on that particular furnace, it did not appreciate that and fried several components on the board.

In regards to using optocouplers, that would normally be my go to for this purpose, except I need to sense voltage on the main feed lines from the meter to the main breaker. As I said, I need to sense power in the main feed when the main breaker is disconnected while running on generator during a power outage. This is entirely unprotected, and I have no way myself of making those conductors not live nor any proper location to attach additional wires to them. On top of that, attaching anything before the main breaker is an absolutely no-no and the code inspector would issue a REALLY nasty fine if I got caught with something hooked up that way. It absolutely has to be a non contact sensor, basically reading the tiny current caused by magnetic coupling of the insulated hot leg wire to an insulated antenna wire wrapped around it, similar to how a current CT would be attached.

The last outage we were running on gen power for over two hours after the grid power came back up because none of the neighbors had outside lights on. Typically I have to go out every hour or so to see if the meter has power yet, which is inconvenient, especially in the middle of winter and the middle of the night. And with gas over $3 a gallon and the gen eating a gallon an hour, it adds up quick.

Freak accident! But yes, such an imbalance can do great damage. I had that happen with my backup generator. In the purchased extension cable, a screw in the four prong 120-0-120 female socket had never been properly tightened by the manufacturer, and the wire finally slipped out. $500 to replace burned out equipment.

A capacitive sensor (e.g. as simple as a few turns of insulated wire wrapped around the insulated mains hot leads) would give a signal that AC voltage is present. That would be a very high impedance voltage source, but enough to light a neon bulb, which in turn could be used to make an optocoupler.

This is the basic idea, performed some years ago by artist Richard Box in the U.K.:

ok, now I understand. Closest we came to that situation was a bad compression connection to one of the 220 volt wires coming from our transformer.
Made a resistive connection rather than tight metal to metal. Must have been done at the time of original installation in 1982. When the resistance dropped the voltage too low for the house appliances to work, my called in a panic. I measured the voltages and saw how low one 120 volt side was and called the power company. Quite a struggle to trace the problem down and replace the connection.

I agree with the post about the capacitive coupling. You do not even need a neon bulb, just a capacitive AC voltage to a sensor that will detect the voltage on an open wire. Remember how an Arduino pin works when it is left floating? In this case, we want it floating and connected to a diode and capacitor to ground giving pulsed DC. Any Arduino connected will show a high because the voltage on the cap will hold the voltage through the negative half of the cycle.
So, one wire capacitor on each leg of the 220 feed should do it. Don't need much wire.

I made up a box with two of these receptacle testers, 1 each connected to L1 & neutral and L2 & neutral and both ground terminals to earth ground. Works great for visual check. I thought about making up some kind of black plastic tubes to mask the LEDs from each other and inserting photo diodes to feed Arduino inputs but haven't got around to it yet.

Receptacle tester

Nice, so a half dozen or so turns of wire around a hot leg, to say a 3V zener and 10pf ceramic to ground, into a digital input?

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