Author Topic: AC Mains and Zero Crossing Precision Detector  (Read 2394 times)

0 Members and 1 Guest are viewing this topic.

Offline felixdTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: pl
    • FlameIT - Liquid Immersion Cooling
AC Mains and Zero Crossing Precision Detector
« on: February 06, 2022, 01:46:06 am »
FlameIT - AC Mains and Zero Crossing Precision Detector


Module GitHub repo: https://github.com/flameit-os/ac-mains-and-zero-crossing-detector

If anyone is interested in buying one (or more :-DD) do not hesitate contacting me.




!!! Caution !!!

Code: [Select]
This module was design to connect directly to the AC grid power.
 Its misuse might cause ELECTRIC SHOCK or FIRE.

!!! Caution !!!


Schematics

Original concept was created by Dextrel. This module has extra imput protection and MDL (Mains Detection Logic) output.



https://web.archive.org/web/20180209005931/http://www.dextrel.net:80/diyzerocrosser.htm

Features

- very accurate mains zero crossing detection
- fully isolated (5kV optoisolation)
- low voltage, safe output (low side can be supplied with voltages from 1V up to 16V)
- ultra-low power consumption; worst case power dissipation < 120mW
- produces symmetrical pulses around the zero crossing
- very low parts count, no precision components required
- all components can be low voltage SMD
- works over all mains voltage ranges (100VAC...240VAC), without any modification
- both 50Hz (1,2ms ZC pulse) and 60Hz (1ms ZC pulse) mains frequency compatible
- highly stable with varying temperature
- ROHS compliant (Pb-free)
- extra AC input protection (fuse and varistor)
- 4 independent AC inputs on one module
- 2 low side outputs for each AC input
  - ZCD - Zero Crossing Detection pulse (HIGH level pulled to GND)
  - MDL - Mains Detection Logic (HIGH when mains is detected)
- spring clamp system terminal blocks on input and output
- extra goldpin outputs on low side

Use cases

- Mains detection (logical output HIGH when phase is available)
- ZCD - Zero Crossing Detection
- Mains frequency monitoring
- Checking of connection order of three phase systems
- Checking shift between phases
- Detection of power failures
- AC motor monitoring
- ...and others (check original Dextrel page for more applications): https://web.archive.org/web/20180209005931/http://www.dextrel.net:80/diyzerocrosser.htm

Simulation

Circuit Simulation: https://tinyurl.com/yasss96p




Testing real module

Phase Order Detection



Turn ON / OFF






Mains Detection Logic







Zero Crossing








Zero Crossing with Mains Detection Logic












Pawel 'felixd' Wojciechowski
FlameIT - Liquid Immersion Cooling https://flameit.io
OpenPGP: 0x9CC77B3A8866A558 https://openpgp.flameit.io/
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17243
  • Country: us
  • DavidH
Re: AC Mains and Zero Crossing Precision Detector
« Reply #1 on: February 06, 2022, 04:32:01 am »
When I saw "precision", I immediately thought of phase locking an oscillator to the mains to make an integrated measurement with much lower bandwidth to remove noise, but what you show is a lot simpler.
 
The following users thanked this post: TiN, felixd

Offline felixdTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: pl
    • FlameIT - Liquid Immersion Cooling
Re: AC Mains and Zero Crossing Precision Detector
« Reply #2 on: February 06, 2022, 10:24:13 pm »
Quick and dirty test ;)

On a video You can see frequency from PV inverter + frequency calculated using RPi and above module. Geeeeee, works. I can now check my frequency  :-DD



Code: [Select]
pi@raspberrypi:~/src $ python3 frequency.py
Checking if AC line is ON
Switching AC line ON
Checking if AC line is ON
AC line is ON
Frequency counting [ 1000 samples ]
AC Line Frequency:  50.02061143463671 Hz
Frequency counting [ 1000 samples ]
AC Line Frequency:  50.01877893714722 Hz
Frequency counting [ 1000 samples ]
AC Line Frequency:  50.02381624189697 Hz
Frequency counting [ 1000 samples ]
AC Line Frequency:  50.03017696015632 Hz
Frequency counting [ 1000 samples ]
AC Line Frequency:  50.026594232836 Hz
Frequency counting [ 1000 samples ]
AC Line Frequency:  50.02598323928995 Hz
Frequency counting [ 1000 samples ]
AC Line Frequency:  50.022883154370376 Hz
Frequency counting [ 1000 samples ]
AC Line Frequency:  50.02956110508126 Hz
Frequency counting [ 1000 samples ]
AC Line Frequency:  50.0248830112043 Hz
Frequency counting [ 1000 samples ]
AC Line Frequency:  50.03246625981792 Hz
Frequency counting [ 1000 samples ]
AC Line Frequency:  50.03967331162225 Hz
Frequency counting [ 1000 samples ]
AC Line Frequency:  50.030585151526225 Hz
Frequency counting [ 1000 samples ]
AC Line Frequency:  50.02556676982112 Hz
Frequency counting [ 1000 samples ]
^CSwitching off AC line. 100ms switch off impulse.
« Last Edit: February 07, 2022, 01:12:34 pm by felixd »
Pawel 'felixd' Wojciechowski
FlameIT - Liquid Immersion Cooling https://flameit.io
OpenPGP: 0x9CC77B3A8866A558 https://openpgp.flameit.io/
 

Offline felixdTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: pl
    • FlameIT - Liquid Immersion Cooling
« Last Edit: January 22, 2023, 03:08:46 am by felixd »
Pawel 'felixd' Wojciechowski
FlameIT - Liquid Immersion Cooling https://flameit.io
OpenPGP: 0x9CC77B3A8866A558 https://openpgp.flameit.io/
 

Offline bostonman

  • Super Contributor
  • ***
  • Posts: 2113
  • Country: us
Re: AC Mains and Zero Crossing Precision Detector
« Reply #4 on: January 23, 2023, 03:19:23 am »
I have a few questions. I don't see a BOM, but most of the parts are shown on your schematic along with the Dextrel, however, do you have the parts for the stuff after the optocouplers such as the MOSFET?

What are you using for Vcc on the transistor side of the opto?

Any layout rules that should be followed to prevent noise?
 

Offline SuzyC

  • Frequent Contributor
  • **
  • Posts: 812
Re: AC Mains and Zero Crossing Precision Detector
« Reply #5 on: January 23, 2023, 05:06:06 pm »
This circuit can use any silicon small signal or rectifier silicon diodes, any  common transistor-output optocoupler (4-leaded 817, for instance), any hi-beta transistor.



Original Post: Is it just me or is it really OCD to fuse a 440-k resistor circuit running off the mains?

Use the same Vcc/Vdd as your MCU circuit.

Not needed: special construction/fabrication techniques needed to fabricate to prevent noise problems, same as for your MCU.
Of course, be mindful of the mains voltage danger, so keep your  hands and your isolated MCU circuit at least .4-in away from the mains side of this circuit.
« Last Edit: January 23, 2023, 05:20:59 pm by SuzyC »
 

Offline bostonman

  • Super Contributor
  • ***
  • Posts: 2113
  • Country: us
Re: AC Mains and Zero Crossing Precision Detector
« Reply #6 on: January 24, 2023, 01:38:06 am »
Quote
Use the same Vcc/Vdd as your MCU circuit.

I actually don't have a need for this circuit, but it looks simple enough to build, so thought maybe some day I'll build it.

If anything, I wouldn't do anything with an MCU (I'm not really on the software side anyway), so I could probably just use a 9V battery or something.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf