Low-power AC presence detection? - Page 1
Forum section: electronics / projects

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 03, 2025, 07:17:02 pm
content: Hi everybody and a happy new year.I'm currently designing a controller for my two drainage pumps that keep my basement turning into an unwanted swimming pool.Both pumps are on their own circuit breaker, and I want to detect if that breaker has triggered. So, I need to detect whether AC is present.Now, there is the classic way of taking a big resistor, or capacitive dropper, and triggering an optocoupler. But that will constantly piss away a couple of mA. Something rubs me the wrong way to waste a couple of kWh per year just to detect if voltage is present. There must be a better way.I do have a current sensor in place that monitors the power consumption of the pumps and checks them against spec to detect a failing or blocked pump. But that only is useful if the pump is running, and that's not always the case. It runs 2-3 times per hour for a couple of minutes at most.So, what's a better and efficient way that doesn't use more than a couple of mW?

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 03, 2025, 07:39:41 pm
content: Putting something across the breaker probably violates a hundred rules. You can buy breakers with a mechanical interface to a reporting switch like the ABB S2C-H11L, but rebuilding the switchboard is not an option.I have three phases (breaker on each) going into my controller. L1 feeds the controller, L2 feeds Pump 1, L3 feeds pump 2.

author: ajb
author_rank: Super Contributor
timestamp: January 03, 2025, 08:08:31 pm
content: How low is low enough power for you? I think it will be tricky to get much better than a sensitive optocoupler. Maybe use a relay to only enable the ac-referenced measurement circuitry periodically to check if AC is present? Or do similar with a PV-output optocoupler to power some low power/high sensitivity detection circuitry on the AC-referenced side?

author: Benta
author_rank: Super Contributor
timestamp: January 03, 2025, 08:09:49 pm
content: Current transformer. No loss (except a bit in the burden resistor).But what you have on the secondary side is up to you.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 03, 2025, 08:44:54 pm
content: Quote from: ajb on January 03, 2025, 08:08:31 pmNot a bad idea actually. Will take that into consideration.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 03, 2025, 08:49:10 pm
content: Quote from: BreakingOhmsLaw on January 03, 2025, 07:17:02 pmYou can add some active parts to pulse that optocoupler, which slashes that average current.It gives one pulse per cycle, for simplicity. Feed to your MCU, or a monostable or a slow RC as neededHere is an example I did a while back, mains side rms of just 68uA and gives ~3mA peak into the opto.

author: bdunham7
author_rank: Super Contributor
timestamp: January 03, 2025, 08:55:32 pm
content: What is your detection system connected to? Does it need to be an optocoupler? IOW, what circuit or device needs to be informed that there is AC power and what sort of signal does it require?

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 03, 2025, 08:56:59 pm
content: Quote from: bdunham7 on January 03, 2025, 08:55:32 pmAn STM32 microcontroller, regular GPIO.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 03, 2025, 09:01:35 pm
content: Quote from: PCB.Wiz on January 03, 2025, 08:49:10 pmI gave that a thought. Might be even simpler by just using a 300V+ zener diode so it just conducts during a brief moment when the sine is at peak. Going to simulate that.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 03, 2025, 09:03:53 pm
content: Quote from: Benta on January 03, 2025, 08:09:49 pmI actually considered that, but I couldn't find one that has a sufficient isolation rating to ensure electrical safety.

author: xvr
author_rank: Frequent Contributor
timestamp: January 03, 2025, 09:16:47 pm
content: You can use oscillating circuit to reduce power consumption. Main idea of this circuit is to charge capacitor from rectified AC line with very very small current (via resistor). Next part of circuit is a dinistor (Shockley diode or analog) + optocoupler. When voltage across capacitor raised above dinistor threshold it open and discharge capacitor to LED part of optocoupler.Carefully selecting capacitor value and duty cycle of optocoupler signaling you can achieve almost any desired input (AC) current.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 03, 2025, 09:35:16 pm
content: Quote from: xvr on January 03, 2025, 09:16:47 pmAh yes. Haven't used a DIAC in anger for many, many years. Completely forgot about them.Something along the lines of this ought to give a pulse once per second, going to spice this.

