DIY MOSFET Motor Controller

64,511

540

40

Introduction: DIY MOSFET Motor Controller

This is a simple to build motor controller. It is handy for many projects using a motor controlled by a micro-controller. It can be used as an Electronic Speed Controller (ESC) and has forward and reverse control. It can be used in robotics, remote control projects, portable vehicles and most things motorized. It also uses very little parts. All of this is made into a tiny package to fit in your DIY projects.

This circuit is based off of a Driving Bigger Loads circuit in one of my books. That circuit only used one MOSFET and a diode. It is meant for a micro-controller to control a motors speed. To be able to go in reverse I just added a DPDT relay and another MOSFET, diode pair to control the polarity switch. I hope you enjoy this instructable.

Step 1: Tools and Materials

This Motor driver is very simple. Because of it's simplicity it uses very little parts.

Materials:

  • Perfboard - use any perfboard that you have or like
  • Thin Wire - I used a 24 gauge solid core wire
  • 2x Power MOSFETS - I used the IRF510 but any equivalent such as the NTE2382 will do
  • DPDT 30v Relay - the one in the pincture above is incorrect
  • 2x Rectifier Diodes
  • Pin Strip - use a kind that you can snap off little increments from

Tools:

  • Soldering Iron + Solder
  • Hot Glue Gun + Hot Glue
  • Wire strippers/cutters - make sure they can be used as pliers
  • DREMEL - use any tool you like for cutting the perfboard

Step 2: Assemble the Pieces

Place all of the components onto the perfboard. Place them so that you can easily solder the circuit to the schematics diagram shown above and still fit neatly onto the board. For the pin strip just snap off a 2 pin increment and a 4 pin increment (You do not have to do the 2 pin increment if you wish to solder the motor directly to the circuit). Cut the 2 pin increment shorter on both sides and using you wire strippers bend the long end of your 4 pin increment at a 90 degree angle. If your wire strippers do not have this function just use an extra set of pliers.

Step 3: Solder the Components

After placing all of the components onto the perfboard. Solder the circuit to the schematics diagram shown above. You can use any soldering iron and solder that you prefer. Use the part leads to connect two close leads and jumper wires to connect far ones. For the jumper wires use your wire strippers to cut and strip the ends of a small piece of wire. Use them to solder two distant leads together. For the perfboard I found the ones with copper work best for this compact circuit soldering but bare perfboard is cheaper. Also in this step you can also solder the motor strait to the board or use the 2 pin increment as I did. My finished circuit is shown above.

Step 4: Cut Out the Circuit

For you to use this in small systems such and controllers or robotics the next thing to do is to cut out the circuit. I cut to the size of the circuit I made but you can cut it to any size that you want or for different functions. Just make sure that you keep the circuit functional. Cut the perfboard from the bottom so that you can cut below the control and power pins. Use the DREMEL or any small saw to cut it out. I found the DREMEL to be the easiest tool to cut the perfboard but use any means you please for doing the job. In the end make sure that the control and power pins are able to be pluged into a breadboard or other circuit.

Step 5: Tidy It Up

Now just add the finishing touches and tidy it up. Shorten the remaining wires that stick out. Use the wire strippers to cut off the protruding wires. You can also use the pliers end of the wire strippers to bend the wire back and forth until it breaks off the end. Make sure not to break any solder joints using this method. After that plug in the hot glue gun. To make sure this circuit does not short circuit use the hot glue gun in a zigzag pattern to cover the circuit. The finished product should look like the image above. This should then keep the circuit from short circuiting and to further insulate and protect the circuit.

Step 6: Use It

Now it is time to use your new motor controller. If you have designed and built it like I have than this should be easier and you can just follow the layout above. If you have placed your pieces differently or soldered the circuit together differently than just look at the schematics layout above. Either way make sure you look at the schematics diagram above.

