PIR sensor is a device that detects movement by receiving infrared radiation. It detects a rapid change in infrared energy…