I have already implemented this wiring to connect my RPi B+ and a Sainsmart relay by using a BC 547 B transistor.
I have two issues with this implementation:
- Without the 10K resistor it works great, but when I add the 10K resistor into the circuit the relay doesn't work anymore.
- When the PI is off (sudo halt) or booting the relay turns on which can cause unintended consequences. But it also depends on which GPIO pin is using. While PI is turned off the relay turns on if connected to pin4, but doesn't turn on if connected to pin17.