This µModule implements a 16A H-bridge with rich feed-back options to create a closed-loop speed-controller application. The module interfaces to the external world using the TWI interface that’s common among all µModules. It also has an optional CMOS-level RS-232 interface. It can control motors up to 18V.


  • Standard µModule TWI with optional RS-232 interface
  • Integrated 3.3V power supply, 5V operation is optional using an external power source
  • 16A peak current limit, 10A continuous current with IRL2203 MOSFets
  • 7 to 18V motor voltage
  • High-side short-circuit protection
  • High efficiency n-channel MOSFETs
  • Rich speed-feedback options for closed-loop operation
  • Back-EMF feedback for sensorless motion-control
  • PID control loop
  • Acceleration and deceleration limits
  • Traveled distance calculation
  • ‘Go-to-distance’ support with trapezoid speed-profile
  • Braking and free-wheeling support
  • Parameters can be stored in permanent EEPROM storage
  • Duty-cycle throttling to limit torque
  • Per-cycle programmable current-limit
  • Servo controller mode with external position feedback potentiometer


This document and all the accompanying design documentation (for example schematic and PCB files) are covered by the H-Storm Non-Commercial License (HSNCL).

H-Storm Non-Commercial License (HSNCL)

Copyright 2004-2007 Andras Tantos and Modular Circuits. All rights reserved.

Redistribution and use in source or binary forms, or incorporated into a physical (hardware) product, with or without modification, are permitted for non-commercial use only, provided that the following conditions are met:

  • The redistribution doesn’t result in financial gain.
  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in any other form must contain in printed or electronical format the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • All advertising materials mentioning features or use of this technology must display the following acknowledgment:
    This product includes H-Storm technology developed by Andras Tantos and Modular Circuits.
  • Neither the name of Andras Tantos or Modular Circuits may be used to endorse or promote products derived from or using this technology without specific prior written permission.


Design description

The bus interface

The TWI bus interface follows the µModule standards. There are six or four-pin connectors on the board, both with identical functionality. Two wires are used for the TWI signal transmission (clock and data) while the rest provide power and ground signals. The interface can be operated at a rate up to 400kHz. This module never initiates any transactions on the bus, it operates in slave-only mode. Status information can be acquired by polling and commands can be sent to the module at any time. The module implements the standard 8-bit register bank µModule communication protocol.

Powering options

The module can source and sink power on this interface. The power to and from these sockets can be interrupted by an on-board jumper. With this there are three possible powering configurations with regards to the logic-level functions:

  • The module is powered form the same power supply as the motor. The module provides power to other devices on the TWI bus
  • The module is powered from the power supply of the motor however it does not power other devices on the TWI bus
  • The module is powered from the TWI bus

The third powering mode has to be used if 5V operation is required.

The H-bridge

The H-bridge is comprised from 4 n-channel power MOSFETs. These transistors have extremely low on-resistance, leading to high-efficiency and low heat-generation even at high power levels. By replacing the standard IRFZ48 transistors with IRL2203 ones, no heat-sink is required up to 10A of continuous current. The efficiency of the bridge is almost 98% from a 18V supply, 96% at 10V and 94.7% at 7.2V supply voltage. The transistors are driven by LTC1155 dual-channel high-side driver ICs. These devices can deliver higher gate control voltages than the power supply thus allowing the use of n-channel MOSFETs on the high-side of the bridge as well. These chips also provide a second level of short-circuit protection by measuring the voltage drop on the sense resistor. Shot-through protection is established by monitoring the low-side gate voltage and disabling the high-side gate drives until the low-side gate voltage drops low enough. This mechanism also provides protection against opening a low and a high-side driver of the same half of the bridge at the same time. Since the drivers can provide significantly higher voltages (especially for the low-side MOSFETs) than the maximum allowable GS voltage, a zenner protection diode limits the GS voltage to 10V. All four MOSFETs can independently be turned on and off (with the exception of two MOSFETs on the same side being turned on at the same time) allowing all possible valid operating modes of the bridge to be used:

  • Forward drive
  • Backward drive
  • Free-wheeling
  • Braking

