element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Learning about H-bridges and transistors
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 38 replies
  • Answers 8 answers
  • Subscribers 397 subscribers
  • Views 2943 views
  • Users 0 members are here
  • frontpage
  • h-bridge
  • transistors
Related

Learning about H-bridges and transistors

ovidiub13
ovidiub13 over 9 years ago

I'm trying to learn about transistors and H bridges towards a final goal of controlling a bipolar stepper motor with Arduino.

 

I've done the following half H-bridge in the process of learning:

image

My first question: Why can't I use a single resistor to connect the base of both transistors to ground?

  • Sign in to reply
  • Cancel

Top Replies

  • strb
    strb over 9 years ago +1 suggested
    I'm not sure that this schematic works... the led isn't reverse polarized? Anyway use a pnp as pullup transistor and a npn as pulldown, it's a good thing to put also a limiter resistor to control the current…
  • strb
    strb over 9 years ago in reply to clem57 +1
    Great "how link" clem57
  • mcb1
    mcb1 over 9 years ago in reply to ovidiub13 +1 suggested
    What I'm having issues understanding is how transistors work You can consider a transistor as a switch (in this case they are either ON or OFF) The control part of the switch is the base to emitter (NPN…
Parents
  • ovidiub13
    0 ovidiub13 over 9 years ago

    Wow, I didn't expect this much interaction to my question. Thank you everybody.

     

    My direction was to control a stepper motor (Mitsumi M49SP-2K and KH42JM2) and I got mislead somewhere (here, it says H-Bridge on the IC) that I need an H bridge, so I tried to learn about them and about transistors. I'm still a noob in electronics, and I know bits and pieces of it. Your answers have been most helpful, especially the criticism on my schematic. I know it's terrible.

     

    I haven't studied in any field related to electronics. I'm a software developer, with very limited knowledge about electronics, and I'm trying to learn about it.

     

    For controlling the KH42JM2 I've made this with the help of a friend some time ago.

    image

    And the code:

    int led1 = 13; int led2 = 12; int led3 = 11; int led4 = 10; int button = 2;  int pause = 50; bool forward = true;  void setup() {     pinMode(led1, OUTPUT);     pinMode(led2, OUTPUT);     pinMode(led3, OUTPUT);     pinMode(led4, OUTPUT);     pinMode(button, INPUT);           digitalWrite(led1, HIGH);     digitalWrite(led2, HIGH);     digitalWrite(led3, HIGH);     digitalWrite(led4, HIGH); }  void step1() {     digitalWrite(led1, LOW);     digitalWrite(led2, LOW);     digitalWrite(led3, HIGH);     digitalWrite(led4, HIGH); }  void step2() {     digitalWrite(led1, HIGH);     digitalWrite(led2, LOW);     digitalWrite(led3, LOW);     digitalWrite(led4, HIGH); }  void step3() {     digitalWrite(led1, HIGH);     digitalWrite(led2, HIGH);     digitalWrite(led3, LOW);     digitalWrite(led4, LOW); }  void step4() {     digitalWrite(led1, LOW);     digitalWrite(led2, HIGH);     digitalWrite(led3, HIGH);     digitalWrite(led4, LOW); }  void goForward() {      step1();      delay(pause);      step2();      delay(pause);      step3();      delay(pause);      step4();      delay(pause); }  void goBackwards() {      step4();      delay(pause);      step3();      delay(pause);      step2();      delay(pause);      step1();      delay(pause); }  void loop() {     if (digitalRead(button))           forward = !forward;      if (forward)           goForward();      else           goBackwards(); }

    But now I tried to go on my own. I have some salvaged parts, and I'm willing to destroy them in the name of learning.

     

    I will eventually use an IC for future projects, but first I want to understand how components work, and how to make a circuit to achieve this.

     

    I've recently got a book about transistors: Romanian translation from "Questions and answers on Transistors" by Clement Brown - Butterworth & Co (Publishers) Ltd. 1969. I quite like it as it explains in very much depth. But my free time is scarce so progress is slow. Anyway, until I finish this book, further questions about transistors would be useless. I'll make a list of questions I have, and If I don't get an answer later in the book or from Google I'll come back.

     

    Thank you very much for all your help and shared knowledge. I haven't read through all the links you've gave me yet, but I've bookmarked them, and I will look at all of them.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 9 years ago in reply to ovidiub13

    If you are new to electronics then your diagrams are not that bad... wrong perhaps but pretty good start for a newcomer and you will only get better over time

    In the diagram above i would suggest a small resistor in series with the LEDs as they are in parallel with the coils and so will limit the volts to the coil and conversely when the transistors switch off there will be a back EMF that could destroy them. You should have a protection diode (NOT an LED) across each transistors load to minimize the impact of this

     

    The diagram you have above btw is not an H Bridge, the stepper you're using in the diagram has 5 or 6 wires with the center taps of each coil going to +Vcc, the rest are sequenced to ground by the controller, you can also simplify the components by using an LM2003 darlington driver chip, it will handle steppers of this kind when they're not too big, it will also handle motors of more than 5V if needed, LEDs with series resistors can easily be added to give visual indication of operation, you could also put them on the input of the chip rather than the output, then just use a 330R to 1K Ohm resistor in series with an LED to 5V and it should not load the output of the arduino too much

    image

     

    btw, here is a more readable version of the H bridge schematic (The bit with the transistors anyway, you just need to add your IC back to it. Any NPN  transistors that have the required specifications will work, it all depends on the load your switching and the drive your using (The chip in the case of the diagram above). This diagram is also the more traditional way of showing the H Bridge, yours is not wrong, just harder to follow. I would also use 1N4001 ot better diodes than a 1n4148 as those are just signalling diodes and may not last long with any but a tiny motor

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • Robert Peter Oakes
    0 Robert Peter Oakes over 9 years ago in reply to ovidiub13

    If you are new to electronics then your diagrams are not that bad... wrong perhaps but pretty good start for a newcomer and you will only get better over time

    In the diagram above i would suggest a small resistor in series with the LEDs as they are in parallel with the coils and so will limit the volts to the coil and conversely when the transistors switch off there will be a back EMF that could destroy them. You should have a protection diode (NOT an LED) across each transistors load to minimize the impact of this

     

    The diagram you have above btw is not an H Bridge, the stepper you're using in the diagram has 5 or 6 wires with the center taps of each coil going to +Vcc, the rest are sequenced to ground by the controller, you can also simplify the components by using an LM2003 darlington driver chip, it will handle steppers of this kind when they're not too big, it will also handle motors of more than 5V if needed, LEDs with series resistors can easily be added to give visual indication of operation, you could also put them on the input of the chip rather than the output, then just use a 330R to 1K Ohm resistor in series with an LED to 5V and it should not load the output of the arduino too much

    image

     

    btw, here is a more readable version of the H bridge schematic (The bit with the transistors anyway, you just need to add your IC back to it. Any NPN  transistors that have the required specifications will work, it all depends on the load your switching and the drive your using (The chip in the case of the diagram above). This diagram is also the more traditional way of showing the H Bridge, yours is not wrong, just harder to follow. I would also use 1N4001 ot better diodes than a 1n4148 as those are just signalling diodes and may not last long with any but a tiny motor

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
  • mcb1
    0 mcb1 over 9 years ago in reply to Robert Peter Oakes

    Not sure I'd use 1N4148 diodes.

    I tend to prefer 1N4001  to 1N4004 as they handle the current a little better.

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 9 years ago in reply to mcb1

    That's exactly what I said in my comment with the Diagram and I completely agree... It was a Stock Diagram I found image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 9 years ago in reply to Robert Peter Oakes

    what I said in my comment

    oops I should have read all the words .....

     

    Sorry.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 9 years ago in reply to mcb1

    I do the same from time to time, no apology necessary image, but thanks anyway

    Peter

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube