Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

DC voltage on an AC line

Status
Not open for further replies.
V1 is the Vdd for your microprocessor. It could be 3.3V or 5V...

V3 and V4 are just for simulation; they control when the simulated switches open/close. Think of "switch" and "fault" as being time-delay relays.

V3 opens the 120Vac switch S1 at 50ms in the simulation.

V4 opens switch S2 to create the simulated fault on the line at 100ms in the simulation.

With the circuit I showed, the microprocessor can tell if the ac is on/off. It can tell if the line is continuous to the relay or not. It cannot tell if the line is shorted; the ac breaker will blow in that case.

You are obviously confused by a simulation schematic and how to convert that to a circuit schematic. C1, R4, R5 are not "real" components; they represent the line resistance and capacitance. Just like R6 and L2 represent the relay.

Thanks for the explanation of the different components. I did realize C1, R4, R5, R6, and L2 were just representations of the wires and relay. I didn't realize V3 and V4 could be used in a simulation that way. Very cool.

I tested the circuit today, and it worked great. I had to adjust a few resistor values to match the environment, but it worked out. I do have a question about the V1 source. This voltage, 3.3VDC comes from the MCU's PSU. Why is it okay to connect a 120VAC main line to a 3.3VDC voltage source with a resistor? That through me when I saw it in your simulation, and although it works, I'm confused why it didn't burn something out. It appears safe, but is it?
 
It is all about power dissipation in the resistors. When I did the sim, I was thinking that the ac voltage was the standard US 120v, and the power dissipation in the resistors I showed was under 150mW. At 240V, you should redo the power dissipation calculation, and maybe use 1/2W resistors. Goal should be that the resistors dissipate less than half their rated power, and have less than half of their rated voltage across them.

Standard metal film resistors and chip resistors have a breakdown voltage rating that you must verify. It might be prudent to use two resistors in-series, both to reduce the voltage across each resistor by half, and also to reduce the power dissipation in each resistor.
 
Last edited:
I am using the US standard 120VAC. The resistance of the line measured from the beginning was close to 4.9K ohms. I've decided to stick with the original 100k ohm resistor you had in your simulation. I get about 154mV if there is no fault in the line and much more if there is a fault.

I have a few other lines I detect to see if they have voltage (120VAC). I use a resistor in series with an opto coupler. Seeing that a resistor can used to connect a main line with a DC voltage source, I wonder when an opto coupler is necessary vs the use of a resistor? At what point will connecting the AC line voltage to the DC voltage source with a 100K ohm resistor fail? I suppose the first post to this thread, which is quoted below, concerns me when it says lethal. Your simulation and my breadboard implementation are both working without "lethal" consequences.

With a 100K buildout resistance, the reverse current from 120 Vac would be 1.2 mA rms, or +/-1.7 mA peak-to-peak. Other *lethal* lack-of-isolation issues notwithstanding, that should not be a problem for whatever small power supply is supplying the DC.

Note: *lethal*

ak
 
Last edited:
If it is a standard opto-coupler, you can use a resistor-capacitor-diode network on the LED side to both limit current, limit dissipation, limit reverse-voltage breakdown. Here is how I would make an isolated AC detector:

line.png

V(out) is yellow
Current into the optop is red
Power in R2 is Green (Time average of R2 power is in the box)

R2 limits peak in-rush
R4 discharges C1 when no ac is present.
D2 prevents reverse voltage across LED. It can be a visual LED as an indicator of AC on.
 
Okay, so this will be the final design. D1 is to ensure that V2 doesn't see voltage greater than 5V. Output goes directly to my processor's ADC. There isn't opto-isolation, so I am relying on the 100K R4 resistor for power dissipation and the D3 diode for over voltage protection. Any danger?
Screen Shot 2017-10-05 at 11.34.46 AM.png
 
You cannot put a 4.7V Zener in parallel with a 5.0V Power Supply without having a current-limiting resistor between V2 and the Cathode of D1. It will blow-up the Zener. A 3.3V supply and a 4.7V Zener could co-exist without the resistor.

Here it is with a 220 Ω resistor between the 5V supply and the Zener. I plot the currents through R1 and R3. Note that even with the Line voltage at its peak of ~170V, the current through R3 is always from the 5V source toward the Zener, meaning that you are never injecting current back into the supply.

You really do not need D2. Since the current sourced by R1 is a peak of ~1.6mA when the line voltage is at its maximum of +170V, then even if 1.6ma flows backwards into the 5V supply, that just reduces the total load on the 5V supply by 1.6mA. Assuming that the 5V supply has a minimum load of several tens of mA, then the supply voltage will not increase. Another way of saying this is at the line swings from +170V to -170V, the current in/out of the 5V supply swings from -1.6mA to +1.6mA. With a 3.3V logic supply, a 4.7V will not conduct except when the line is struck by lightning, which if it is 1500ft long, is not all than unlikely.

linz.png
 
Last edited:
Thats pretty nifty mike.
One thing I'll add you can get auxilliary contact blocks that attach to the side of mcb circuit breakers, so you could add overload detection too if you wanted it.
 
With my MCU only 3.3VDC compatible, I will make V2=3.3VDC and want the zener diode (D2) to have a breakdown voltage of 3.3VDC. Could I use this (MM2Z3V3B) surface mount component?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top