Setup With a Micro-controller:

  • Plug or connect your motor to the motor pins on your motor controller.
  • Insert the motor controller into a breadboard.
  • Using two colored wires connect the Vin to your micro-controllers Vin pin And the GND to the GND pin.
  • Using two more colored wires connect the speed and reverse to two digital pins of your choice.
  • Now just program away.

Safety:

  • Make sure that you do not exceed 30 volts at Vin.
  • Do not mix up the pins.
  • If you decide to go over 15 volts connect the Vin and GND directly to the source and connect the Ground to the Micro-controllers GND.
  • When working with more power try attaching a heat sink to the MOSFETs.
  • Only use DC two wire motors.

Thank you for reading my instructable.

Soldering Challenge

Runner Up in the
Soldering Challenge

Summer Fun Contest

Participated in the
Summer Fun Contest

Be the First to Share

    Recommendations

    • Puzzles Speed Challenge

      Puzzles Speed Challenge
    • "Can't Touch This" Family Contest

      "Can't Touch This" Family Contest
    • CNC Contest 2020

      CNC Contest 2020

    40 Discussions

    0
    Mickey The Maker
    Mickey The Maker

    Question 4 months ago

    How am I meant to code it for a adrinio,
    please answer soon.
    Thanks.

    0
    zeropt
    zeropt

    Answer 4 months ago

    It's been a while since I've built this and I don't remember how well it worked. It looks like It needs two signal pins. One is the throttle. You could send a PWM signal to that one to vary the speed of the motor. The second pin is direction. This requires a simple digital signal, LOW for one direction, HIGH for the opposite, forward and reverse. I would probably recommend a full h-bridge is you have the parts. I'm pretty sure there are pre-built Arduino libraries for these. Good Luck with your project!H-bridge MOSFET voltage drop - Electrical Engineering Stack Exchange

    0
    Mickey The Maker
    Mickey The Maker

    Reply 4 months ago

    Your relay,what voltage is it.

    0
    zeropt
    zeropt

    Reply 4 months ago

    I think it's 30V max. I don't remember what I ran it at.

    0
    doctormarkglickman
    doctormarkglickman

    4 months ago

    This is an interesting circuit. The author only used only two MOSFETs for a motor driver that allows a change in the direction of motor rotation. I think the MOSFET might need a heat sink and heat transfer paste.

    0
    Kaurska07
    Kaurska07

    Question 2 years ago

    how much current can it handle and volts?

    0
    AndrewA167
    AndrewA167

    Answer 7 months ago

    The current and voltage handling will depend on the MOSFET (Q2 for speed control) and relay you use; the MOSFET for relay switching (Q1) isn't important for this, it just needs to be able to handle the current and voltage needs of the relay coil.

    The IRF510 can handle roughly 5A (Id) up to 100 volts (Vds) in steady mode, but if using pulses (PWM) the current can go up to about 20A (Idm) if the pulses are small enough (high enough frequency); still, derate the current by about half for safety.

    You could probably push that 4A or so (steady mode) or 15A in pulsed mode (with proper heatsinking) and drive on the gate (check the datasheet), though you may need to implement a better way to drive the gate as the 510 isn't a "true" logic level MOSFET, so while 5V will get it to "turn on" (see Vgs) it won't carry the same amount of current as if it were gated with 10V. In such a case, you could use a true logic-level MOSFET, or a bipolar transistor to switch 10V to the gate.

    MOSFETs can be paralleled (unlike bipolar transistors) to share a load if you needed to handle more current, but gate capacitance increases doing this, and you may need to drive the gate with a higher voltage to compensate. Usually, it's better to use a single beefier MOSFET with higher current handling and lower resistance (Rdson) - note that so-called "logic level" MOSFETs have extremely low resistance at 5 volts (micro to milliohms), which is something you want in such devices, whereas 10V MOSFETs like the 510 have a higher resistance, which necessitates the higher gate drive voltage.

    All of this is pretty complex, but can be deduced from the datasheets for the MOSFET in question. Do a lot of research on how all of this plays together, you'll eventually get a feel and understanding for it.

    Note also that you can't build a simple "all N-Channel MOSFET" h-bridge (unlike this hybrid design) without a proper "high-side driver" design; such a design can be built from discrete components, but usually it's better to just use an off-the-shelf high-side driver IC (or a half-bridge driver IC to control both MOSFETs on a side). Ultimately, though, unless you plan on trying to learn how to successfully build MOSFET h-bridges, you very well could burn thru (literally) hundreds of dollars worth of MOSFETs just in learning - in such cases, it's cheaper to just purchase a high-current motor controller than it is to try to design and build one on your own, unless you either have the experience, or are working with a proven design.

    This design, as presented here, is a "hybrid" system that uses a relay for directional control, and a low-side N-channel MOSFET for speed control. As such, it is best to not switch the contacts of the relay without setting the PWM to zero (0). If you leave the PWM running, your relay will experience arcing across the contacts, which could damage them and/or weld them together. Just something to keep in mind with this kind of system. These hybrid designs are easier to work with, if you don't mind the relay electromechanical element.

    Finally, note that the DPDT relay can be substituted with two SPDT or four SPST relays; there are also so-called "reversing relays" which usually consist of two SPDT relays in a single package. I'm letting you (and others) know this because such relays typically allow for much higher current handling possibilities. In fact, there are large relays of this nature (called "contactors") that are used for winches and similar systems on vehicles that can handle 100-200 amps of current, and are designed for such DC motors used in those. Smaller systems, like seat positioners and such in automobiles, can get by with more standard automotive relays (ie "Bosch" relays - which are a brand, but are commonly known by such name) capable of carrying 20-40 amps across the contacts (at 12-24 volts usually).

    0
    jgh59
    jgh59

    5 years ago on Introduction

    Very simple design - I like it. You list two diodes in the materials list but I only see one in the schematic and one in the photos - am I missing something? I can think of many uses for this, thanks so very much.

    0
    Mister Gears
    Mister Gears

    Reply 9 months ago

    the second diode is under the board

    0
    Sattison
    Sattison

    1 year ago

    Great project.
    I was really looking fpr something like this. I was looking for something to get my dual gate opener motors in sync,Using a pwm control. Found this instead. It was very informative. Great job!

    0
    Abhi909
    Abhi909

    4 years ago

    great project

    can i place your project on my website.

    i'm working on a website which is related to electrical projects.

    i also mention your name.

    plz reply

    0
    zeropt
    zeropt

    Reply 4 years ago

    Sorry I couldn't reply sooner. Yes you can put this on your website but please do not post my name. Thank you and your web page sounds like a great project.

    0
    NorbertoB3
    NorbertoB3

    Reply 3 years ago

    i am looking forward to taking this design and coding my own rc vehicle one day, i will be looking in my tacle box for some mosfets and that box thingy, i have a few of those from salvaged hardware...

    0
    AndyM6
    AndyM6

    Reply 4 years ago

    hey zerop. Great, great instructable, but could you tell me what relay you are using?

    please answer, its important to me Thank you!

    0
    jstone33065
    jstone33065

    3 years ago

    can you set up the forward and reverse on this circuit with 2 momentary buttons to activate the forward and reverse with a simple press and release of the momentary..i need a constant back and forth motion triggered by momentary buttons if possible

    0
    ArkyaC
    ArkyaC

    4 years ago

    What is the safe current limit for this circuit? Will it be able to work with a stepper motor that draws a max current of 2 amps?

    0
    supernoodle2014
    supernoodle2014

    Reply 4 years ago

    I am not curtain but I believe that 2-3 amps would be the max for this without a heat sink on the MOSFETs.

    Also stepper motors require a different kind of driver then this.

    0
    anuj1993
    anuj1993

    4 years ago

    Hey, nice work.

    I was wondering if you could help me with a motor controller for 36V -30amps PMDC motor of around 600W rating