This circuit is using a capacitive power supply, which cannot be discussed on AAC according to the ToS.
D2 is a zener diode clamping the voltage for the low voltage part to 15V.
If you use instead of C5 a small transformer and a rectifier after it your control circuit can be made galvanically isolated from mains and we will be able to help you.
Even worse you will be using 230V. When testing a circuit like this you would need to be very careful to not get electrocuted when inverting the input.
I am closing this thread as it violates AAC policy and/or safety issues. When dealing with power supplies you must use a transformer.
Quote:
6. Restricted topics. The following topics are regularly raised however are considered “off-topic” at all times and will results in Your thread being closed without question:
Any kind of over-unity devices and systems
Automotive modifications
Devices designed to electrocute or shock another person