user47870: I am trying to make an H-bridge with two NPN and two PNP transistors to drive a motor which works fine on the 5 V Arduino. I have a schematic in the picture. When I use a simple code to have pin 9 HIGH and pin 8 LOW, the motor doesn't do anything. The transistor which I circled green is getting very hot. Is there something wrong with the schematic or code? Or is it my wiring? 
I know people use diodes as well, but in my case the motor doesn't work, so the diodes aren't the problem. 

This is my code:
     void setup() 
    {

    pinMode(8, OUTPUT);
    pinMode(9, OUTPUT); 

    digitalWrite(9, HIGH);
    digitalWrite(8, LOW);
    }


user30039: There is a few possible scenarios to create a H-bridge:  

with NPN transistors only or PNP
mix of PNP and NPN

You have to be careful to not mix the types and inputs. See pictures below:
 


47870: <p>I am trying to make an H-bridge with two NPN and two PNP transistors to drive a motor which works fine on the 5 V Arduino. I have a schematic in the picture. When I use a simple code to have pin 9 HIGH and pin 8 LOW, the motor doesn't do anything. The transistor which I circled green is getting very hot. Is there something wrong with the schematic or code? Or is it my wiring? </p>

<p>I know people use diodes as well, but in my case the motor doesn't work, so the diodes aren't the problem. </p>

<p><a href="https://i.stack.imgur.com/xBZpK.jpg" rel="nofollow noreferrer" title="Schematic"><img src="https://i.stack.imgur.com/xBZpK.jpg" alt="Schematic" title="Schematic"></a></p>

<p>This is my code:</p>

<pre><code>     void setup() 
    {

    pinMode(8, OUTPUT);
    pinMode(9, OUTPUT); 

    digitalWrite(9, HIGH);
    digitalWrite(8, LOW);
    }
</code></pre>
 30039: <p>There is a few possible scenarios to create a H-bridge:  </p>

<ul>
<li>with NPN transistors only or PNP</li>
<li>mix of PNP and NPN</li>
</ul>

<p>You have to be careful to not mix the types and inputs. See pictures below:
<a href="https://i.stack.imgur.com/mXwuY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mXwuY.png" alt="Mixed PNP and NPN"></a> </p>

<p><a href="https://i.stack.imgur.com/86Wtb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/86Wtb.png" alt="NPN only"></a></p>
