
{"id":557,"date":"2018-10-17T10:20:25","date_gmt":"2018-10-17T10:20:25","guid":{"rendered":"http:\/\/blogs.plymouth.ac.uk\/embedded-systems\/?page_id=557"},"modified":"2018-10-17T10:20:25","modified_gmt":"2018-10-17T10:20:25","slug":"h-bridge-glossary-entry","status":"publish","type":"page","link":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/glossary-2\/h-bridge-glossary-entry\/","title":{"rendered":"H-Bridge (Glossary Entry)"},"content":{"rendered":"<p>An H-Bridge, so named due to it&#8217;s circuit topology, is a device for delivering controlling the direction of a (often large) current in one of two directions.<\/p>\n<p>A typical application of this is the control of a DC motor.\u00a0Consider the following circuit, which is used to drive a motor in a single direction:<\/p>\n<figure id=\"attachment_558\" aria-describedby=\"caption-attachment-558\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-558\" src=\"http:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/SingleDirectionMotor.png\" alt=\"\" width=\"600\" height=\"499\" srcset=\"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/SingleDirectionMotor.png 853w, https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/SingleDirectionMotor-300x250.png 300w, https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/SingleDirectionMotor-768x639.png 768w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption id=\"caption-attachment-558\" class=\"wp-caption-text\">Using a single transistor to drive a DC motor in one direction. Note the protection diode is required due to the indicative nature of the motor.<\/figcaption><\/figure>\n<p>Given that the output current of a Microcontroller is typically measured in mA, and the starting current of a DC motor is often in Amps, a transistor can be used to switch the current through the motor as shown.<\/p>\n<ul>\n<li>When the GPIO output is HIGH, the transistor will switch ON, and so current will flow through the motor M from V<sub>DD<\/sub> to ground<\/li>\n<li><span style=\"letter-spacing: 0.05em\">When the GPIO output is LOW, the transistor will switch OFF, and so no current will flow through the motor.<\/span><\/li>\n<\/ul>\n<p>In this example, a N-Channel MOSFET has been used (they tend to have lower channel resistance) but bipolar transistors can be used as well. A key observation is this:<\/p>\n<p><strong>The transistor is essential as it can switch enough current to start and run the motor<\/strong><\/p>\n<p>This circuit is somewhat limited however as it can only drive the motor in a single direction.\u00a0To reverse the motor, imagine we could pick up the motor, rotate it by 180 degrees, and re-insert it into the circuit. Well, this is (in effect) what an H-Bridge circuit does. Let&#8217;s start with a conceptual diagram:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-561\" src=\"http:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/H-Bridge.png\" alt=\"\" width=\"1055\" height=\"711\" srcset=\"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/H-Bridge.png 1055w, https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/H-Bridge-300x202.png 300w, https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/H-Bridge-768x518.png 768w, https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/H-Bridge-1024x690.png 1024w\" sizes=\"auto, (max-width: 1055px) 100vw, 1055px\" \/><\/p>\n<p>This circuit has 4 switches, S1, S2, S3 and S4.<\/p>\n<ul>\n<li>To drive the motor <strong>forward<\/strong>, only S1 and S4 would be closed<\/li>\n<li>To drive the motor in <strong>reverse<\/strong>, only S2 and S3 would be closed<\/li>\n<li>To brake, close (S1 and S3) OR (s2 and S4)<\/li>\n<li>S1 and S2 must never be closed together (short circuit)<\/li>\n<li>S3 and S4 must never be closed together (short circuit)<\/li>\n<\/ul>\n<p>Now replace these switches with transistors, and we can control the motor using our microcontroller:<\/p>\n<figure id=\"attachment_563\" aria-describedby=\"caption-attachment-563\" style=\"width: 1387px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-563\" src=\"http:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/H-Bridge-Circuit.png\" alt=\"\" width=\"1387\" height=\"705\" srcset=\"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/H-Bridge-Circuit.png 1387w, https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/H-Bridge-Circuit-300x152.png 300w, https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/H-Bridge-Circuit-768x390.png 768w, https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/H-Bridge-Circuit-1024x520.png 1024w\" sizes=\"auto, (max-width: 1387px) 100vw, 1387px\" \/><figcaption id=\"caption-attachment-563\" class=\"wp-caption-text\">Low-cost H-Bridge Circuit for controlling a 5V DC motor. The MOTOR_1 and MOTOR_2 pins connect to the MCU. MOTOR_POSITIVE and MOTOR_NEGATIVE connect across the DC Motor. Note that the transistor pairs (Q1,Q3) and (Q4,Q2) are always in opposite states.<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An H-Bridge, so named due to it&#8217;s circuit topology, is a device for delivering controlling the direction of a (often large) current in one of two directions. A typical application of this is the control of a DC motor.\u00a0Consider the following circuit, which is used to drive a motor in a single direction: Given that&hellip; <a class=\"more-link\" href=\"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/glossary-2\/h-bridge-glossary-entry\/\">Continue reading <span class=\"screen-reader-text\">H-Bridge (Glossary Entry)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":153,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-557","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/pages\/557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/comments?post=557"}],"version-history":[{"count":3,"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/pages\/557\/revisions"}],"predecessor-version":[{"id":564,"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/pages\/557\/revisions\/564"}],"up":[{"embeddable":true,"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/pages\/153"}],"wp:attachment":[{"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/media?parent=557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}