I want to control a 12 V relay using an Arduino 5 V signal, but due to some unknown reason the relay does not work. I am using a BC548 transistor as a switch for relay.enter image description here Please suggest where I go wrong.

closed as off-topic by Juraj, sempaiscuba, VE7JRO, MatsK, Greenonline Feb 21 at 17:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about Arduino, within the scope defined in the help center." – Juraj, sempaiscuba, VE7JRO, MatsK, Greenonline
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    issue aside, you need a flyback diode to save your NPN. Does the relay trigger if you feed the NPN +5v instead of a GPIO output? – dandavis Feb 19 at 17:17
  • I have added flyback diode in actual circuit forget to add in diagram. – Akshay Okate Feb 19 at 17:19
  • yes the relay works when I give 12v to base – Akshay Okate Feb 19 at 17:19
  • what about 5v, like the AVR would provide? – dandavis Feb 19 at 17:21
  • i didn't tried it but It only works when i give higher than 5v – Akshay Okate Feb 19 at 17:25

If it's working with 12v on the input but not 5v, it sounds like the base resistor value (which is missing from the diagram) might be too high. A value of around 1k should ensure the transistor is fully switched on.

Not the answer you're looking for? Browse other questions tagged or ask your own question.