I needed a simple circuit to control a DC Motor. I could have used relays or a DPDT switch but I wanted it be solid state so that I could use it with my embedded controllers.

I am building a X_Y_Z plotting machine called the Side Hill Gouger. You can read more on that project by checking out my circuits pages and clicking anything that says Side Hill Gouger.

With this plotting machine I need to control 3 motors so I wanted it to be pretty standard

In the picture on the left I put it in a box that I made from recycled plastic. Take a note on how I did this by checking out my circuits page.

As you can see from the picture. I simply have a power indicator and a button to go up and a button to go down in this particular case. There is a led to indicate that there is power to the motor and if it is indeed moving up/down.

You still have to run a few wires into the box to make it work but they are quite simple.

+12 Volts and Ground is from the power source. I used a decent sized 12Volt battery. The Box has a built in regulator that takes the 12Volts and puts out 5 Volts for whatever one needs it for. The Up and down signal is a TTL compatible logic level. I have set it up so you can't tell it to go up and down at the same time as this is not a good thing to do both for the dumb motor who will totally not know what to do and the driver board inside that would turn into a burnt piece of toast. And finally two wires go to the DC motor to supply the 12Volts at the right polarity.

This particular control box will only run a 12V DC motor at about 5 amps max because of the heat sinks inside. It also has no fuse protection whatsoever. So if you jammed the DC Motor it would draw as many amps as it could from the battery, and if you had a big 100 amp battery running the outfit you would have a mighty smoky room with more burnt toast.

It was not without problems making that PCB shown on the left. It had been years since I had designed and etched a printed circuit board. I don't know if I will do another for some time it is too much work.

A couple of things to note are that when you have a good stock of surplus parts you can make a good heavy duty circuit that won't blow up and cost you a lot of money. The new MOSFET Transistors are phenomenal parts to use. They have lots of power and are logic compatible. Of the (6) TO220 packages 5 of them are MOSFETS. The 6th TO220 is a bipolar power transistor. All of these were removed from surplus computer monitors. Also note the heat sinks are pulled from surplus equipment. It is essential to have your driver transistors on a heat sink. I also like to use the molex connectors from computer power supplies as you are always needing to run a couple of wires somewhere from the PCB.

 

In the schematic on the left you can see the four MOSFETS the drive the motor. (A) and (C) ON will put a (-) on top of the motor and a (+) on the bottom . (B) and (C) ON will put will put a (+) on the top and a (-) on the bottom of the MOSFETS. Thus you are effectively reversing the (+) and (-) leads on the motor to run in one direction or the opposite direction. Two leds across the motor will alternately turn on according to the polarity across the motor.

Note that (B) AND (C) are P-MOSFETS and (A) and (D) are N-MOSFETS.

You must insure that only one pair of these MOSFETS are turned on at a time. If you turn on both sets you get a dead short across the battery and lots of smoke. Thus I put in a logic gate inverter and the driver transistor called FWD/REV. This works great but with this arrangement by itself the motor is always running in one direction or the other direction depending on the condition of the FWD/REV transistor.

To solve this problem of the motor running all the time I simply turned off the (+) Voltage to the P-TYPE MOSFETS effectively taking the power away from the motor. The TIP107 is a N-TYPE Bipolar Power Transistor and is turned on or off by the IRF640 Power Mosfet. It was overkill but you can do that when you have a good stock of surplus parts. The inverter gate and the Motor ON/OFF transistor simply turn the MOSFET on and off.

The 74HC04 inverter is running at 12V Vcc because I wanted a full voltage to turn the MOSFETS on and off. The driver transistor for ON/OFF and FWD/REV were needed because I wanted to have logic signals that were TTL compatible as this was the levels that are coming from my embedded controllers.

So one would have to have 2 buttons one to turn on the motor and then while the motor was running you would be able to push the second button to go forward or reverse.

A little work has to be done to get rid of that two button push thing to make the H-Bridge run the motor. A TTL nand gate and a 7805 regulator will do the trick. I just stuffed this little perfboard inside the box and run the wires from the front panel switches and the power Led. I also ran the wires out to the back of the box for the TTL level inputs for REV and FWD.The resistors are the pullups for the nand gates and the capacitors are standard ones that I always put across regulator IC's.

Always wires to be ran somewhere. There were nine wires going out to various locations for this little operation.

When are we going to get high tech enough that we can go wireless for everything electronic. That will be cool.

The schematic on the left is simple but I remember it took me a while to figure out the logic. You had to put a high on the run line so the motor would turn on then depending on what direction you wanted to go either a high or low on the REV line. In both cases the RUN had to be high. Like pushing two buttons at once. I used up all four gates on the 74HC00 which is Cool. No wastage there with spare gates sitting around.

A low from the UP button or from a controller will output a high on the REV signal and a high on the FWD signal and the motor will get power and run in one direction. A low from the DOWN p-button puts a low on the REV signal yet keeps the high on the FWD line. Thus the motor will run in the opposite direction.

The 7805 regulator runs the Vcc for the 74HC00. It doesn't show on this schematic but I have a LED across the output of the regulator to show we have 5 Volts and it also shows there must be 12Volts available for the Motor too. I always put a 0.47uF capacitor across the inputs of regulators and a standard 0.1uF across the output.

The only real problem with this little circuit is that if you did have it connected to a microcontroller of some kind when you push the button on the front panel you are forcing the output of the controller into a state it doesn't like. I think microcontrollers are protected against this but it just doesn't seem like a nice thing to do. An OR gate in front would solve this problem but it would be another IC to wire up.

In this circuit which I haven't actually constructed I eliminated the logic IC. It should work fine. I always want to use an IC when I have logic to deal with on's and off's. I could probably eliminate that two button push thing too with a couple of transistors. I think in the future I will experiment around on this subject.

I constructed another H-Bridge controller for my Side Hill Gouger which is quite fancy and I ended up using 5 logic gate circuits. It works great. Again if you have a lot of surplus parts real cheap why not use them. You might want to check it out, I called it a digital H-Bridge Controller.

There is a problem in that the P-MOSFETS need a ground to turn on. When you try to run a 24 Volt DC supply for a 24 Volt motor, you just can't seem to get that good ground you need. I fixed it in my enhanced version for the Side Hill Gouger. At any rate this particular design was for a 12 Volt DC Motor and it does that job.

Another couple of problems you may encounter will be with the characteristics of a DC motor. A locked rotor is where the DC motor is jammed. In this case it will draw excessive currents trying to move. It will take as much as is available. If you run this circuit off a high capacity Battery you will get smoke. So a fuse would be in order for the main supply line for safety. Another characteristic of a DC Motor is that it's dual nature is to be a generator. So don't tow a electric powered vehicle such as a car or a golf cart. Disconnect the power to the control circuit first. If you don't as you tow it the motor generates a voltage and your digital circuits will get what they don't want.

Revised 2013 by Larry Gentleman