HUM: THE SIMPLE H-BRIDGE - Soldered Electronics (2024)

10.Jan.2023

You are a beginner with Dasduino. Or electronics? A specific module caught your eye, but you do not know how to use it? Do not worry, HUM is here for you! How to Use Module (HUM) is a blog tutorials series by soldered where you will find all you need in order to begin working with your favorite module. Tutorials include: technical characteristics, work principle, instructions on how to connect module with Dasduino and the basic code. Everything else is left to your imagination.

INTRODUCTION

You have certainly already encountered some type of a DC motor. You know that connecting the DC motor’s pins toa source of certain voltage results in rotating the motor to one side. Also,if we switchpins on the motor and connect the power source the opposite way, we will see that the motor rotates to the opposite side. Thisfeature of the motor is very useful, but it is complicated to constantly switch pins of the motor manually. There must be anelectronic circuit which can do it for us? Of course there is. The answer is in the H-bridge circuit. Using it, we can easily and safely change the motor rotation direction. In continuation, we will explain the H-bridge work principle in more detail.

HUM: THE SIMPLE H-BRIDGE - Soldered Electronics (1)Characteristics:
• Maximum current:
•Maximumvoltage:
• Control viaAandBcontrol pins

HOW DOES IT WORK?

H-bridge is a circuit that, in theory, consists of four switches connected to some load (e.g. DC motor). Various configurations of these switches can allow us to control current flow in the circuit. Using the H-bridge, it is very simple to switch the polarity on the load. Even though the load can theoretically be whatever you want, by far, the mostwidely usedH-bridge application is for DC and stepper motors.It is most commonly used to control and replace the DC motor rotation direction. H-bridge is also used in many other applications such as DC/AC, AC/ACor DC/DC converters. The H-bridge circuit reminds of the letter H, and that is how it has gotten its name.

HUM: THE SIMPLE H-BRIDGE - Soldered Electronics (2)The image above represents a scheme display of the H-bridge. We can see that the H-bridge consists of four MOSFETs connected in a certain way. Because of the inabilityto simultaneously switch between the two possible states of the bridge, diodes were added to the circuit (mostly Schottky’s diodes) in order for it to ensure simultaneous switch of states and limit the current’s flow power during these short periods of imbedding, without the load voltage being too high. The upper end of the bridge is connectedto a power source (e.g. battery), while the bottom end is grounded. The basic work principle of the H-bridge is very simple: ifQ1andQ4are turned on, the leftcable of the motor will be connected to the power supply, and the right to the ground. The current flows through the motor (so to say) in the forward direction, and the engine shaft starts rotating.

HUM: THE SIMPLE H-BRIDGE - Soldered Electronics (3)IfQ2andQ3are on, what will happen is quite the opposite, the motor is powered in thereverseddirection, and the shaft will rotate in the opposite direction.
HUM: THE SIMPLE H-BRIDGE - Soldered Electronics (4)You must never closeQ1andQ2(orQ3andQ4) at the same time! If that happens, a direct path between the power supply voltage and ground which is of very low resistance is created, which ultimately results in a short circuit. A short circuit can lead to destructionof the H-bridge, orsome othercomponent in the circuit.

HUM: THE SIMPLE H-BRIDGE - Soldered Electronics (5)The table below shows every possible combination of switch states and their outcome.

It is necessary to note that this module has only two control pins (AandB) which are used to control the H-bridge operation. A pin is connected to 2 MOSFETs (Q1 and Q2) which are actually one N-channel and one P-channel MOSFET. The reasonfor it is the elimination of states in which the Q1 and Q2 are simultaneously “turned on”. When the N-channel MOSFET conducts current, P-channel MOSFET does not, and it ensures that, at any given time, Q1 and Q2arenot in the same state(more about MOSFETshere). B pin is connected to the other 2 MOSFETs (Q3 and Q4) in the same way. This makes it easier to work with the module where we do not have to look out foraccidentaly making the short circuit or destroying the module.

HOW TO CONNECT IT?

Below, we will show the connection of the H-bridge module with the DC motor whom we will control using Dasduino. H-bridge contains several pins:

VCC– Input for the external power supply.
GND– Serves for connecting minuses of the power supply.
A– Control pin for controlling the H-bridgeoperation.
B– Another control pin for controlling the H-bridgeoperation.
OUTPUTx2 – Two pins to which we connect the load (e.g. DC motor).

The image below shows an example of thecorrect connection of the H-bridgewith Croduino. It is necessary to note that the A and B module pins are connected to Croduino, while the DC motor is connected to the OUTPUT pins. It is not important which OUTPUT pin is connected to which DC motor connector, as the rotation direction will be determined in the program.

ARDUINO CODE