author: Benta
author_rank: Super Contributor
timestamp: January 03, 2025, 09:40:00 pm
content: [ Specified attachment is not available ]Quote from: BreakingOhmsLaw on January 03, 2025, 09:03:53 pmWhat?They are available with isolation into the kV ranges. It's just an isolated blob whit a hole in the middle.Example:

author: inse
author_rank: Super Contributor
timestamp: January 03, 2025, 09:49:57 pm
content: Why not monitor the water level instead?That would report any failure in the whole system.

author: bdunham7
author_rank: Super Contributor
timestamp: January 03, 2025, 09:51:49 pm
content: Quote from: BreakingOhmsLaw on January 03, 2025, 08:56:59 pmAn LDA111 Darlington optocoupler has a typical control current of less than 100µA, so 12mW or 105Wh per year just using resistive dropping and a lot less with a capacitor. I suspect just your GPIO pin will use as much. The only other isolated method I can think would be to use an optotriac switched by the STM32 to supply the feed to the LDA111. This would use more power when activated but would not use any (other than leakage) when the STM32 wasn't polling the power supply. A really clever method might be able to do all that and still only use one GPIO pin...Still, I'd calculate out how much power a 100µ capacitor dropper with series resistor circuit would really use. 3mW or less and still having sufficient series resistance to protect against a shorted capacitor?

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 03, 2025, 09:53:19 pm
content: Quote from: Benta on January 03, 2025, 09:40:00 pmI see, I was thinking of something else.However, don't these usually transform the currentdown?

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 03, 2025, 09:54:23 pm
content: Quote from: inse on January 03, 2025, 09:49:57 pmI'm doing that too with a 190 Ohm level sensor. The values get sent to a Syslogd server and I can monitor the amount of water going into the drainage.However, when the water level is too high, both pumps have failed. A bit late for a warning

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 03, 2025, 10:07:09 pm
content: Quote from: bdunham7 on January 03, 2025, 09:51:49 pmNot a bad idea actually. It certainly would have the advantage that the "alive" signal isn't coming when the STM32 is sleeping. It could poll the status when its active.

author: Zero999
author_rank: Super Contributor
timestamp: January 03, 2025, 10:14:10 pm
content: Quote from: BreakingOhmsLaw on January 03, 2025, 09:03:53 pmIt should be easy. Nearly all current transformers I've seen have sufficient isolation to ensure electrical safety. Indeed, there are some where I work on 3kV bus bars and are connected to a device powered by 24VDC.

author: TimFox
author_rank: Super Contributor
timestamp: January 03, 2025, 10:15:43 pm
content: Quote from: BreakingOhmsLaw on January 03, 2025, 09:53:19 pmOf course, but they are designed to work with a reasonable burden resistor to develop a measurable voltage without a large power loss in the sensed circuit. The resistance is usually specified for the part. The primary can be one turn (single wire) while the secondary has many terms.For example, a 100:1 transformer with 100termination would insert only 0.01into the wire, and give 1 V rms at the resistor for 1 A rms current.

author: bdunham7
author_rank: Super Contributor
timestamp: January 03, 2025, 10:17:38 pm
content: Quote from: Benta on January 03, 2025, 08:09:49 pmHow would that detect voltage at times when there is no current (pumps are off)?

author: ejeffrey
author_rank: Super Contributor
timestamp: January 03, 2025, 10:27:26 pm
content: I'd say go with the resistor/capacitor dropper + rectifier + optocoupler. It's simple, safe, and reliable. A standby current of a fraction a milliamp is just not that much. Whatever circuit you have observing it on the secondary side is probably going to to have a few milliamps of mains current draw for it's power supply too. If you use a capacitor dropper it's going to be mostly reactive load anyway and a bit of extra capacitive reactance on the power lines is probably a net bonus.

