I am building a small home automation system, and one node has a PIR to detect motion, and a Relay Module to control a 240v light with a Raspberry PI 3.
The PIR is connected to 5v, and has a resistor bridge on the data line to connect it to GPIO 12.
When I connect the Relay Module to the 3.3v, and to GPIO 13, I can control the relay, but after a few days, the PIR starts to falsely trigger every 2 minutes.
I get the feeling that the Relay has been wired up incorrectly, but not sure of the solution. I suspect I will have to connect it to the 5v power pin, but then I will need a transistor bridge (not sure of the resistances needed) on the GPIO out to toggle it (at the present 3.3 output, it doesn't trigger the relay when powered on 5v). I was under the impression that as it was a module, it would have most of the necessary components built in, but possibly not.
I can see a diode on there and some other components, but I'm not sure if it takes care of switching on a different voltage (3.3v on a 5v circuit), but as it appears to work on a 3.3v circuit, it be sufficient. But given the fact that the PIR is having issues suggests that it is not getting enough power.
Can anyone recommend how to wire it up properly?