1
\$\begingroup\$

I was previously using a 2N2222A transistor with a small dc motor and it worked fine. As soon as I used it to control the 3A motor, The circuit stopped working.

Is there any way I could control the motor with 3.3v from a Node MCU?

(P.s. I did not use a diode in parallel with the motor, would that be the reason on frying my transistor?)

This is my first project and I'm very new to the world of electronics, any help would be amazing!

\$\endgroup\$
5
  • \$\begingroup\$ It's 0.5A switch at best !! Try a switch rated for a 10x (3A) surge \$\endgroup\$ Jan 29, 2019 at 7:23
  • 1
    \$\begingroup\$ It depends on a whole lot of things, you question is too broad to answer. In case of PWM, switching time for example. MOSFET are ideal but often slow at switching. 2N2222A is rated at 0.6A so there's no wonder it got fried. Gotta read the datasheet. In addition, there might be reverse EMF and transients coming back towards the driver circuit. Some manner of fast free wheel diode is needed. \$\endgroup\$
    – Lundin
    Jan 29, 2019 at 7:25
  • 1
    \$\begingroup\$ Note that a "3A" motor may well have a stall current in the region of 15A. Check its datasheet and choose teh switch accordingly. \$\endgroup\$
    – user16324
    Jan 29, 2019 at 8:24
  • \$\begingroup\$ @Lundin What type of MOSFET would be accused of being 'slow'? SMD type can work up to 2 MHZ. Even the large module types can switch at 500 KHZ. Granted this is not HF RF territory, but this is just being used as a ON/OFF switch. \$\endgroup\$
    – user105652
    Jan 31, 2019 at 1:23
  • \$\begingroup\$ @Sparky256 For PWM drive, that may or may not be enough. Keep in mind that it must be able to drive quite a bit of current too. \$\endgroup\$
    – Lundin
    Jan 31, 2019 at 7:39

2 Answers 2

6
\$\begingroup\$

You fried your little 2N2222A transistor because you exceeded it's maximum current ratings! If you take a peek into the datasheet, it shows the absolute maximum current.

enter image description here

Okay so the datasheet claims 800mA, but that's assuming you are able to keep the device cooled to T(A), which you can see is 25C (room temp). That's a whole another story though. In general, with a 2n2222A, you don't want to switch currents more than 500mA.

Let's find you a better component to switch your motor on and off (or varying speeds!). A quick search on Adafruit reveals the IRLB8721. Behold the N-Channel MOSFET! If we take a peek inside its datasheet, we can see that it will switch a max current of 62A. This is also assuming we can keep the chip cooled to T(A) = 25C, and a few other things as well. Since you are only needing to switch 3A, you'll be well within its ratings and won't have to worry about your MOSFET.

enter image description here

You mentioned you would like to switch the motor with 3.3V from your Node MCU. Let's check the datasheet again:

enter image description here

You can see V(GSth) is rated for a gate voltage of 1.35 to 2.35V. So wouldn't your NodeMCU's 3.3V be too high? If you check in the previous image, one box above the red encircled box reveals that the absolute maximum gate voltage can be +/-20V, so put a resistor between your Node MCU's pin and the gate of the MOSFET. What value? Well selecting a properly valued resistor for a FET can quite difficult to calculate, so most of the time for projects like these we tend to use a 1K resistor, or a 2K2 resistor if you have some handy.

You might be wondering why I chose a MOSFET that can switch so much more current then what your project requires. These FETs are just easy to come by, and will provide a very nice safety cushion for your system. As Brian pointed out, the motor could have a stall current as high as 15A, so this FET will easily handle job.

How do you wire it all? A quick search for "N-Channel MOSFET used as switch" on Google turns up this. Photo taken from: enter image description here

I know you don't have an Arduino but the principle is the same. Pay careful attention do the Gate, Drain, and Source of the MOSFET. The diode can be like a 1N4007 (pretty standard).

AddOhms on YT has an excellent video on how to use MOSFETs, I highly suggest you watch the video!

You said you were new to the field of electronics- welcome! It's a lot of fun. I tried to keep this answer on the simpler side yet informative. You should be wired up in no time.

A popular logic-level FET is the IRLZ44N.

Good luck with the project!

\$\endgroup\$
8
  • \$\begingroup\$ Thank you for answering, But why doesn't my IRF520N n-channel MOSFET work when connecting everything as shown in the schematic? (it has a threshold voltage from 2-4v) \$\endgroup\$ Jan 29, 2019 at 19:25
  • \$\begingroup\$ That is not a logic level MOSFET. If you check the datasheet, it says V(GS) 2-4V @ 250uA, which is almost nothing. In order to get your 3A to work with that FET, you would have to at least power it with 5.5V. See figure 3 of the datasheet, and track the 25C line. At 4 volts it's hardly letting any current flow, 3.3V would be even less. \$\endgroup\$ Jan 29, 2019 at 21:00
  • 1
    \$\begingroup\$ I would stongly suggest to amplify the voltage through a darlington circuit: You drive 3V to the gate of a small mosfet with it's drain connected to the 12V line through a 10K resistor, which will control the gate of the high power mosfet. When the power mosfet will get 12V at its gate it will conducts much better than at 3V. Pay attention that each mosfet invert the signal polarity. Adjust the software accordingly. \$\endgroup\$
    – Fredled
    Jan 29, 2019 at 21:53
  • \$\begingroup\$ If the power mosfet gets burnt by too much stall current, start current, back EMF and so on. So a mechanical relay may be necessary. The base of the relay can be controlled by the darlington circuit. \$\endgroup\$
    – Fredled
    Jan 29, 2019 at 22:01
  • \$\begingroup\$ example of a darlington circuit: petervis.com/electronics%20guides/polonium%20detector/… \$\endgroup\$
    – Fredled
    Jan 29, 2019 at 22:03
0
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

This circuit can work. There is also proteus simulation nearly same circuit so you can examine it. Basicly Rload change motor in this circuit. enter image description here Also you can download this circuits proteus simulation from here.

\$\endgroup\$
4
  • \$\begingroup\$ Since the OP is a newbie, you should explicitly state that adding a level shifter of this sort will also change the polarity of the output. A high from the MCU will turn the motor off, and a low will turn it on. \$\endgroup\$ Jan 30, 2019 at 16:26
  • \$\begingroup\$ Beg pardon? By inverting the level, you also invert the effect of PWM (a PWM with mostly high output will produce a low motor drive, and vice-versa). For a processor with built-in PWM generation this will give results opposite of what was intended. \$\endgroup\$ Jan 30, 2019 at 17:35
  • \$\begingroup\$ You are right man. its my mistake. Polarity is important when using PWM. So i delete my wrong comment against any misunderstanding. But there is one more mistake too. My circuit doesn't change polarity. You can see when input signal(green) is high(5V), output signal(red) is high(32V). I re-simulated my proteus simulation for control this when i used %70 duty cycle for input signal. I saw %70 duty cycle for output signal in the simulation. \$\endgroup\$ Jan 30, 2019 at 17:57
  • \$\begingroup\$ Yes, but when the output voltage goes high, the load current will go to zero. Or, to put it another way, the voltage across the load will go low. Having a high voltage across the FET does the motor no good. \$\endgroup\$ Jan 30, 2019 at 18:11

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