I am a new person with tinkering electronics as I am from Computer Engineering.

I am working on a project with an Arduino that contains of a relay. I researched from the internet and found out that a suitable relay configuration uses a transistor, a flywheel diode and a relay.

I used a 2N2222 transistor a 1N4007 diode and a 12V relay (SRD-12VDC-SL-C).

I used the following schematic:

Here is my Fritzing wiring diagram:

When I connected the circuit according to my Fritzing wiring diagram. the labelled NPN transistor blew up in smoke. When I readjusted some wires next the transistor on the relay blew up in smoke.

Please help me eith the circuit diagram as I am not able to understand it properly. I suppose the Fritzing wiring diagram is wrong.


  • Blue wire: data line from Arduino.
  • Red wire: VCC.
  • White wire: GND.
  • \$\begingroup\$ @P2000 Is anything wrong with it? I can't find it! \$\endgroup\$ Jun 23, 2020 at 3:34
  • 1
    \$\begingroup\$ Have a look at the wiring of the diode in the fritzing schematic. From where to where? Also look up the transistor's TO92 (the type of package) pinout to make sure you have the BCE terminals wired correctly. It would also help if you include what the 3 coloured wires to the relay's coil mean. \$\endgroup\$
    – P2000
    Jun 23, 2020 at 3:36
  • \$\begingroup\$ @P2000 The problem is that in the circuit diagram I am confused because there is not GND connection on the relay! the relay is just connected to data line from arduino and VCC. \$\endgroup\$ Jun 23, 2020 at 3:39
  • 2
    \$\begingroup\$ @Arpitking I think the circuit board with the relay is not just a relay. I think there is also a transistor and a flyback diode on that circuit board. Which means your circuit diagram doesn't match what you actually built. \$\endgroup\$
    – user253751
    Jun 23, 2020 at 11:48
  • \$\begingroup\$ @user253751 Yes i figured that out but the problem now is that the arduino is not triggering the relay. the LOW on the arduino should trigger the relay (as it is being triggered by touching IN wire to GND) but it is not triggering it. \$\endgroup\$ Jun 23, 2020 at 12:20

2 Answers 2


Most likely reason why your transistor has given off smoke is because you burned it out by exceeding its maximum current. This happened when you made the mistake of connecting 12V directly to collector of transistor and then turning on transistor in saturation mode (ie like closed switch). You essentially passed large current through transistor and shorted your supply at least temporarily. It would be helpful to know that for breadboard, horizontal lines starting from middle of board to each of the two longest sides of bread board are actually connected conductively. This is shown below. (Source: https://www.elprocus.com/a-brief-on-breadboard-basics-and-connections/). So in your circuit, you have shorted the 12V to collector terminal of BJT and have completely bypassed the diode, and relay. This is indicated in the green circle in last image.

Also I should point out that you should double check your relay to make sure it’s just a relay and not relay module. A relay module might already have a diode and added transistor, and in that case may just require a logic signal to turn it on.

enter image description here

enter image description here![enter image description here]

  • \$\begingroup\$ I am trying to understand your answer, meanwhile The relay module does not have a transistor or a diode I guess as it didn't turn on when I applied a logic signal to it. \$\endgroup\$ Jun 23, 2020 at 3:46
  • 1
    \$\begingroup\$ @Arpit king, if you connected your circuit just like shown in this Fritzing diagram, then what you did is you shorted your 12V supply to the collector pin of transistor. It’s basically connecting wire between them. When you turn transistor on and it acts like a switch( has low voltage across it and acts with low resistance), then you have large current because the load is actually just a wire. Your relay would typically limit the current to maybe 50mA max but a wire has practically zero resistance. \$\endgroup\$
    – Leoman12
    Jun 23, 2020 at 3:53
  • \$\begingroup\$ Yes I am starting to understand it now,but the blue wire I used is for the data logic signal to turn on the relay.What can I do then? \$\endgroup\$ Jun 23, 2020 at 3:56
  • \$\begingroup\$ I guess my relay has a transistor and a diode built in please @Leoman12 open this link(This is where I purchased it). The will try by turing it on with a logic signal now. [link]robu.in/product/1-roadchannel-relay-module-light-coupling-12v \$\endgroup\$ Jun 23, 2020 at 3:58
  • 1
    \$\begingroup\$ @arpit king, it state that you can drive the relay with 12V, ground, and a signal from arduino. You’d just connect data line to a arduino digital pin and control it directly. No transistor needed. \$\endgroup\$
    – Leoman12
    Jun 23, 2020 at 4:03

The relay module has an optocoupler, switching transistor, diode and other components on it. I think you need to provide 12V and GND across two terminals to power the module. Then you feed your Arduino GPIO into the screw terminal for the control voltage. Your Adruino should have output pull-ups enabled on that GPIO line if that's how those work on that micro.

I suspect you blew up the relay by connecting 12V to the control pin, which is rated for only 5V, or something like that.

The documentation on the relay module isn't all that clear so you'll have to keep playing with it to figure out exactly what's going on. From what I can see, if you apply 12V power across the pins to power the module and 0V to the control pin, an LED will light up. If you then apply 5V to the control pin, the relay will switch and the LED status will change.

  • \$\begingroup\$ Yes i figured that out but the problem now is that the arduino is not triggering the relay. the LOW on the arduino should trigger the relay (as it is being triggered by touching IN wire to GND) but it is not triggering it. \$\endgroup\$ Jun 23, 2020 at 12:21

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