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.
Thank you for publishing this information. :)
ReplyDeletebrother my model is not working please help
ReplyDeletehi divas
ReplyDeleteMake sure your transistor are in working condition.and also check the circuit connection.
is speed control also possible , perhaps by pulsing the inputs?
ReplyDeletehi Maxx. i didn't test that but i am sure speed control will work with pwm in this circuit.
ReplyDeleteMaxX you can control the speed by using variable resister
ReplyDeletegood project . Thank you bro ;)
ReplyDeleteI am using tiva microcontroller tm4c123. will the same setup and program work. And give plz share the details. my email id is pranjalbhadti@gmail.com
ReplyDeleteTransistors i have are bs170 mosfet. will the same circuit be applicable. thankyou! look forward for your reply.
ReplyDeleteSir what could the alternative of NPN TIP122 transistor?? Sir plz reply soon
ReplyDelete