Feedback options

A wide range of feedback options are available on the module to provide additional health-monitoring and establishing closed-loop speed-control functionality. Both voltage (relative to the ground) on the motor connectors can be monitored as well as the voltage across the current-sense resistor which is proportional to the current flowing through the motor. Monitoring these values with a 10-bit resolution A/D converter precise knowledge of the current system status can be established. These measurements can be used to calculate the back-EMF response of the driven motor, which is proportional to the rotation speed. This value in turn can be used to close the control loop and create a true speed-controlled H-bridge. When more precise measurement of the rotation is required, an external quadrature encoder can be used and the signal of the optical gates can be fed back to the module. Two input pins are wired to a header for that purpose.

Miscellaneous functions

The module on the top of the standard TWI interface, that is common among all µModules also contains a (logical level) RS-232 interface as well. This interface can be used to connect the module to other microcontroller modules or (after level-shifting) to a PC which doesn’t have a TWI interface.

The TWI interface

The TWI interface adheres to the standard µModule communication protocol. It implements 8-bit register-bank addressing, and defines 32 registers. Each register corresponds to a single channel.

Offset Size Name Access Comment
0 int16_t RequestValue R/W Speed control request signal R/W (Scaled between -0x3fff and 0x3fff). 0x4000 is freewheeling and 0x4001 is braking.
2 int16_t IFactor R/W PID control loop integrator value
4 int16_t PFactor R/W PID control loop proportional value
6 int16_t DFactor R/W PID control loop differentiator value
8 int16_t PFFactor R/W Control bypass proportional value
10 int16_t SampleOffset R/W Control loop input bias
12 int16_t MaxPositiveChange R/W Maximum single-step change in speed in the positive direction. If a bigger change is requested in RequestValue a ramp is generated.
14 int16_t MaxNegativeChange R/W Maximum single-step change in speed in the negative direction. If a bigger change is requested in RequestValue a ramp is generated.
16 int32_t Distance R/W Integrated actual speed value. An approximate measurement of the travelled distance.
20 int32_t FwDistanceLimit R/W Maximum distance allowed in the positive direction. When Distance approaches this value, a speed-ramp usingMaxPositiveChange is generated such that speed will reach 0 when distance reaches FwDistanceLimit
24 int32_t BwDistanceLimit R/W Maximum distance allowed in the negative direction. When Distance approaches this value, a speed-ramp usingMaxNegativeChange is generated such that speed will reach 0 when distance reaches BwDistanceLimit
28 int32_t DistanceToStop R/O Current estimated distance required to stop
32 int16_t CurrentRequest R/O Actual current speed request value. This in general is equal to RequestValue except when ramp-generation is in progress
34 int16_t Command R/O Command given to the H-bridge. This is the output of the control loop
36 int16_t IValue R/O PID loop working set
38 int16_t LastError R/O
40 int16_t Error R/O
42 int16_t VoltageSample R/O Last Back-EMF sample. This is the measured speed, and the input of the control loop
44 int16_t BaseValue R/O Back-EMF sampling code working set
46 int16_t SampleCnt_Snapshot R/O
48 int16_t MinValue_Snapshot R/O
50 int16_t MinValue R/O
52 int16_t MaxValue R/O
54 int16_t SampleCnt R/O
56 int16_t OriginalRequestValue R/O Ramp-generation code working set
58 uint8_t SampleState R/O Back-EMF sampling code working set
59 uint8_t DutyCycleThrottle R/W Maximum duty cycle allowed on the H-bridge. This limits the maximum (average) voltage that can be applied to the motor
60 uint8_t NewData R/O Used for debug outputs
61 bool8_t IsForward R/O Set to true if the motor is energized in the forward direction
62 uint16_t CurrentMax R/O Peak current drawn by the motor
64 uint16_t CurrentDelta R/O Current draw detection code working set
66 uint16_t CurrentTemp R/O
68 uint16_t CurrentMaxSearch R/O
70 uint8_t ADBufferEnable R/O When set to 0, AD sampling is in progress
71 bool8_t ADBufferEnableHost R/W When set to true, host request a new set AD sampling. It will happen in the next control cycle. When sampling is done, it is reset to false
72 uint16_t CurrentLimit R/W Maximum current draw allowed. If during the ‘on’ part of the cycle, the current draw reaches above this level, the MOSFETs are switched off and the ‘on’ part of the cycle is terminated
74 uint8_t OperatingMode R/W Set to 0 for speed-controller, and 1 for servo-controller mode
75 uint8_t Dummy1 R/W Reserved
76 uint16_t*80 ADBuffer R/W AD sampling buffer


