Greetings!
I had some pieces around, and decided to make a battery powered, low power, switch notifier - pantry door got opened and such. Using an ESP8266 ESP01-S module. I've used the module before, and I am aware of its shortcomings, and that it's not really intended for this usage. But it had worked for me. This time though conditions are different, and I got stuck.
I will most likely ditch this setup. But if you think I can do a minor change (add a diode, a cap) to salvage it - I can try. However, my main goal with this post is to get some help in understanding what's happening.
Latching relay:
https://api.pim.na.industrial.panasonic.com/file_stream/main/fileversion/263704The "Yellow" and "Pink" tags refer to the oscilloscope probes.
Using a PNP transistor on GPIO2, which starts HIGH. Program makes GPIO2 LOW to open the transistor, and activate the relay.
This is how I started:

This works. The relay is two coil latching one. L1 closes and L2 opens S1. L1 is activated by the external switch, and L2 - by the MCU when it completes its task. At the end no power is consumed. The problem is if S2 is kept closed for whatever reason, L1 pulls a good 220mA. Sub-optimal. I figured I enforce some "pulse" switching for L1.

Part of it works as expected. L1 activates, and if the S2 is kept closed only small current is pulled from the battery via R2 (~12mA). The whole thing is short lived, so it's acceptable. However it doesn't "live". I hear the relay clicking twice, and the MCU not powered. At about 50ms GPIO2 starts jittering. A well known deficiency. It will return to HIGH after 50ms or so. And when it hits LOW it activates L2, which powers off the MCU.

I figured I add a capacitor to "keep" the jitter at HIGH.

In the above I added the single C9, but I tried two positions - C9A and C9B. Not much difference. The relay buzzes for less than a second, and nothing turns on.
This is what I am seeing with C9A:

And this is with C9B:

What is going on? Notice that these pulses start way before the GPIO2's "native" jitter. The MCU doesn't get to that. Adding the C9 somehow unbalances the whole R2-C3-L1-L2-D1-T1-C9 chain... I would appreciate any explanation.
Disclaimer: There's a small chance I may have mis-identified the oscilloscope images.
Thank you for any comments.
tjk
