I have a zigbee sensor outside that provides one of my external temperatures and motion detection on the porch. My lights are normally at 20% at night and brighten to 100% when motion is detected. The batteries keep draining fast and the sensor often falls off the network even though I installed a Zigbee outlet one wall away. I decided I would opt for a powered ESP32 based sensor instead that will provide temperature, humidity, pressure, and motion detection using an HFS-DC06 microwave sensor.
This is where issues start…
If I power the sensor at just above 5V using a benchtop power supply (both transformer and switching based) it works as desired. If I power it via a LM2596 buck converter (see image below) that reduces 12V to 5.2V it works as intended as long as the NodeMCU ESP32 is NOT installed.
I know most will say it is WIFI but I am not sure that is the case. If I place the sensor right next to the ESP32 but power it via the benchtop power supply it works just fine so it is something that is coming through the common 5V but it is not the buck converter itself.
Please excuse the terrible picture (courtesy of the terrible camera on the S20 ultra). The diode you see on the bottom takes the output from the buck converter and connects it to the NodeMCU. I also added a ferrite core with 4 loops (totally random, this is where I am looking for help) and placed it between the diode and the ESP32. There is also a tantalum 104 cap between 5V and GND very close to the ESP32 pins. None of this helped… except when I changed where I get power of the sensor… before I was getting it AFTER the diode, but when I take it BEFORE the diode it is way better if not actually working. It is hard to verify when I am in the room as it picks any movement I make up so I will test it overnight.
The diode introduces a voltage drop of 0.7V so by getting power before the diode the sensor is receiving just under 6V. I have tested this voltage with bench top power supplies and it is fine for the sensor. I would exclude a voltage related issue.
Assuming the diode fixed the issue, can any electronics guru tell me why? I do have a scope (200MHz max) so if I can use it in any test please let me know, I have lost a bit of practice with it so details would help.
Unrelated, but some may wonder, the BME280 is housed in a modified cable gland:
There are two layers of foam between the inside of the enclosure and the sensor. To keep out bug I used a thin nylon net.
Back to the issue - what could be causing the sensor to give nearly rhythmic false positives when both the ESP32 and the sensor are powered taking voltage after the diode? Why does it appear to improve or solve the issue if the sensor is powered prior to the diode and the ESP32 after the diode? I think I have already excluded wireless interference and voltage.
Again sorry for the terrible picture… but this is where the contraption will be mounted:
I have 12V there and will screw it in the 3/4 inch hole on the side of the box.