author: Benta
author_rank: Super Contributor
timestamp: January 03, 2025, 10:32:10 pm
content: Quote from: bdunham7 on January 03, 2025, 10:17:38 pmWhy should it? The point seems to be monitoring if the pumps are running or not. Detecting the current will do that.

author: bdunham7
author_rank: Super Contributor
timestamp: January 03, 2025, 10:35:01 pm
content: Quote from: Benta on January 03, 2025, 10:32:10 pmHis first post states that he wants to detect whether the breakers are tripped. He also says that he already has current sensors on the pumps themselves.

author: Zero999
author_rank: Super Contributor
timestamp: January 03, 2025, 10:43:09 pm
content: Presumably this doesn't have to be fast? If a turn off time of a minute or so is acceptable, then how about a small mains powered switched mode power supply i.e. a wall wart? They typically have a very low standby power consumption. The downside is the smoothing capacitor will take a long time to discharge. Adding a load isn't an option if you want low standby consumption.

author: Benta
author_rank: Super Contributor
timestamp: January 03, 2025, 10:50:07 pm
content: Quote from: bdunham7 on January 03, 2025, 10:35:01 pmYou're right, I misunderstood the OP.I'll revise my answer to: a Neon lamp with a phototransistor on the STM32 GPIO. Has to be optically encapsulated.Can't get much more low-power than that.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 03, 2025, 11:06:58 pm
content: Quote from: ejeffrey on January 03, 2025, 10:27:26 pmYou are completely right, of course. But you know, I'm an electrical engineer, so it's just a matter of taking pride in my work and doing it right. I'm sure many here can relate.My design goal is a total average power consumption below 2W. And that will most certainly increase BOM cost far above what the savings in electricity are, even with electricity prices in Germany. (2nd highest in Europe after Denmark last I checked)

author: floobydust
author_rank: Super Contributor
timestamp: January 03, 2025, 11:15:11 pm
content: For any of a dozen reasons, the sump system can fail and the basement gets flooded which is very costly.Monitoring the breakers covers one scenario. My math a 1mA opto-coupler for mains-detect is $0.21/year operating cost. Less than powering the MCU alone, or spending $100 on engineering time to lower this electricity cost.A better system models and can show that the sump pump is not working - pumps not running, running too long, drain clogged etc. compared to water level detected.There is also a sewer or storm drain backflow valve to think about monitoring, but I am not sure what your country uses.Here we have those with reed switches. Low temperature (freezing) detection for when you are away on holidays and the heating system fails.Most times these are connected into the home security alarm system for remote-monitoring.I have sump pump data logs which show typical run time. Once a pump motor start cap failed, the motor did not run and you can tell after say 15 minutes the water level has not dropped down as it should, there is a problem.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 03, 2025, 11:31:06 pm
content: Quote from: floobydust on January 03, 2025, 11:15:11 pmMy controller will do a number of things. The complete system looks like this:I have two submersible pumps in the sump. One (primary) is suspended 10cm lower than the other, so that is the one usually running.The controller monitors for:- voltage present (breaker tripped)- Health of the pumps by checking both current draw of the pump and the speed at which the water level drops.- if the secondary pump goes active- water level of course.All of that gets logged to a Synology NAS running a Syslogd where it can be extracted with a Python script.When something goes wrong, I get an alert on my mobile.I built a controller some years ago with just relays and some current sensors, but that's getting an upgrade now.I'm not worried about he electricity cost, that's orders of magnitude below the power used by the pump. It's just taking pride in my work, and low power usually aids reliability.

