AC Mains and Zero Crossing Precision Detector - Page 1
Forum section: electronics / projects

author: felixd
author_rank: Regular Contributor
timestamp: February 06, 2022, 01:46:06 am
content: FlameIT - AC Mains and Zero Crossing Precision DetectorModule GitHub repo:https://github.com/flameit-os/ac-mains-and-zero-crossing-detectorIf anyone is interested in buying one (or more) do not hesitate contacting me.!!! Caution !!!Code:This module was design to connect directly to the AC grid power.Its misuse might cause ELECTRIC SHOCK or FIRE.!!! Caution !!!SchematicsOriginal 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.htmFeatures- 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 Detectionpulse (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 sideUse 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.htmSimulationCircuit Simulation:https://tinyurl.com/yasss96pTesting real modulePhase Order DetectionTurn ON / OFFMains Detection LogicZero CrossingZero Crossing with Mains Detection Logic

author: David Hess
author_rank: Super Contributor
timestamp: February 06, 2022, 04:32:01 am
content: 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.

author: felixd
author_rank: Regular Contributor
timestamp: February 06, 2022, 10:24:13 pm
content: Quick and dirty testOn a video You can see frequency from PV inverter + frequency calculated using RPi and above module. Geeeeee, works. I can now check my frequencyCode:pi@raspberrypi:~/src $ python3 frequency.pyChecking if AC line is ONSwitching AC line ONChecking if AC line is ONAC line is ONFrequency counting [ 1000 samples ]AC Line Frequency: 50.02061143463671 HzFrequency counting [ 1000 samples ]AC Line Frequency: 50.01877893714722 HzFrequency counting [ 1000 samples ]AC Line Frequency: 50.02381624189697 HzFrequency counting [ 1000 samples ]AC Line Frequency: 50.03017696015632 HzFrequency counting [ 1000 samples ]AC Line Frequency: 50.026594232836 HzFrequency counting [ 1000 samples ]AC Line Frequency: 50.02598323928995 HzFrequency counting [ 1000 samples ]AC Line Frequency: 50.022883154370376 HzFrequency counting [ 1000 samples ]AC Line Frequency: 50.02956110508126 HzFrequency counting [ 1000 samples ]AC Line Frequency: 50.0248830112043 HzFrequency counting [ 1000 samples ]AC Line Frequency: 50.03246625981792 HzFrequency counting [ 1000 samples ]AC Line Frequency: 50.03967331162225 HzFrequency counting [ 1000 samples ]AC Line Frequency: 50.030585151526225 HzFrequency counting [ 1000 samples ]AC Line Frequency: 50.02556676982112 HzFrequency counting [ 1000 samples ]^CSwitching off AC line. 100ms switch off impulse.

author: felixd
author_rank: Regular Contributor
timestamp: January 22, 2023, 03:06:23 am
content: In action:https://youtube.com/shorts/ykWeYDJ9hZU?feature=share

author: bostonman
author_rank: Super Contributor
timestamp: January 23, 2023, 03:19:23 am
content: 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?

author: SuzyC
author_rank: Frequent Contributor
timestamp: January 23, 2023, 05:06:06 pm
content: 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.

author: bostonman
author_rank: Super Contributor
timestamp: January 24, 2023, 01:38:06 am
content: QuoteI 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.