It will be because the relay is designed for 5V and the Pi GPIO is 3.3V.
It depends on the details. Your relay module seems to have a transistor on it. 5V at the input would turn it off, but 3.3V may not be enough to do that.
If you disconnect the relay from the GPIO pin and then connect the IN pin to 5V, 0V and 3.3V you will find the relay is on with input 0V or 3.3V and off for 5V.
The voltage on the gpio pin won;t go above 3.3V, Whether on high or configured as input. That probably means 5 - 3.3 = 1.7v across VBE on the transistor which is enough to turn it on.
Either:
1. Get a relay module designed for 3.3V input
2. Drive the relay IN pin via a transistor
3. modify the relay board resistors so that the transistor will not be on at 3.3V input. (definitely NOT recommended unless you are proficient soldering SMD and know what you are doing!)
It depends on the details. Your relay module seems to have a transistor on it. 5V at the input would turn it off, but 3.3V may not be enough to do that.
If you disconnect the relay from the GPIO pin and then connect the IN pin to 5V, 0V and 3.3V you will find the relay is on with input 0V or 3.3V and off for 5V.
The voltage on the gpio pin won;t go above 3.3V, Whether on high or configured as input. That probably means 5 - 3.3 = 1.7v across VBE on the transistor which is enough to turn it on.
Either:
1. Get a relay module designed for 3.3V input
2. Drive the relay IN pin via a transistor
3. modify the relay board resistors so that the transistor will not be on at 3.3V input. (definitely NOT recommended unless you are proficient soldering SMD and know what you are doing!)
Statistics: Posted by PiGraham — Mon Feb 17, 2025 9:47 am