BUILT YOUR OWN H- BRIDGE CIRCUIT USING NPN TRANSISTER

on Thursday, July 17, 2014


            Hi everyone .here i am showing my project building H-bridge circuit to control the dc motor rotation direction. In this circuit i am using 4 NPN TIP122 transistors. here i am using msp430 to produce two control inputs to access the h bridge circuit. you can use what ever micro controller u have. just produce 0,1 bit to rotate motor in clockwise direction. 1,0 bits to rotate in counter clockwise direction and 0,0 bits to stop the motor  and you can use this circuit in robot making,rc,etc to control dc motor direction of rotation.


CIRCUIT:




PROGRAM CODE:

Here is the program for this project. i use energia software to program msp430 launchpad
to download energia software click the link bellow:
http://energia.nu/download/


const int buttonPin = PUSH2;     // the number of the pushbutton pin
const int motorPin1 =  P1_0;
const int motorPin2 =  P1_6;

// the number of the LED pin

// variables will change:

int buttonState = 0;         // variable for reading the pushbutton status

void setup() {

  pinMode(motorPin1, OUTPUT);   
  pinMode(motorPin2, OUTPUT);  
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT_PULLUP);    
}

void loop(){
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {    
      
  digitalWrite(motorPin1, HIGH);
  digitalWrite(motorPin2, LOW); 
  }
  else {
   
    digitalWrite(motorPin1, LOW);
    digitalWrite(motorPin2, HIGH);
  }
}

                                                        
DIRECT CIRCUIT USE H BRIDGE WITH OUT PROGRAM:

                 Use the push button to control motor without controller. for that assemble the circuit bellow. for one button push motor rotate clock wise. for another button push motor rotate anti clock wise. don't push two button at same time.




                                                              Thank you for watching.

6 comments:

lzcracker said...

Thank you for publishing this information. :)

Divas Grover said...

brother my model is not working please help

vignesh raja said...

hi divas
Make sure your transistor are in working condition.and also check the circuit connection.

MaxX said...

is speed control also possible , perhaps by pulsing the inputs?

vignesh raja said...

hi Maxx. i didn't test that but i am sure speed control will work with pwm in this circuit.

Mehran Baig said...

MaxX you can control the speed by using variable resister

Post a Comment