Okay, this is what I've come up with so far.
View attachment 66154
When I run the simulation everything looks nice but I am not convinced that this is the way to go...
The two 100K resistors in the circuit are there to limit the current through the zener to a maximum of 2 mA when 400 Vrms is applied on the probes. As I said, in my country we have 230V/50Hz, and 400V between the phases. This should protect the circuit from blowing
up if someone was to put the probes on either LIVE and NEUTRAL, or L1-L2, L1-L3 or L2-L3.
I may need to replace the resistors with several others (wich add up to 200K) since
the power dissipation in this case will be 0.4W per resistor.
So, how about the simulation? Well, when I put 5V on the input named "From PIC" in the circuit, and short the probes, I got 500 mV on the output "To PIC input", telling the PIC that we have continuity.
If I put an AC source (230 Vrms/50Hz) between the probes, and a "zero" from the PIC
on "From PIC", I got 0V on the output.
If I in this case put a "one" (5V) from the PIC on "From PIC", the output ("To PIC input") starts
to pulse out 4.95V at 50 Hz. See picture.
View attachment 66155
I am very sorry for the confusing way to explain all this, but I do not
master your language that well..! Now to the questions!
1) Can someone explain to me how the output can pulse 4.95V/50Hz when
5V is applied on PROBE 1 when also an AC source is present at the same time?
2) Is there any way to do this better? I'm sure there is, but will this work in
real life? I don't want to build this circuit and hear a BOOOM! when I plug the
AC in
Thanks to everyone that has helped me so far...!
Edit: I may also mention that Vdd = 5V.