1
\$\begingroup\$

So I want to drive a motor from a handheld drill/screwdriver. And I have managed to get it going using the first schematics, and using pwm to control the speed. First SchematicsThe Zener diode is there to protect the mosfet, and in turn the arduino (as I understand it). No problem so far (afaik) ;)

Now my question is how to "safely" drive this backwards. I am quite certain that the 2nd schematics will work safely, and the Zener diode will still protect the Mosfet. However this requires two relays: 2nd Schematics

Is it possible to do a protection circuit that would work with only one relay that switches between +12V and GND as per the third Schematics: 3rd Schematics, Relay should be connected to Arduino similar to 2nd schematics

Schematics 2 and 3 would make it work similar to a HG7881/L9110 but managing larger loads.

As usual, thanks in advance :)

\$\endgroup\$
  • 2
    \$\begingroup\$ I wonder how did you make it work? You have drawn the MOSFET backward. You should read this guide for drawing a good schematic. \$\endgroup\$ – Long Pham Mar 10 '19 at 10:35
  • 1
    \$\begingroup\$ You also have the battery polarity shown incorrectly. \$\endgroup\$ – Andy aka Mar 10 '19 at 10:36
  • 2
    \$\begingroup\$ and you're probably looking for an H-Bridge. Does what you need, without the relays. Something like the DRV8870. Easier, safer and cheaper! \$\endgroup\$ – Marcus Müller Mar 10 '19 at 10:43
1
\$\begingroup\$

What you're looking for is called an H-Bridge:

Now, you've got about half of that in your plans! Pretty cool you came up with it :)

Good news is that you don't have to build this yourself using relays and discrete transistors: The motor control problem is so common, there's loads and loads of ready-made H-Bridge ICs and H-Bridge controllers you can buy. For example, the Texas Instruments DRV8870.

DRV8870 functional block diagram from datasheet

As you can see, the chip contains the four switches (as NMOS FETs). All you have to do is connect the motor, the motor supply voltage (12V in your case), ground, and two inputs from your arduino. The RSense resistor and VRef is used to determine how much current you want to limit the current going through your motor (and thus, limit its force). That's an optional feature.

You'll actually need two inputs, because, wild guess: you not only want to turn your motor for- or backwards, but maybe sometimes also stop turning, or even brake. You can't have three or four operational states with just one binary pin, so you'll have to devote two.

You already do so, effectively – the pin that goes to the gate of your MOSFET is the "is it running or not" pin!

There's a table in the datasheet that tells you how to control. It's easy: 1,0 is backwards, 0,1 is forwards, 0,0 is brake (and 1,1 is let just coast/disconnect).

You can, by the way, still have the PWM ability: simply PWM the pin that would be "1" in the desired direction – you'd be alternating between the breaking and the turning state, which is exactly what you want.

\$\endgroup\$
  • \$\begingroup\$ Thank you, I will look into this one. I tried the HG7881 which was rated at 12V 1A but I believe that wasnt strong enough for the motor I use, that is why I went with a powerful mosfet (still got quite hot though). Thanks for the tip, and I will look into this IC. \$\endgroup\$ – Sourcery Mar 10 '19 at 11:28
  • 1
    \$\begingroup\$ In actuality, finding an H-bridge to operate such a motor may be a little challenging and expensive; while they exist, you are on the edge of the power regime where the most economical solution may to be a speed controlled (ESC) for a radio control car. Make sure you get a brushed ESC, and that is is reversible, for a car, and not unidirectional for a plane (the ESC will of course use an H-bridge internally, but typically one made of whatever discrete FETs were cheap last month) \$\endgroup\$ – Chris Stratton Mar 10 '19 at 17:37
  • \$\begingroup\$ @Chris Stratton that is kind of what I felt using the HG7881, as it was rated juuust within range, and magic smoke did arise when trying it out so... I will look into ESC aswell Thank you. \$\endgroup\$ – Sourcery Mar 10 '19 at 17:52
  • 1
    \$\begingroup\$ Good luck. Also remember to look at the system overall - while handheld screwdriver motors are cheap, they're in a voltage/current regime where driving them is expensive. A higher voltage lower current motor/gearbox might cost more, but end up being cheaper overall to support. \$\endgroup\$ – Chris Stratton Mar 10 '19 at 17: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.