Custom H-Bridge Circuit Not Working when Adding Motor

I have the following circuit configuration hooked up to an ATtiny85 microcontroller. The microcontroller is simply outputting HIGH on one pin and LOW on the other.

My problem is as follows, my H-Bridge functions perfectly outputting 12V across the "bridge" (I'm using a 12V source rather than a 6V) when there is an LED across the bridge. As soon as I put a motor across the bridge, the voltage on the bridge drops to ~6-7V when it should be 12V. Also, the pin that should be outputting HIGH (5V) is outputting around 1V and the voltage on the pin fluctuates. I'm really stumped because I had this exact same circuit working earlier. Any help would be appreciated.

Instead of putting a PWM signal on the input, just use a bench voltage supply and manually control the input DC voltage.

Also consider the type of transistors you're using for the H-bridge circuit. Can those transistors handle the power (ie voltage times current at the emitter base section)?

If your h-bridge circuit is wired up properly, and power handling is fine, then the issue could possibly be due to whatever is driving the inputs. This means...... make sure that the input signals are what you expect.

But first...... forget about applying PWM input. Just use manual DC input voltage to begin with, and then come back to PWM input later.

You say it worked earlier? With a motor attached? make sure you have a common ground from the bridge supply to the tiny too.

@Southpark @alka

Thank you for your responses. I should clarify. I am using a modification of the above circuit that looks as attached.

I am not using PWM, I am simply turning the FWD input from the ATtiny HIGH and the other LOW. No PWM is involved at all for now. Controlling it using the bench 5V supply works perfectly. The issue is when I try to use the ATtiny to supply the FWD & BKWD inputs. The input signals are ~5V when the load is an LED. When its a DC motor, thats when I run into problems. The input signals are much lower than expected ~1V.

To alma's point, I do have a common ground between the 12V and 5V sources that are used to power the motor and the ATtiny respectively.

anujent:
I have the following circuit configuration hooked up to an ATtiny85 microcontroller. The microcontroller is simply outputting HIGH on one pin and LOW on the other.

What I'm thinking is.... if the 'other' input pin is LOW (ie. the base voltage of the lower bc337 is LOW)....... then the collector of the lower bc337 will go open circuit ...... which would mean the base of your top-right transistor will also go open circuit (aka floating).

It looks like we will need to make sure we avoid making the bases of transistors open circuited.

Could look into putting a 22 kilo-Ohm resistor between Vcc and the collector of the lower bc337. And a 22 kOhm resistor between GROUND and the collector of upper bc337.

How are you powering the 5V source?

Southpark:
Could look into putting a 22 kilo-Ohm resistor between Vcc and the collector of the lower bc337. And a 22 kOhm resistor between GROUND and the collector of upper bc337.

I understand that the bases are "floating" however, I didn't have a problem with this earlier so I'm not sure why its happening now. Also, if I can turn the H-Bridge on by touching the input pin to a 5V lead then I should have no issues at all with the H-Bridge itself. I don't follow the purpose of the 22kohm resistors, could you please explain?

outsider:
How are you powering the 5V source?

I'm using a 12V source and then using a linear voltage regulator to get 5V. There is a common ground between the linear voltage regulator and the 12V source & 5V output. The 12V source is rated at 12V/2A and linear voltage regulator is rated at 5V/3A which should be more than sufficient for my motor (<1A).

Alas that bridge doesn't really have enough current gain to actually switch a decent load,
the output transistors are still in the linear region as their bases get about 50mA
which is barely enough for the bridge to handle 1A - I suspect your motor is pulling several
amps stall current and the bridge is struggling.

Try replacing all the 220 ohm resistors by 150 ohm 1W resistors, or 100 ohm 2W. That will
provide more base current and thus more collector current at saturation, but waste more
power in the resistors (independent of load).

Those ancient transistors like to have about 10% of the collector current on the base to switch
to saturation (v. poor performance compared to MOSFETs - no one uses anything but MOSFETs
in industry for a good reason).

There are better BJT's you can use (modern superbeta devices), and there are darlingtons
(but they will still drop several volts).

You also need to replace 1N4148's with something that won't be fried at several amps.

anujent:
I understand that the bases are "floating" however, I didn't have a problem with this earlier so I'm not sure why its happening now. Also, if I can turn the H-Bridge on by touching the input pin to a 5V lead then I should have no issues at all with the H-Bridge itself. I don't follow the purpose of the 22kohm resistors, could you please explain?

It is just generally undesirable to have a control input at an unknown voltage. A base of a transistor that is virtually disconnected (in an open circuit state) can have its voltage level altered by noise, or people touching your circuit etc. This can lead to undesired or unpredictable circuit behaviour. So those resistors would help to ensure that the base of the transistor is always at a known (and suitable) voltage. Avoids false triggering, and prevents motors from starting etc when you didn't tell it to move. Look up info on 'pull-up' and 'pull-down' resistors. And look up issues with floating inputs.

For the moment, if your voltage supply is variable (eg. bench power supply), I guess you could see what happens if you drop your supply voltage down to say 8V DC..... and see what happens.

And look up the specs (data sheet) for the TIP32 transistor...... and see what base current is needed in order to make this transistor turn on properly for the amount of collector current that your motor needs to draw.

And when you mentioned that you had 'exactly the same circuit working earlier'..... are you absolutely sure that you're using exactly the same circuit? Obviously something has changed....or you changed something.

Southpark:
And when you mentioned that you had 'exactly the same circuit working earlier'..... are you absolutely sure that you're using exactly the same circuit? Obviously something has changed....or you changed something.

You're correct, I did in fact change one thing. I replaced the transistors for smaller ones that would supply a max of 1A. I measured my DC motor current draw with 12V and noticed that it is approximately 0.07A so I thought this would be sufficient.

I replaced my transistors with the old ones I was using (TIP41B & TIP32C transistors) and I got the H-Bridge working again on the bench. My system however, uses an Arduino Mega connected with an ATtiny. When I plug in a 12V source into the mega and try to use the Vin pin to supply 12V to the H-bridge (again, using a common ground), I run into the same problem, the circuit doesn't supply 12V to the motor but when I use an LED across the bridge, it successfully supplies 12V across the bridge. It should be noted that I have several other digital IO on the Mega although I am not using any of them when I am running this test. When I power the H-Bridge with 12V externally, my circuit functions again.

My guess is that the Arduino Mega Vin pin isn't able to supply enough current to handle the motor. Does this mean I need to power my H-Bridge externally?

anujent:
You're correct, I did in fact change one thing. I replaced the transistors for smaller ones that would supply a max of 1A. I measured my DC motor current draw with 12V and noticed that it is approximately 0.07A so I thought this would be sufficient.

My guess is that the Arduino Mega Vin pin isn't able to supply enough current to handle the motor. Does this mean I need to power my H-Bridge externally?

The best bet is to always check the manufacturer specifications, or look at the circuit diagram for the arduino Mega (.... the 2560?).

It's beneficial to know at least ballpark figure for maximum voltage and current capacity, and maximum power handling.

Vin appears to be a test point voltage pin. And this Vin pin is connected to a diode, and the other side of that diode is connected to the centre pin of the DC input socket. The Vin pin is also connected to the inputs of a couple of voltage regulators. So Vin will be the input voltage to those voltage regulators. So we expect a non-zero voltage at Vin if a DC power source is connected to the DC input socket.

The presence of the diode means that Vin won't be at the DC voltage supply level (at the input socket). It will be approx 0.7 V less than DC supply level. And the diode will have a maximum current rating..... but I don't yet know what that max current rating is. So you'll need to check on that.

You shouldn't be taking power out of Vin, the clue is in the name. Either power the Arduino from the
barrel jack, or Vin.

Power the motors separately, share only ground. You should have said up-front how the powering was
done since we cannot mind-read.

anujent:
I am using a modification of the above circuit that looks as attached.

anujent.... that particular circuit diagram has issues too ..... where the bases of some transistors will be open circuited (isolated) some of the time...... the bases sometimes floating, which is not a good thing. Where-ever that circuit came from.... they didn't realise this important thing. If somebody uses that particular circuit - as it is - then wouldn't be surprising to find that sometimes the motor could just start up unexpectedly .... when it's meant to be stopped.... and things like that.

The base of a BJT does not "float" like a MOSFET gate.

An open circuit base has two issues - it allows the collector-base leakage current to be amplified
by the gain of the transistor so that the off-current is higher than if the base is strapped to the emitter.

For a motor driver this is not relevant, its measured in microamps and the motor will not spring
to life uncommanded!

The second effect is relevant, however, which is the problem of clearing space charge from the base on
switch-off. The faster you can clear the stored charge in the base at switch off, the smaller the switching
losses. When using PWM this can be significant and you want to pull the base actively down to the
emitter to switch off, clearing the space charge away from the base before it gets amplified by the
transistor gain and converted to charge dumped on the collector. Storage times can range from a few
100ns to 10us or so, depending on the size of the transistor and the degree of saturation when on.

If you are using 8kHz PWM, 10us is a very significant fraction of the cycle time!