Controlling DC motor (2 directions) with 4 transistors?

Hi,

My goal: to control speed and direction of a DC motor without an h bridge circuit, and just by using transistors

I've almost succeeded in achieving this. The motor is spinning around in two directions (with a pause between each spin).
The problem is, I'm loosing way too much voltage somehow.

I'm using a 12v 4,2A power supply, but when I measure my voltage at one side of the motor it gives me readings of maximum 4v..

I have 4 irf520 transistors which are paired together in two pairs. The code is made so pair one (for direction 1) and pair two (for direction 2) is never turned on at the same time.
Here's a picture with description of my setup:

And here's the code:

int ledPin1 = 5;      // LED connected to digital pin 9
int ledPin2 = 9;


void setup()

{

  pinMode(ledPin1, OUTPUT);   // sets the pin as output
  pinMode(ledPin2, OUTPUT);

}



void loop()

{
  digitalWrite(ledPin1, HIGH);  
 
      delay(2000);
  
  digitalWrite(ledPin1, LOW);

      delay(2000);

//  digitalWrite(ledPin2, HIGH);  
 
  //    delay(2000);
  
 // digitalWrite(ledPin2, LOW);
  
   //   delay(2000);
}

So I figured there's gotta be something in my transistor circuitry that is somehow draining a lot of current, or in some other way preventing the full potential of the 12v supply.

I know you'll probably say that I should connect diodes like this: http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies_files/shapeimage_10.png
But I've already tried that, and it doesn't do anything better as to my drop-in-voltage issue.

Any clues and ideas are very welcome.

Thanks

Søren

I have 4 irf520 transistors which are paired together in two pairs.

Do you have a schematic of your setup? First problem is the MOSFET transistors you are using are probably not logic level, so 5v from the arduino won't control them well. Second, do you have a charge pump circuit to drive one pair of the transistors? DIY h-bridges generally don't work well, if at all.

What you're trying to achieve would be a H-bridge circuit. You can buy Arduino shields and compatible boards providing this, but there's no reason not to make your own if you want to tackle the electronics yourself. I can't tell whether the circuit shown in your picture is correct, but you could Google H-bridge driver circuit to see how it's supposed to look, and also look for the circuit diagram for standard H-bridge drivers (I guess there will be some published schematics somewhere).

Also measure the voltage drop across each of your transistors when it is supposed to be fully 'on' and compare that against the expected forward voltage drop for that transistor type - it may be that you are using an unsuitable transistor type, or not turning it fully on.

zoomkat:

I have 4 irf520 transistors which are paired together in two pairs.

Do you have a schematic of your setup? First problem is the MOSFET transistors you are using are probably not logic level, so 5v from the arduino won’t control them well. Second, do you have a charge pump circuit to drive one pair of the transistors? DIY h-bridges generally don’t work well, if at all.

Here’s a simple schematic. It’s not professional, but it should be pretty obvious and clear.

I have used the irf520’s before with solenoids, and 5v seemed to work fine back then so I don’t understand if it isn’t enough now. I don’t know what a pump circuit is? Is this really necessary?

When I measure between GND and the source terminal, I get 12v, but when I measure between GND and the drain, the voltage has dropped down to around 3v.

Is it really not possible to make a simple arduino-controlled H bridge with 4 irf520’s like this??

That circuit won't work, as you observe. The arduino output voltage is not high enough to switch the two transistors with drains attached to +12V. For the IRF520 you need a gate-source voltage between 2 and 4 volts to switch on, but the motor attached to the sources of those transistors has a significant (unknown) voltage drop.

jremington:
That circuit won't work, as you observe. The arduino output voltage is not high enough to switch the two transistors with drains attached to +12V. For the IRF520 you need a gate-source voltage between 2 and 4 volts to switch on, but the motor attached to the sources of those transistors has a significant (unknown) voltage drop.

So I need to take my multimeter and measure the voltage drop between gate and source of the irf520? And this value has to be between 2-4v for the gate to open?

Can I use a voltage drop measurement between GND and source for anything? I thought that was how I measured the voltage that the motor would get, after the transistor.

i tried doing this circuit on breadboard with a 12v dc supply for the motor: Bipolar Transistor HBridge Motor Driver - Robot Room

it didnt work though. started smelling burned pretty quickly.
i'm really amazed it should be so difficult to achieve this relatively small task

Well, you do have to understand how the various parts work, in order to design a successful circuit.
Why not study successful published designs first?

soeren:
i'm really amazed it should be so difficult to achieve this relatively small task

It's dead simple if you use a chip that's designed to do exactly that......

i'm really amazed it should be so difficult to achieve this relatively small task

DIY h-bridge project.

http://forum.arduino.cc/index.php?topic=53425.0

JimboZA:

soeren:
i'm really amazed it should be so difficult to achieve this relatively small task

It's dead simple if you use a chip that's designed to do exactly that......

Yeah I know, I just really want to be able to build it in whatever shape i feel like. Plus it's a nice feeling to know what's actually going on instead of hiding it away inside an IC.

And thank you zoomkat for the post-link. That's very helpful and exactly what I'm looking for