Motion sensor false alarms after battery change

I tried replacing batteries in the old one and bought another to try and same thing occurred with the false motion detection. I thought the same thing about the sensor being defective or needing replaced but it kept failing even with the new one.