author: floobydust
author_rank: Super Contributor
timestamp: January 03, 2025, 11:42:36 pm
content: When you do you expect a breaker to trip? The motors will have their own overload/thermal protection, first. If this activates, you won't know or you'll see AC power is present, contactor/relay activated yet motor current is zero.I think you have coverage for the first pump failing, the second pump covers that which halves the fault chances unless it's a common breaker.Some sump systems in North America have a battery/UPS backup because bad storms also cause power to go out.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 03, 2025, 11:58:25 pm
content: Quote from: floobydust on January 03, 2025, 11:42:36 pmI've had a pump fail with short circuit before (seal failed, motor filled with water). That's the reason why i moved them to separate breakers.

author: ejeffrey
author_rank: Super Contributor
timestamp: January 04, 2025, 12:40:26 am
content: Quote from: BreakingOhmsLaw on January 03, 2025, 11:06:58 pmThen use a capacitor dropper to drive the opto-coupler as I suggested. That will keep the heat down which is also good.Or do as Benta suggests, and build your own opto-coupler with a neon indicator and a photo transistor. That's going to end up higher power than a capacitor dropper, but still too low to worry about.

author: Benta
author_rank: Super Contributor
timestamp: January 04, 2025, 12:56:43 am
content: Quote from: ejeffrey on January 04, 2025, 12:40:26 amPerhaps.But the problem with cap droppers are that it's not just a cap. It's an inrush limiting resistor. it's a cap bleeding resistor (prolly not needed here), it's rectification (AC optocoupler or reverse diode could solve that).Mind you, I'm only talking primary side here. On the secondary, the OP already has an STM32 etc.Perhaps a combined cap/resistor drop neon lamp drive is the lowest power option? It just needs to "blip" the STM32 to signal "AC present".

author: DavidAlfa
author_rank: Super Contributor
timestamp: January 04, 2025, 03:11:16 am
content: How about a simple ac detector?Make some turns of wire over the live (Isolated) conductor as a pick-up antenna, connect to anything (mcu, monostable, logic gate, transistors...), add a tvs or zener to protect the input.The capacitor dropper can get really small, i.e. 100uA or even less, then use a large capacitor to build up energy.The mcu only needs to wake every 15 minutes or more, send a quick message and go back to sleep, that's a short power consumption pulse, making the average power extremely small.Or you can use a very small "keep alive" capacitor dropper, then switch to a bigger one when the device comes into operation, i.e. 50uA in sleep, 10mA when active.

author: floobydust
author_rank: Super Contributor
timestamp: January 04, 2025, 03:35:22 am
content: A capacitive sensor - a few turns of wire wrapped around the live mains wire over 5cm or more, some heatshrink tubing to keep it snug, connected to a CMOS gate (w/protection diodes) will work.Quote from: BreakingOhmsLaw on January 03, 2025, 11:58:25 pmI think it's not great way to go- monitoring mains voltage presence after the breaker.Instead, consider monitoring pump motor voltage presence- this tells you the breaker is closed, the contactor/relay is closed and S/W can notice motor current should not be zero (or really high for a long time) when the relay is closed.Then you don't need low-power AC detection. Just ideas I am putting out there for thought.I'm not a fan of modern neon lamps made in the one country, they don't last, hard to get over 10,000hrs out of them before they are flickering.A low power optocoupler likeMOC217<1mA a couple resistors+diode and it's 1/4W of waste, but not 24/7 if it's monitoring at the motor for only when it should be running.

author: inse
author_rank: Super Contributor
timestamp: January 04, 2025, 05:44:36 am
content: In my opinion this appears massively over engineered, why not keep things simple and just monitor the water level like this:Level 1: operating level of primary pumpLevel 2: sensor slightly above - warning, primary pump failLevel 3: operating level of backup pumpLevel 4: sensor slightly above (but still below flooding level) - ALERT, backup fail

author: floobydust
author_rank: Super Contributor
timestamp: January 04, 2025, 06:13:17 am
content: The difference between an alert and flooding happening when relying on the water level, is not enough.You want as much advance warning as possible that there is a problem. Because you might not be home, it takes time to fix things etc. and some failures can affect both pumps.The rate of climb water level increase is proportionate to the rainfall which is variable and unknown.I've seen a blocked discharge pipe, stuck check valve- prevent enough discharge from happening. Meanwhile the water level is going up. Looking at motor current tells you things are not right (it depends on the type of pump centrifugal etc.) for how they behave when the outlet is plugged up or frozen.In another happening, I had a humidifier supply tube break and water started going into the sump. It was not raining yet water level is going up and the pump cycling. That was baffling.

