I would try putting a smoothing capacitor across the power lines to both the esp32 and the PIR sensor.
Also you can turn off brownout detection on the esp32 although this would not solve the problem, just hide the symptom.
I would try putting a smoothing capacitor across the power lines to both the esp32 and the PIR sensor.
Also you can turn off brownout detection on the esp32 although this would not solve the problem, just hide the symptom.