i do not agree with the resistor to V+.... trigger works when activated... we detect high level... so in this case when there's no trigger PIR is floating, resistor must be put to ground.

AND the above code i post is already waiting for trigger release.

regards