Re: pi and passive infrared sensor
Hmm.. let's test a couple of things:
Connect the sensor's VCC and GND pins to the RasPi, but disconnect the jumper between the sensor's OUT pin and the RasPi. Repeat the same sequence you've already done, testing it without the code running, then running the code.
With no connection to the RasPi, you'd think the sensor will continue to behave normally, but let's verify that.
At the same time, let's see what that GPIO pin is doing. Make a voltage divider between the RasPi's 3.3v pin and GND with a couple of 10k resistors, then connect the GPIO pin to the center of that divider. Without the GPIO pin connected, the voltage at the center of the divider should be 1.65v. Check that during the part of your test before you run the code, then check again after you start running the code. If there's an internal pull-up or pull-down resistor connected, you should see some change in the voltage at the center of the divider. If you have 100k resistors, those will make the change even more visible.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.