author: inse
author_rank: Super Contributor
timestamp: January 04, 2025, 06:27:38 am
content: Sorry, still not convinced as I have my own experience with groundwater flooding the basement.The drainage should be an installation that is simply reliable, invest in a quality pump with a decent level switch.All that monitoring won't help either if no one is at home.I stick to the KISS principle while others may prefer the KAMEL (keep at maximum engineering level ;-)

author: Sorama
author_rank: Frequent Contributor
timestamp: January 04, 2025, 07:24:51 am
content: Actually, the only thing you really should do is preventing water getting into the basement.From a building physics point of view, water in the basement is pure horror for the rest of the house.So one better analyze how the water gets into the basement.In 90% of the cases it is due to a lack of vertical water tightness of the bricks.If not that, check for any leaking drains.

author: SteveThackery
author_rank: Super Contributor
timestamp: January 04, 2025, 11:52:32 am
content: I've deleted my post about putting something across the breaker. It would work, but the safety issues are too much to give it serious consideration.

author: NiHaoMike
author_rank: Super Contributor
timestamp: January 04, 2025, 01:10:03 pm
content: If the two breakers are on the same phase, how about check the voltage between the circuits? Should be very small under normal conditions.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 04, 2025, 01:31:34 pm
content: Quote from: Sorama on January 04, 2025, 07:24:51 amNot an option unfortunately. The region I live in had coal mining. During that period, the ground water level was artificially lowered. When mining stopped, ground water level was returned to normal level. All houses built in that era have this problem. Ever single house in our street has a sump. The basement itself is dry, the sump sits under the house and collects the water seeping into the drainage.I'd have to tear down the house and rebuild it with a sealed foundation.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 04, 2025, 01:43:23 pm
content: Quote from: inse on January 04, 2025, 06:27:38 amThe pumps are autonomous. They are the type with floater switches, so that's as KISS as it gets. The controller just monitors the health of these pumps.What I'm looking at:- Has a breaker tripped, because a broken seal causing a short can and has happened.- is the water level dropping at the expected speed, to see if anything is clogged or the pump is jammed.- Is the pump drawing the expected current? A struggling pump will draw more power.- is the second pump (hanging 10 cm higher) going active? In that case, the first pump has malfunctioned.- check the water level and sound an alarm when it gets too high.All of that just serves a single purpose: Buy myself time when things go wrong.

author: Zero999
author_rank: Super Contributor
timestamp: January 04, 2025, 10:36:11 pm
content: You can't beat the opto-coupler solution, mentioned above.Here are two examples. U1 is an ordinary opto-coupler, with a bridge rectifier and resistor on the input. U2 is an AC input opto-coupler, with a resistor on the input.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 05, 2025, 02:03:59 am
content: Quote from: Zero999 on January 04, 2025, 10:36:11 pmNote the AC opto's tend to have worse CTR's, as neither diode is optimum placed.The 817 series optos are widely used, but they are rapidly falling in CTR below 1mA. You can offset that effect a bit, by spec of a PC817D, which is the 300~600 bin, for a slight nudge in price.If the diodes are placed after the 1M, ie across the opto diode, they can be SOT363 package small signal dual-series diodes.You can also pay a bit more again, and get low-current optos, that spec CTR at 500uA, here is a comparison

