Problems with setting up an H Bridge to control DC motor

Discussion in 'The Projects Forum' started by Kevin Shaughnessy, Feb 3, 2013.

  1. Kevin Shaughnessy

    Thread Starter New Member

    Jan 2, 2013
    10
    0
    Hi,

    I'm trying to build a little robot car with the motor controlled by using an H Bridge triggered by an arduino. I've set it up so that the H Bridge consists of 4 BJT't of the 2222a variety. I've tried using a 6 volt batter pack as the supply to trigger the base, and I needed to use 55 ohm resistors to allow enough current to flow to the motor. Considering it's current output is much greater than the arduino, it seems I would have difficulty getting the right output from one. Is there a flaw in my circuit design? I'm not sure how I can get enough current/voltage to the motor through a transistor setup using an arduino.

    Thanks,

    Kevin
     
    Last edited: Feb 3, 2013
  2. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    I'm not saying it's a good design, but 1Amp/20mA = 50, not 500.

    MOSFETs would probably be better.
     
  3. Kevin Shaughnessy

    Thread Starter New Member

    Jan 2, 2013
    10
    0
    D'oh.

    I think I need to admit that I'm new to transistors. I just did some googling and found out about Darlington pairs. So basically the solution might be to just keep adding transistors until I get the desired current output?

    I like the idea of MOSFET's but I have none at hand. Plus there's something to be said about doing things the hard way as far as learning goes.
     
  4. tubeguy

    Well-Known Member

    Nov 3, 2012
    1,157
    197
    You really need much higher current transistors, or better yet Mosfets.
    With a motor that needs 'at least 1A' the startup current would be more than that. You could use the 2n2222's to drive higher current transistors.

    EDIT: Something doesn't compute. If you were using 55 ohm resistors in series with a motor drawing 1 amp, the drop would be 55 volts. Are these base resistors?
     
    Last edited: Feb 3, 2013
  5. Kevin Shaughnessy

    Thread Starter New Member

    Jan 2, 2013
    10
    0
    Yes, the 55 ohm resistors are from power to base. I didn't use any resistors connecting the C or E of the transistors to power/ground.
     
  6. tubeguy

    Well-Known Member

    Nov 3, 2012
    1,157
    197
    Please post a schematic of your circuit.
     
  7. Kevin Shaughnessy

    Thread Starter New Member

    Jan 2, 2013
    10
    0
    Come to think of it I probably measured the amperage wrong, I put my probes directly into the breadboard instead of measuring the current through the motor, if that makes sense. Here is the schematic:

    Sorry, I tried posting it directly but the site is reformatting it. It's the same as the second schematic http://electronics.stackexchange.com/questions/7235/motor-driver-using-only-a-2n2222-transistor here, but with 55 ohm resistors and 6v power supply.
     
  8. tubeguy

    Well-Known Member

    Nov 3, 2012
    1,157
    197
    Here's an example circuit:

    Mosfet N-P Bridge 1.GIF

    This circuit uses N and P channel Mosfets. You could substitute NPN and PNP transistors for the respective Mosfets. This circuit eliminates the chance of accidentally shorting the supply to ground which is a possibility with the circuit you posted.

    55 ohm resistors are allowing too much base current. To saturate or turn on a transistor fully a rule of thumb is to use a base current 10% of the maximum collector current. If the 2n2222 can sink 500-800ma max then 50-80ma is needed. Too much base current can damage a transistor.
    Edit: But the Arduino can't supply that anyway. If the Arduino supplies 20ma at 5v then the base resistors should be 4.3/.02 = or 215 (220)ohms

    One reason Mosfets are suggested is that they have a low On-resistance so a bit less voltage is wasted plus less heat is generated in them.

    You should measure the motor stall current to accurately determine the required current capacity of the transistors/Mosfets.
     
    Last edited: Feb 3, 2013
  9. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    Kevin, that circuit of yours can't possibly work. Where is the base current for the upper transistors (1 and 3) going to come from? If all you can offer is a 6-volt level, then you've got the voltage drop through the resistors before the load. The more voltage drop in the resistors, the less there is to drive the load. You would need PNP transistors on top and NPN's below to make this work.

    Tubeguy's circuit looks risky. Is there a possibility that by connecting the gates on each side together (except for 47 ohms on each) the two transistors might be on at the same time during switching? You have to be very careful with sequencing the "on" times in a circuit like this.

    If I wanted an H-bridge I'd get on Google and look for a design where someone else had done all the work and made all the mistakes, and finished up with something that worked.
     
  10. Kevin Shaughnessy

    Thread Starter New Member

    Jan 2, 2013
    10
    0
    This is good stuff, thank you. MOSFETs are out of my price range right now so I'll definitely sub them with some higher current transistors. I'll have to look over that schematic you posted some more as I'm not sure I understand it as well as I do this one that I found: http://www.talkingelectronics.com/projects/H-Bridge/images/Design20Bridge.gif

    Do you think that one would work? The TIP transistors allow from 1-3 amps and the BC's are up to 100milliamps.
     
  11. Kevin Shaughnessy

    Thread Starter New Member

    Jan 2, 2013
    10
    0
    That makes sense, thank you. I'm not too worried about shorting the circuit though as I could program a delay into the arduino. Could you give me your opinion on the circuit I posted above?
     
  12. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    That circuit on the Talkingelectronics site looks a lot better! The top transistors, the TIP32's, are PNP's, so you sink current to drive the bases instead of sourcing it from a higher voltage. But it's drawn to run from a 12v supply, so if you want to run it on 6V, you might need to reduce the resistor values to get the same currents to flow.
     
  13. tubeguy

    Well-Known Member

    Nov 3, 2012
    1,157
    197
    Yes, the Talking Electronics circuit looks good. If you have 2n2222's use those instead of the BC's so you can drive the TIP's with something like 200 ma on the base to better saturate them on. The TE circuit even at 12 volts drives them with only about 76 ma with a 5v signal from the Mcu.

    John P has a valid point in that during the switching transition there is a point for example when the switching signal is 1/2 V+ where both transistors are partially on. Fast switching times reduce this issue. A delay wouldn't be needed.

    But, the TE circuit also has similar points as the switching signal moves from OFF to ON.
     
  14. Kevin Shaughnessy

    Thread Starter New Member

    Jan 2, 2013
    10
    0
    I just finished up the circuit from TalkingElectronics.com and it works great. I even used a 6v power supply and didn't even alter the resistance values, still getting great speed from the motor. Thanks very much for all your help guys. Now if only I had remembered to buy enough transistors for 2 circuits!
     
Loading...