Hi, i found this handy circuit and the very helpful Alex Pikkert when searching for a solution to my problem. im trying to trigger a wifi connected switch when the house current is interrupted. i have a ups to run the circuit from (12v output) and the input of the wifi switch is a momentary switch (a longer press puts it into setup mode)
so, your circuit which takes an input state change, and outputs a pulse is ideal.
i have modified a mains sensing circuit i used before, which has an optoisolator and a big resistor for sensing mains current. its been working fine in the current circuit for almost a year, and i have spares.
the output needs to drive a small relay to keep things nice and seperate from the wifi switch.
i have built what i think should be a version of your circuit, with my optoisolator on the input, and a transistor output to drive the relay in LTspice, but it basically just doesnt work.
i get nothing on the output for the first 2.5 seconds, then the output latches, and stays latched. input doesnt affect anything.
i need to figure out how to upload a screengrab of my ltspice simulation, but i hope i can get some advice from the horses mouth so to speak.
going on holiday in a week and it seems the power drops out every time we go on holiday and we come back to a smelly fridge!
edit:hm. new user, cant upload an image