author: bdunham7
author_rank: Super Contributor
timestamp: January 05, 2025, 05:35:56 am
content: Quote from: PCB.Wiz on January 05, 2025, 02:03:59 amYou could also use two darlington optos with max CTR at ~100µA, connecting them in parallel but with one input reversed. No other diodes needed, just a smallish PP safety capacitor and a HV-rated resistor.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 05, 2025, 11:11:22 am
content: The optocoupler with capacitive droper may use a faraction of a mA, but most (e.g. 99%) of the current is reactive current and thus not power you pay for. Chances are one can get away with a small (e.g. class Y) capacitor of a few nF - that would be comparable or less than the EMI capacitors found in most electronics.

author: PGPG
author_rank: Frequent Contributor
timestamp: January 05, 2025, 02:20:50 pm
content: Quote from: BreakingOhmsLaw on January 03, 2025, 09:35:16 pmI'm just reading this thread.Reading the first post my first idea was something like this with DIAC, but using transistors in thyristor-like connection. When voltage at capacitor reach enough value thyristor switches on lighting the transoptor LED using charge from capacitor, but current shortly drops below value enough to keep it being on.When you reduce current from AC voltage not by resistor but by capacitor you get current shifted in phase with voltage and you consume imaginary power and not real power. Home electricity meters measure real power, not imaginary power.So my idea would be serial capacitor (with R to protect at first switch on) then diode bridge and charged capacitor and transoptor LED pulsed from this charged capacitor whenever voltage at it is enough high. Details to be worked out.

author: Zero999
author_rank: Super Contributor
timestamp: January 05, 2025, 04:30:29 pm
content: Quote from: PCB.Wiz on January 05, 2025, 02:03:59 amCTR-wise, it shouldn't be an issue, unless I've miscalculated something of course, as the data sheet is a bit confusing. The minimum CTR of the PD817C is 200% and IF= 240µA RMS, 340µA peak, so say the CRT = 20% of the minimum, that's 40%, yet the collector current is 50µA.I didn't do any calculations for the AC photocoupler. The model clearly shows a lower CTR because there's more ripple. I would strongly recommend the OP reads the data sheet, rather than relying on my circuits and the models I've used.I was thinking about using a bridge rectifier IC, rather than separate diodes. Good point about puting the resistor before the rectifier so lower voltage rating diodes can be used. It might make more sense to use two dual diodes, rather than a single bridge rectifier IC, because they can be found in smaller packages.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 05, 2025, 08:10:18 pm
content: Quote from: Kleinstein on January 05, 2025, 11:11:22 amQuote from: PGPG on January 05, 2025, 02:20:50 pmNot any more, with smart metersyou can be charged more for reactive power.https://www.linkedin.com/pulse/understanding-reactive-energy-your-electricity-bill-kamarlouei-rdnif#:~:text=You%20pay%20for%20both%20types,on%20their%20reactive%20energy%20consumption.Summary table from that link : Power Factor (cos α)Scale 1: Power factor between 0.93 and 0.95Scale 2: Power factor between 0.89 and 0.93Scale 3: Power factor less than 0.89Scale 1 Multiplier: 0.33Scale 2 Multiplier: 1Scale 3 Multiplier: 3That's why modern SMPS use power factor correcting stages. They do not add all those parts for fun!

author: bdunham7
author_rank: Super Contributor
timestamp: January 05, 2025, 11:35:11 pm
content: Quote from: PCB.Wiz on January 05, 2025, 08:10:18 pmAnd if you are, having a capacitive load would save you money in most cases.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: January 11, 2025, 02:18:05 pm
content: I'm quite surprised at the amount of attention this "simple" topic has gotten. Thanks to everybody for chiming in.Anyway, here's the schematic I am currently testing:That works as intended, it produces a pulse every 1,2 seconds:That pulse is not clean however, it starts to oscillate once the capacitor reaches the end of its charge:It's not easy to measure true RMS for this, but we can do some simple math to evaluate the power consumption:A 22nF capacitor that charges up to 250 Volts holds a charge of 687µJoule.That happens every ~1,2 seconds, so that's about 573µJoule/second, which is 573µW. Not too shabby, that's nearly two orders of magnitude below the classic 1MOhm / opto combination.I'm doing a bit more tinkering to get rid of the oscillation, as this would retrigger the interrupt pin on the MCU several hundred times. A monostable vibrator probably is overkill.

