I don’t have a PIR sensor to fiddle with … however, why are you setting pin 3 HIGH, and as an OUTPUT? If it’s to power the PIR sensor board, don’t, use either pin 1 or 17, those have a constant 3v3 on them (or if you know your sensor can tolerate 5V, use pins 2 or 4). If it’s to read from the PIR sensor, it needs to be set as an INPUT pin so it can detect when the sensor triggers it.