I want to use raspberry pi GPIO pins to control a few relays. I was planning to use a 3904 NPN transistor with a 330 ohm resistor on the base of the 3904 and a fly back diode across the coil of the relay (just as shown in the attached image). My questions are: would it be more efficient power consumption wise to drive the relay with an MOSFET or power resister? And will I destroy an NPN 3904 transistor over time if I use it in the circuit shown below? I see people using BC transistors (like a BC 141) instead of an NPN transistor like I described.