I am making a PCB circuit that detects the state of a mains voltage switch. Now since I am dealing with mains voltage a lot can go wrong and a lot can go wrong badly so I would like to ask for some advice on how to properly deal (and might even use standard practices) with mains voltage on my PCB.

My circuit takes advantage of an unused "throw" pin of the switch, which I can use to detect the voltage. I plan on using an AC input optoisolator (could not find an AC input model for the schematics) to fully isolate my electronics from the mains voltage. There will be several of these detector circuits in a single PCB, the number will range from maybe 5-10 depending on how much I can fit in.

So what I would like advice for are:

  • What would be the thinnest trace I can go for the mains voltage, and also the the distance between traces? (1oz copper)
  • What would be the best/safest connectors both male and female for this application.
  • Is it okay to share the neutral line for all the detectors to reduce the wire connecting to the board?

enter image description here

  • 1
    \$\begingroup\$ farnell.com/datasheets/2729322.pdf \$\endgroup\$ – jsotola Jan 12 '20 at 3:26
  • \$\begingroup\$ @jsotola awesome! an opto exactly designed for my usecase. My main concern are the connectors do you have recommendation for those? \$\endgroup\$ – Jake quin Jan 12 '20 at 3:38
  • \$\begingroup\$ is is unclear to me what you are buiding, so i have no idea what kind of a connector you could use ... you could use almost anything for the low voltage side ... db9, rj45, phono plug, pin header, etc \$\endgroup\$ – jsotola Jan 12 '20 at 3:47
  • \$\begingroup\$ @jsotola i am making a switch state detector for residential or small industry, so i the wires used will be the ones used on those area. this project will not really be deployed to the field, but i am building it like to be deployed. \$\endgroup\$ – Jake quin Jan 12 '20 at 3:53

Low consumer quality boards are done like this.

enter image description here

Since dust and moisture accumulation causes greatly reduced breakdown voltages down from 1kV/mm, it is far better to have an air gap milled in the board between primary and secondary of the Opto.

enter image description here

However , your external schematic is nonsense with Line Neutral and switch going to LED.

  • \$\begingroup\$ What do you mean by Line Neutral and switch going to LED ? Also is the milling done only in the opto and not also the mains input terminal? You said low consumer quality, how is it done in high quality? \$\endgroup\$ – Jake quin Jan 12 '20 at 3:20
  • \$\begingroup\$ What do you think L N means? Milling is done to make an air gap between 3.5kV creapage rating primary to secondary under Optos. High quality designs have contamination level specs and safety specs and air gap complies to these ratings. Consumer spikes can reach 6kV in 1us without filters. But safety test limits are less. So high quality design specifies all requirements and may include spike attenuation filter and MOV. with fuse. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Jan 12 '20 at 3:50
  • \$\begingroup\$ Live and Neutral ? So when the switch is conneceted to the load the opto is "off" and i can interpret that as the switch is "on". When the switch is "off" the circuit is complete for the optocoupler thus turning it "on" i can interpret the signal as the switch is "off" \$\endgroup\$ – Jake quin Jan 12 '20 at 3:56
  • \$\begingroup\$ I see so they still make the holes that are upto specs. I will try to incorporate as many you have said to the design as possible. Thank you! \$\endgroup\$ – Jake quin Jan 12 '20 at 4:02
  • \$\begingroup\$ Opto IR diodes are normally current limited 15 mA using 5V logic 220 ohms or so depending on source Rs \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Jan 12 '20 at 4:03

There will be several of these detector circuit in a single pcb, the number will range from maybe 5-10

This means that you have to route mains voltage from several places to a single detection circuit - really bad idea!

It makes more sense to have a tiny PCB that can fit next to each individual switch with low voltage signal going to the common location. It is a) probably will be cheaper, b) easier to install and c) a whole lot safer.

Also, I would not rely on always having SPDT switch available. The optocoupler suggested by @jsotola can be connected in parallel with the load and it will work with SPST switch.

  • \$\begingroup\$ But you are NOT using the neutral line in your schematics what are you talking about ?? If you are talking about the PCB section of the schematics that is digital ground. I like the idea of breaking it out to smaller pieces, but i have to add special circuits so i can reliably read data over long distances which i still have to look into how \$\endgroup\$ – Jake quin Jan 12 '20 at 21:12
  • \$\begingroup\$ @Jakequin I am talking about terminal marked "Z" on "external" side of your schematics \$\endgroup\$ – Maple Jan 12 '20 at 21:26
  • \$\begingroup\$ "add special circuits so i can reliably read data over long distances" huh? some network protocols work over kilometers of wiring. You have simple digital level on/off which does not require any special circuits, other than maybe simple TVS \$\endgroup\$ – Maple Jan 12 '20 at 21:31
  • \$\begingroup\$ That is an N just sideways, i do not think there is a z symbol other than impedance i guess \$\endgroup\$ – Jake quin Jan 12 '20 at 21:51
  • \$\begingroup\$ my bad, I thought you marked ground wire that way. I'll remove that from the answer. \$\endgroup\$ – Maple Jan 12 '20 at 21:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.