0
\$\begingroup\$

Using this circuit as a proof of concept to run a 12v motor off a 12v wall wart and ultimately use the 5v from the 7805 to power a Particle Photon through Vin pin. This circuit is letting the smoke out for some reason though when the switch is closed.

enter image description here

\$\endgroup\$
11
  • 1
    \$\begingroup\$ What is the motor characteristics? What is this transistor? \$\endgroup\$
    – Eugene Sh.
    Aug 14 '17 at 21:24
  • 3
    \$\begingroup\$ No decoupling caps on the 7805? Also, why the 7805 in the first place? Why not just a resistor to the base via the switch? Add 2222A to the original question, not in the comments. Can you lower your 1 kohm resistor and try again? \$\endgroup\$
    – winny
    Aug 14 '17 at 21:32
  • 4
    \$\begingroup\$ Can you draw the transistor schematic correctly and verify your transistor connections? It shows PNP but 2N2222A is an NPN. Also, if you have emitter and collector backwards, then the gain will be very low and could result in blowing the 2N2222A. Basically, you have to make sure you drive the NPN to saturation. Also, good if you can measure voltage between the collector and emitter as quickly as you can before it blows. This will tell you if you are indeed driving that transistor to saturation. It should measure 0.4V or less. If connections are OK, 5 mA base current may not be enough. \$\endgroup\$ Aug 14 '17 at 21:48
  • 2
    \$\begingroup\$ Missing freewheeling diode across the motor? Driving an inductive load like a motor or a relay can subject the transistor to nasty reverse voltage transient effects, which can damage or destroy the transistor. Also the 2N2222 is really undersized for driving even a toy 3V motor. Maybe check sparkfun or adafruit for motor driver boards, either as purchase or as DIY inspiration. You'll definitely need a heatsink. \$\endgroup\$
    – MarkU
    Aug 14 '17 at 22:41
  • 2
    \$\begingroup\$ "...draws 200-300 milliamps (I think)." Beware! a motor that 'normally' draws 200-300mA may draw 5 times that on startup. You need a transistor that can switch at least 1.5A, and sufficient Base current to get it. \$\endgroup\$ Aug 14 '17 at 23:26
5
\$\begingroup\$

OK, let's start with your schematic. In order to have even a hope of working, your schematic must look like

schematic

simulate this circuit – Schematic created using CircuitLab

Let's assume your 7805 is working correctly (although you should measure it to be sure). Then the base current should be about 4 mA. For a fully-saturated transistor you can figure on a gain of about 10, so if the normal motor current is 40 mA or so you'd be in good shape. But of course, your motor is not 40 mA. Instead, you think it's 200 to 300 mA. Worse, that's probably when running. As has been commented, if the rotor is not moving, you can figure on something like at least 5 times as much - let's figure on 1 amp. Then in the circuit shown, the motor resistance can be modeled as about 12 ohms.

The first thing you should notice, on page 3 of the data sheet is that this is probably more than the absolute maximum current the transistor is rated for, so even if you drive the transistor successfully you'll likely be in trouble. But it's unlikely that this particular issue is your problem.

Let's say that, since the transistor is not saturated, it is operating at a gain of about 100. Then the collector current will be about 400 mA. The voltage drop across the motor will then be on the order of 0.4 x 12, or 5 volts. This will leave 7 volts across the transistor, and the total transistor power dissipation will be 7 x 0.4, or 2.8 watts.

Go back to the data sheet, and you'll see that this is about 5 to 6 times the absolute maximum power for this transistor. This really should be a clue that your circuit won't work.

So. First, you must measure the DC resistance of your motor. Use a standard meter and don't let the rotor turn. This determines the current you must switch. It also gives you an idea of the size transistor you need. And never, never assume you can run a component like a transistor at absolute maximum - it's a really good way to kill components when you do something you didn't figure on. In this case, get a transistor rated for twice the expected current. Now, find a transistor which will handle the current.

Assuming you're using a BJT, figure your base current is the motor current divided by 10. Size your base resistor appropriately.

And in the future, if you want advice, don't guess what your circuit needs - measure it.

ETA - It seems likely that you do not have a DMM (Digital MultiMeter). Get one. No arguments, no complaining, no whining. Just do it. You can get them cheap on eBay, although I'd stay away from the really cheap Chinese versions. Until you can measure voltages and currents in an operating circuit, and measure resistances in components, you are operating blind as to what is going on. END EDIT

\$\endgroup\$
5
  • \$\begingroup\$ Wow. A great in detail answer. Could you throw more light on "So. First, you must measure the DC resistance of your motor. Use a standard meter and don't let the rotor turn. This determines the current you must switch. ". \$\endgroup\$
    – MaNyYaCk
    Aug 15 '17 at 2:33
  • \$\begingroup\$ @MaNyYaCk - See edit. To measure motor resistance, set the meter to ohms and connect the probes to the motor wires, then read the resistance. To calculate current, divide power supply voltage by motor resistance. \$\endgroup\$ Aug 15 '17 at 2:42
  • \$\begingroup\$ bad idea with lossy switches that saturate with low gain of 10~20. Use an Nch FET \$\endgroup\$ Aug 15 '17 at 2:46
  • \$\begingroup\$ The motor should use a resistor and inductor in series to best represent it. \$\endgroup\$
    – Jason Han
    Aug 15 '17 at 2:47
  • \$\begingroup\$ switch must be ~1% of motor DC R for 99% effic. in a Nch switch with reverse diode. Otherwise use a power darlington NPN \$\endgroup\$ Aug 15 '17 at 2:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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