I can't get the relay to work in my example. Transistor gets really hot.
When connecting&disconnection relay wire between diode and transistor and I can hear soft click from relay. But when changing digital pin output high/low then relay doesnt react.
Best Answer
If you are using a 2N3904, then you have it the wrong way round, notice the emitter is at the left (flat side facing):