Yet another FET-based H-bridge
I was inspired by Chuck McManis and his BJT-based H-bridge tutorial and I wanted to build a similar H-bridge based on MOSFETs. The design goal was for the H-bridge to have simple logic-level interfacing with a minimal number of pins and being PWM'able by a single pin similar to what Chuck's H-bridge has and a low count on distinct components - and of course keeping the H-bridge fairly cheap. I'm sorry to say that I had completely forgotten about OddBot's excellent H-bridge when designing the H-bridge (sorry for not using the LMR-search and sorry for drinking so much booze that I can't remember anything) - but hey... the more the merrier, right? :-)
Like OddBot's H-bridge this one can handle 20A since we use the same MOSFETs. Also like OddBot I've not added flyback diodes since the body diodes in the MOSFETs are doing a good job.
I deferred from using the LM339 quad-comparator for level-shifting that I used in my TinyTim robot (and which OddBot is also using in his H-bridge) and instead made level-shifting inverters using a resistor and a BJT - they are the resistors and BJTs closest to the MOSFETs in the schematic and where the resistor is connected to V_BAT (why on Earth didn't I put component names in for easy reference?). For the curious George the components interfacing the two lower MOSFETs form two level-shifting AND-gates (the input to the lower-left MOSFET is (B AND ENABLE) shifted to V_BAT level and the input to the lower-right MOSFET is (A AND ENABLE) shiftet to V_BAT level.
Pins A and B are interfaced from the microcontroller and control motor function:
- (A, B) = (LOW, LOW) : off
- (A, B) = (HIGH, LOW) : rotate one way
- (A, B) = (LOW, HIGH) : rotate the other way
- (A, B) = (HIGH, HIGH) : electronic braking (low-side)
The ENABLE pin is also interfaced from the microcontroller and is used for PWM speed control of the motor, so you would typically connect this to a PWM capable pin of your microcontroller.
V_BAT should be connected to the positive supply on your motor battery.
I'm currently using two of these H-bridges on my new robot (still waiting to be enrolled into LMR) and they are doing very well - being controlled by an Atmel Tiny26 which will eventually turn into an I2C enabled dual motor controller.
This H-bridge is a little more power hungry than ones not using the resistor + BJT construction for level-shifting and logic but this should not be a major concern unless you really want to minimize power consumption. The motor is still by far going to be the major power consumer.