There is no need to use any library for motor control using the H-bridge module. By simplyswitching theA and B connectors on/off using digitalWrite() function, we start the motor. The motor will rotate only when the A pin’s state is different from B pin’s state. When their states are the same, A=B, it means we have brought the same voltage to both motor connectors (e.g. +5V or -5V). Therefore, when the A pin is in HIGH state, and B in LOW, the motor will rotate in one direction. When the A pin is in LOW state, and B pin in HIGH, the motor will rotate to the opposite direction.

//This simple program runs the motor for 2 sec in one direction, after which the motor stops for 2 sec

//After that, the direction changes and it rotates to the opposite direction for 2 sec and then stops for 2 sec

int pinA = 4; // defining pins for motor rotation control

int pinB = 3;

void setup() {

pinMode(pinA, OUTPUT); // Setting pins as outputs

pinMode(pinB, OUTPUT);

}

void loop() {

pokreniMotor (1); //the motor rotates in one direction

delay(2000); //wait 2 sec

pokreniMotor (0); //the motor stops

delay(2000); //wait 2 sec

pokreniMotor (2); //the motor rotates in the opposite direction

delay(2000); //wait 2 sec

pokreniMotor (0); //the motor stops

delay(2000); //wait 2 sec

}

void pokreniMotor (int stanje) { //we use this function to start the motor

switch (stanje) {

case 0: //if the state=0, the motor will not start, breaking mode

digitalWrite(pinA, LOW);

digitalWrite(pinB, LOW);

break;

case 1: //if the state=1, the motor will rotate in one direction

digitalWrite(pinA, HIGH);

digitalWrite(pinB, LOW);

break;

case 2: //if the state=2, the motor will rotate in the opposite direction

digitalWrite(pinA, LOW);

digitalWrite(pinB, HIGH);

break;

default: //not necessary, if the state is different than the above mentioned values, turn the engine off, for safety.

digitalWrite(pinA, LOW);

digitalWrite(pinB, LOW);

break;

}

}

HUM: THE SIMPLE H-BRIDGE - Soldered Electronics (2024)
Top Articles
Trailer Source Inc. in Grand Junction, CO | Horizon Dealer
Caltek Unscramble
Golden Abyss - Chapter 5 - Lunar_Angel
Aberration Surface Entrances
Monthly Forecast Accuweather
Western Union Mexico Rate
Blackstone Launchpad Ucf
Dr Doe's Chemistry Quiz Answer Key
DL1678 (DAL1678) Delta Historial y rastreo de vuelos - FlightAware
Here's how eating according to your blood type could help you keep healthy
Lost Pizza Nutrition
Zoebaby222
Aita Autism
Degreeworks Sbu
De Leerling Watch Online
Charmeck Arrest Inquiry
George The Animal Steele Gif
Cooktopcove Com
Concordia Apartment 34 Tarkov
Euro Style Scrub Caps
Ups Print Store Near Me
Www.craigslist.com Savannah Ga
Woodmont Place At Palmer Resident Portal
Aspenx2 Newburyport
Directions To Nearest T Mobile Store
How To Tighten Lug Nuts Properly (Torque Specs) | TireGrades
Hrconnect Kp Login
Encore Atlanta Cheer Competition
The Goonies Showtimes Near Marcus Rosemount Cinema
Ups Drop Off Newton Ks
Tenant Vs. Occupant: Is There Really A Difference Between Them?
Games R Us Dallas
Los Garroberros Menu
Chatropolis Call Me
Sc Pick 4 Evening Archives
Cheetah Pitbull For Sale
Bones And All Showtimes Near Johnstown Movieplex
Noaa Duluth Mn
Craigs List Hartford
Bekah Birdsall Measurements
Pain Out Maxx Kratom
Lady Nagant Funko Pop
Searsport Maine Tide Chart
Actress Zazie Crossword Clue
Sam's Club Gas Price Sioux City
Costner-Maloy Funeral Home Obituaries
Westport gun shops close after confusion over governor's 'essential' business list
Wwba Baseball
Provincial Freeman (Toronto and Chatham, ON: Mary Ann Shadd Cary (October 9, 1823 – June 5, 1893)), November 3, 1855, p. 1
Download Twitter Video (X), Photo, GIF - Twitter Downloader
Electronics coupons, offers & promotions | The Los Angeles Times
How to Choose Where to Study Abroad
Latest Posts
Article information

Author: Allyn Kozey

Last Updated:

Views: 6656

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Allyn Kozey

Birthday: 1993-12-21

Address: Suite 454 40343 Larson Union, Port Melia, TX 16164

Phone: +2456904400762

Job: Investor Administrator

Hobby: Sketching, Puzzles, Pet, Mountaineering, Skydiving, Dowsing, Sports

Introduction: My name is Allyn Kozey, I am a outstanding, colorful, adventurous, encouraging, zealous, tender, helpful person who loves writing and wants to share my knowledge and understanding with you.