Digital PIR sensor reads high most of the time


I have been using a digital PIR sensor with Arduino MEGA 2560 (connected to D4) and it has been working fine. It reads high when it detects a presence and low otherwise.

I added a UART sensor device recently to my Arduino MEGA (Connected to RX0 and TX0). I have noticed that the PIR sensor behavior has changed since then. It is reading high most of the times now (even without any presence). This happens even without any code change (meaning, even if i use the same code as before, just an additional UART device on RX0 and TX0 is causing a behavior change to PIR on D4)

I have checked for short circuits using multimeter, but couldn’t find any. Confused.

Serial0 is used by the onboard USB-interface.

Hi, this is a customized version of mega 2560, so we are not using serial0 for USB. And the UART sensor works fine on Serial0.