Go Down

Topic: making my own h bridge (Read 11535 times) previous topic - next topic

heyarn

hi everyone,

I'm trying to make my own h bridge. im actually trying to test 1 part of the circuit, and im trying only one direction at the moment. the way i have it hooked up is: battery + side to collector of 1st 2N3904, then emmitter of 1st 2N3904 to motor, then motor to 2nd 2N3904 collector, then 2nd 2N3904's emitter goes to ground. Finally, the ground from my battery is linked to my arduino's ground.

My theory is that i can tie the 2 bases together, then power it with the arduinos 5v, and the circuit should be completed. However, it's not working and I don't know why.

Has anyone experienced this before?

Thanks!

zoomkat

There have been previous attempts a DIY h-bridges in he forum, all of which ulimately did not work.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

boredat20

#2
May 02, 2012, 08:11 am Last Edit: May 02, 2012, 08:16 am by boredat20 Reason: 1
Quote
There have been previous attempts a DIY h-bridges in he forum, all of which ulimately did not work.


I disagree. I've made a functional (for my purpose) H-bridge for a circuit using four D882 transistors. Now I say it was functional because it did what I needed it to do, which was spin a motor in both directions. I used 4 digital pins on my Arduino to drive the bases of each pair of transistors, but it's possible to drive each pair with one digital pin.

OP, I can't tell what your problem is because you haven't provided a schematic, and text based schematics are poor substitutes for the real thing. It also looks to me like you're only trying to use two transistors; that is not going to work.

However, if you understand how to use a transistor as a switch, and how to use an Arduino to drive those switches, take a look at the following diagram and simply replace each switch with a transistor.

S2 and S3 are a pair, and S1 and S4 are a pair. Make your code foolproof; always make sure one pair is switched off before turning the other on.

Depending on your needs, this might work. Or you might be better off spending the $1.50 for a more elegant solution like the L298 IC.

Note that you still need protection diodes, regardless of whether you're using discrete components or an h-bridge IC. Don't find out the hard way.

CrossRoads

How much voltage/current does your motor need? Could that 5V and the Vce loss across the 2 transistors is too much.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Hakko

Hi!

First of all you need to provide schematics. Because schematics which you described will probably not work if all your circuit is 2 bipolar transistors and MCU output pins. Bipolar transistors are not simple relays there are several tricky things to make it work as switch especially if you put load between 2 of them. As I am also not too clever in these things I would suggest to use MOSFET's for start, they are more resistant to torturing ;)
But for both types key is the BASE > EMITTER or GATE > SOURCE voltage, which "opens" the transistor so if you have tied 2 transistors one after other - between them you have half voltage of supply, so to open upper transistor you need Vcc/2 + Vgs which could be higher than your VCC. And also suggestion - don't use every circuit you search on google - most of them are wrong or will not suit you.
my suggestion is to use some aviable chips like L293 or similar.

hope that was helpfull

Hakko

Grumpy_Mike

#5
May 02, 2012, 12:59 pm Last Edit: May 02, 2012, 01:07 pm by Grumpy_Mike Reason: 1
This link has a description of how to make one and how it works:-
http://www.electronicsteacher.com/robotics/robotics-tutorial/advanced-robotics/controlling-dc-motors.php

Note as it uses all NPN transistors the top transistor will only turn on as high as the signal feeding it. Therefore this is good only for switching 5V. To switch a higher voltage then you have to use a extra transistors to boost the signal from the arduino up to the voltage you want to switch.

TorontoBoy


This link has a description of how to make one and how it works:-
http://www.electronicsteacher.com/robotics/robotics-tutorial/advanced-robotics/controlling-dc-motors.php


That is a very cool circuit! I am going to build two of these and try it out! In the diagram I am assuming that the horizontal "houses" on the left of the diagram connect to a digital +5v output pin on the Arduino, so I will need two pins per motor, one for each direction. The +V voltage is for the motors, not the Arduino. I also note the flyback diodes.


RPCoyle

Should work... pretty basic. I have built a number of these circuits for both motor control and also pulse width modulated power supplies. The funny thing is, it seems like the damn circuit always was somewhat aysmmetric. The transistors on one leg were always running hotter than the other. I always had to do some tweaking.

There are a lot of very cheap already made H-bridge chips and modules out there. You might look around on the net before you start building, unless you just want to give it a try.

TorontoBoy

If I did 2 of these circuits in order to run 2 motors (both directions) I would need 8 transistors, resistors and diodes. Would it be more cost effective to use an H-bridge L293D IC? Are there any benefits to doing the IC, other than less soldering and work? Or would the transistor way be just as effective or maybe better?


boredat20

I'm going to agree with RPCoyle here. I've also made a few of these H bridges, and to be honest, unless your application doesn't care if the motors spins at 4.7v one way but 4.4v the other, don't bother. I remember a couple of years ago I made an actuator that turned a using a small gearmotor. The amount of tweaking it required (delays and such) to get the motor to spin APPROXIMATELY the same distance forward and backward was a nightmare. The device is still in use, but the mechanism has considerable drift and needs re-calibration every few months.

An L293 or an SN754410 will be easier, more powerful, and will probably save you some copper in the end.

Grumpy_Mike

Quote
unless your application doesn't care if the motors spins at 4.7v one way but 4.4v the other,

The only reason for non symmetrical operation like this is a poor choice of transistors. The gain of the transistors need to be matched and sufficient current must be supplied to put the bottom ones into saturation, with sufficient gain so the top ones in an emitter follower configuration will allow the right amount of current to flow.
For this reason the top transistors are often PNP transistors with a different arrangement for the switching. This is so that both top and bottom transistors can both work in a common emitter configuration.

TorontoBoy

In the end it was more cost effective to use the L293D because it only costs $3.50. The transistors cost $1.80 each and I would need 8. The L293D also has a flyback diode built-in. I used this electrical schematic and breadboarded it. The circuit works with his sketch without any changes. Note that his electrical schematic and his breadboard are different. I deconstructed his breadboard. Arduino pins 2 and 3 go to one side of the H-bridge, 7, 8 go to the other side to control two motors.

The next step is to buy some perf board and solder everything together. Then make a base and attach the motors. Finally sensors would need to be added. Overall it was more educational for me to make my own h-bridge rather than buy an Ardumoto shield ($36), and if I destroy my L293D I know how to replace it.

Go Up