author: Zero999
author_rank: Super Contributor
timestamp: January 11, 2025, 03:20:19 pm
content: Yes, that will work, but isn't it a bit overkill?Bear in mind, if it's too lower power, then there's risk it can false trigger.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 11, 2025, 05:01:43 pm
content: Quote from: PCB.Wiz on January 05, 2025, 08:10:18 pmFor larger supplies the PFC part is just a requitement by law. The small ones, like low power charger are essentially all without. It they don't need the PFC part they happily skip on it. They anyway don't care what the user pays for electricity.

author: ejeffrey
author_rank: Super Contributor
timestamp: January 11, 2025, 05:49:22 pm
content: Quote from: BreakingOhmsLaw on January 11, 2025, 02:18:05 pmJust have the MCU disable pin change interrupts on the first falling edge and re-enable them on a timer. You don't need to even see every cycle, you can sleep for 1 second at a time.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 11, 2025, 07:09:30 pm
content: Quote from: BreakingOhmsLaw on January 11, 2025, 02:18:05 pmCurious.Can you zoom into that region, to check the frequency/duty cycle changes ?Maybe some dV/dT trigger effect, but those are high value resistors.The problem with a part that self-oscillates (wrongly) is it can vary widely with PVT and the worst outcome would be for it to hit a stable spurious operation I/V duty cycle that was outside the Photo detector switching.Instead of the many edges you see now, you would see no edges at all.

author: jbb
author_rank: Super Contributor
timestamp: January 11, 2025, 07:47:19 pm
content: Maybe there isn’t enough current through D4 to hold it on? The datasheet mentions a holding current of 140 mA or so.Perhaps fitting a 1k load resistor from D4 output to NEUT would help? It would need to be pulse rated or maybe made of several in series. This would shorten the output pulse to something like 10us but that’s still detectable by a microcontroller.

author: none
author_rank: Contributor
timestamp: January 12, 2025, 09:29:27 am
content: Alternative: a small transformer excited on the secondary and shorted by a MOSFET on the mains:https://electronics.stackexchange.com/a/634883.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 12, 2025, 09:45:26 pm
content: Quote from: BreakingOhmsLaw on January 11, 2025, 02:18:05 pmYou could try lowering that 10M, or change to a 36V 10uA DIAC, like the SMDB3. ( also lowering the 100k, to ~ 8.2k)That 10M is rather too high to guarantee the needed 10uA trigger into that SIDAC (280V max) on 10% low mains.For 10% low mains test, and allowing 12uA for margin over the 10uA trigger, I find these resistors are needed :280V SIDAC 1.2Meg Ramping current RMS 34.593µA36V DIAC 22Meg Ramping current RMS 5.8713µAie the 36V DIAC is lower power.

author: voltsandjolts
author_rank: Unknown
timestamp: January 12, 2025, 10:18:42 pm
content: I recall that line triggering in the TDS3000 series scopes used a very simple sensor; a piece of wire about 4" long heatshrunk alongside the incoming live wire.

author: Zero999
author_rank: Super Contributor
timestamp: January 12, 2025, 11:24:59 pm
content: Quote from: BreakingOhmsLaw on January 11, 2025, 02:18:05 pmI don't see the need to go for such a low power consumption.To put it into perspective:The losses in a 1.5mm25m cable, two cores, phase and neutral, so 10m conductor length, with a current of 5A is 3.3W.https://www.macartney.com/connectivity/subconn/technical-information/conductor-resistance-of-copper/EU regulations state standby power of new devices needs to be under 500mW.Using an opto-coupler with a 1M resistor and a power supply voltage of 230V is a power dissipation of 53mW, which is probably similar the leakage due to electric fields in the cables going to your pump. Your design will cut that by a factor of 20, but you're well beyond the point of diminishing returns and it's clearly creating other problems.