Signed 8-bit integer
Signed 16-bit integer
Signed 32-bit integer
Unsigned 8-bit integer
Unsigned 16-bit integer
Unsigned 32-bit integer
8-bit boolean value (possible values are 0 for false, and non-zero for true)
Register has read/write access
Register has read-only access

Design files

µModule Users Manual (HSOL)
Schematic and PCB in PDF format (HSNCL)
Firmware source code (HSNCL)

Print Friendly, PDF & Email

33 thoughts on “µM-H-Bridge

    • Hi!

      This is a hard question to answer actually. I in fact have tried it with motors that consume several amps, but the current conducted by these shottky diodes depend a lot on the drive mode, the motor, the mechanical load and other factors. You might want to leave them out and rely on the intrinsic diodes in the MOSFETs for conduction – they at least have better cooling. You probably want to choose a drive mode where these diodes hardly conduct at all no matter what though… See here http://modularcircuits.tantosonline.com/blog/articles/h-bridge-secrets/mosfets-and-catch-diodes/ for more details on what to consider as far as the catch diodes go.

  1. what driver should i go for if i am interested in using 24volts? I dnt want the controller part so dont keep that in mind while suggesting a driver.
    P.S great design

        • It’s really not that different: you just need a pair of these, one for each side of the bridge. You probably don’t need R3, C6, and definitely won’t need L. What kind of FET and how many in parallel you need, that depends on your application. I would still at least provision for a gate-drive resistor on both the high- and the low-side (missing on the low-side in the application circuit). Just as they show, you can always populate them with 0-ohms if not needed.

          • what is confusing me is that why did they use two mosfets on the low side. I would be using the same fets as u used in your design in the same manner as u did. Secondly I was planning to remove jp13 and jp14 alongwith r3, c6 and L. what would you say to it. I am sorry for bugging u, just needed help

          • I don’t claim to understand why they’ve used two low-side FETs. But whatever the reason is, it depends on the application. You should be fine with only one FET. The two jumpers you mention are just for testing, you can leave them out.

  2. Another little favour i need is with understanding what bootstrap is for? Can u send me nice link or just explain it a bit

  3. Thanks for a great deal of knowledge you provide on the blog.

    I was looking at the circuit for this h-bridge driver and I can’t grasp one thing. You’re using 4 n-channel mosfets, which means that you need a higher voltage on the high side. What technique are you using for increasing the voltage? It doesn’t look like you’re bootstrapping, but probably I’m not seeing something.

  4. I am new to this, so please, can someone explain me the procedure to keep following and maintaining the speed of the motor?
    I have already read h-bridge.cpp, but as i mention before, i am newbie and i could n’t understand it clearly.
    Also, why there are two different lines for measuring the voltage across the motor ends?
    Thank you!

    • Vasilis,

      The motor speed control is something I wanted to write about in a follow-up article in the H-Bridge Secrets series. It’s definitely more complex of a subject then to answer it in this format. The just of it, is that it’s a PID control loop. Until I get around writing that article, you google it, you’ll find plenty of good descriptions all over the web.

      As far as the two different voltage measurement points: ideally you want to measure the differential voltage on the motor. Since one end of the motor is at a known voltage (power supply or GND) however you can figure out the differential voltage by just measuring one end. I wanted to build this bridge to be as flexible as possible so I didn’t want to constrain which end of the motor is tied to which power supply. That’s the reason for dual measurement points. Another benefit of this approach is that you can detect faults, when something is not at the expected potential. For example a failed FET or a broken wire would cause detectable changes in the way these voltages change over time. I don’t have such detection implemented in the code though…

  5. The above article says that the bridge can handle 16A but,
    the total Rdson of the circuit is 0.018(High side)+0.018(diagonal low side) = 0.036ohms
    Power dissipation = (16*16)*0.036 = 9.216W
    Junction to ambient thermal resistance is 62 C/W
    The temperature at the junction would be 9.216*62 + 25(ambient) = 596C
    Correct me if I am wrong

    • You have some great points and I’ve corrected the page to clear up the confusion. The 16A current limit referred to the current sensing ability of the circuit and thus is the peak current delivery capability. The continuous current limit is about 10A if the MOSFets are replaced by something better then the IRFZ48 in the schematic, such as the IRL2203. For your calculations, I don’t think it’s fair to add the Rdson of the two MOSFets but then using the junction-to-ambient temperature coefficient of a single package. True, the transistors are packed together very tightly in the current design, so simply using a single package isn’t really realistic either, the truth is somewhere in between. Which is how the 10A current limit came about: 8mOhm of Rdson and 62degC/W temp coefficient (from the IRL2203 datasheet) results in a temp rise of 50degC over ambient. The maximum allowable junction temperature of the device is 175degC, which gives a rather safe margin. Redoing the same calculations with 16A would result in a temperature rise of 126degC, which starts cutting it close.

      I hope this helps and thanks again for the comment,

      • After commenting I realized that I had considered rdson of two FETs and using temperature co-efficient of a single package. But there was no way to edit the comments.

  6. You should create another write-up, where you build a bridge from scratch and directly show the calculations and brief reasoning for it. From the output side to the input side.
    1)Motor – its specifications such as Voltage, no-load current, stall current.
    2)MOSFETs for H bridge depending on the Motor specs.
    3)Driver depending on the MOSFET specs and PWM frequency.

  7. Hello Andras,

    thank you for the amazing work you share with us here 🙂

    Can this be used also to control a TEC in cooling and heating mode? If so, can I control a 180W TEC Module which works at max 12A and max 15V?

    Best regards

    • Timo,

      I think it can be done, but I have no experience personally. A quick search showed that people do it by adding an inductor in series with the TEC to serve as a voltage-to-current averaging device. Check out the LTC1923: this is a ready-made controller for what you need, I think. Even if not, should provide you with some ideas on how to use an H-bridge for this application.


  8. Hello Andras,

    thank you for the amazing work you share with us here 🙂

    Can I modify this H BRIDGE to operate with 24 volt by separating the ic driver voltagre from the h bridge supply voltage ?t in other word , i inject 24 volt for vbat and 18 volt for each ic driver LTC1155 & IR4427 ?

    Best regards

    • Anwar,

      I don’t think that would work. The high-side driver would need to be able to drive the gates of the high-side FETs above VBAT to open them. If you look at the datasheet of the LTC1155, it shows that the high-side gate drive voltage tops out at around 22V. You would need at least 28V or so to properly open the high-side FETs.

      This is also a very old design of mine, something that I wouldn’t recommend using these days at all. There were reasons for my unorthodox design choices, but the usual way of dealing with high-side gate-drives is a boot-strap circuit. I describe their operation here: https://www.modularcircuits.com/blog/articles/h-bridge-secrets/h-bridge_drivers/. Thanks to modern mother-boards and processors there’s a glut of really good integrated gate-drivers of this kind, though finding one that works all the way up to 24V might be a little tricky.


Leave a Reply

Your email address will not be published. Required fields are marked *