Hi! I'm new to electronics and I don't know much about bjt's but, I made an h-bridge using 2 BC557 PNP and 2 BC547 NPN for my uni project. The problem I'm having is that the H-bridge works without an issue but not with arduino. When I manually connect the bjts to give 1 & 0 signals. It works. It rotates both clockwise and anticlockwise. But on the arduino it does not give any rotation and if i connect the pins to the pwm pins it just keeps rotating. A and B are the signals C is battery. And this is the code I am using. And when I connect it to ~5 and ~6 the motor just keeps rotating so I don't know what's the issu.
int LM1= 2 ; //motor Driver in1
int LM2 =4 ; //motor Driver in2
//motor Driver in4
void setup()
{
pinMode(LM1, OUTPUT);
pinMode(LM2, OUTPUT);
}
void loop(){
digitalWrite (LM1,HIGH);
digitalWrite (LM2,LOW);
delay(2000);
digitalWrite (LM1,LOW);
digitalWrite (LM2,HIGH);
delay(2000);
digitalWrite (LM1,LOW);
digitalWrite (LM2,LOW);
delay(2000);
}

According to the notation in your drawing, the PNP transistors are backwards.
The BC557 (200 mA maximum) and especially the BC547 (100 mA) are likely to be destroyed by the start/stall current of that motor.

1 Like
I couldn't find a circuit diagram rn. but yes in this diagram it is incorrect.However, I have connected all the collectors to the motor. Yep just checked as well, connected just like in the circuit diagram you showed.
When drawing a transistor or MOSFET insert the parts such as the emitter ie. use standard symbols. I have worked with a lot of transistors over the yeas but those I do not remember and I have to much to do do to look them up.
Jremington gave you a good schematic but you will need to add a voltage translation to the PNP transistors. Reason the Arduino will put out 0-5V, if VCC rises above 5V the apparent voltage will be that above 5 V. Consider using MOSFETs, you will get at least 1.2V more on the motor because the emitter/collector junction voltage will be missing.
1 Like
Unfortunately, the projects requirement is to use only BJT's.
No worry. As said: you need npn transistors to control the pnp transistors.
BD140 and BD139 (if I recall well) should be able to hande 1A. That would be a better choice than the BC's you have now. The BC NPN can be used to control the BD PNP.
You might consider to use the BC PNP to control the BD NPN. That way, you can drive both into saturation.
At higher amps these transistors need cooling.
A thick sheet of aluminium (> 3mm) should do. Do not mount all on one piece as the collector will be connected to the aluminium cooling material.
1 Like
The transistors are not backwards in this drawing. Did OP update his post???
Yes, trashing the thread.
Yes. I did update the post
Please do not modify the original post. It makes the thread hard or even impossible to follow.
1 Like
About your breadboarding..
Place things close together. Put emitters in gnd or plus rail. That saves a lot of wires...
Breadboards are not the best connectors. The more connections, the bigger the chance that one is not good.
Basically almost all your coloured wires should be taken away...
1 Like
What is the voltage on your Hbridge?
I knew, cause I know you would not be wrong on this...
Please post the code that does not work...
How can we find the errors in the code that does work...
Please make a new post!
The voltage I'm providing is with this battery. The issue is that hbridge works when one of B or A are grounded or connected with battery. but when connected with arduino it does not work
And as I said before I'm new to electronics. So, there are a lot of things I don't know especially theoretical.
What is A or B?
Only one 1.5V battery???
Edit: I found A and B.
Do you use that battery to feed the base of the npn transistor?
And do you have 5V of arduino as Vcc of your bridge?
In that case little of Vcc will be left after passing through 2 transistors. You should increase Vcc, but then you really need the extra transistors...
A or B are the signals. The logic given to the transistors. One side of the bridge is A and the other is B. Transistor 1 and 2 get signal A and transistor 3 and 4 get signal B.
Yes, only of these battery. it's because i don't have a battery holder. Could that be the issue?
No one can make any sense of that comment, since you deleted your original drawing.
Here it is:

1 Like
This setup will suffer from shoot through. Transistors will need time to shut of. If you open the other transistor before that, both will be open. Magic smoke will escape.
Best is to have 4 arduino outputs to control this.
1.2K is probably too little to fully open the transistor... is it BC 547C? Or BC 547A?