My H-Bridge Horror Story

0

I love robots. I’m all about building strange and wacky robots that skitter and crawl. There are loads of cool things you can do with microcontrollers like the DP32 or uC32, but the thing that makes robots stand out is movement. Robots don’t just blink lights and communicate over wifi. No, robots move, and there’s something viscerally pleasing about that.

Line Follower 1

But that movement comes at a special price. LEDs, bluetooth, buttons and screens… all these things are made to play nicely with simple, low-power, digital signals. Movement needs motors, and for motors, nine times out of ten, you’ll need an H-bridge.

Digilent's PmodDHB1 which can drive up to two DC motors or one stepper motor.

Digilent’s PmodDHB1 which can drive up to two DC motors or one stepper motor.

I won’t get into what exactly an H-bridge is. Kaitlyn has already written a really good post on that. For now, it will suffice to say that an H-bridge is a simple and powerful circuit for driving a motor both forwards and backwards. But (as Kaitlyn’s explanation points out), it’s very easy to accidentally short out H-bridges.

This is something I’m very well aware of. Any time I mention H-bridges, either here on this blog, or in my tutorials on Instructables, I am careful to point out how easily you can accidentally short them out. I don’t hate H-bridges, I’m just paranoid, and for good reason.

Let me set the scene for you.

I’m a student at Washington State University, and the semester is drawing to a close. I’m over-worked, under-slept, and I’ve been stringing from homework, to project, to test, barely finishing one before I have to immediately rush to finish another. It is seven in the morning, and I’ve just spent all night awake in my freezing apartment getting a simple line-following robot working.

F - line following robot

 

My robot is built using the Digilent Motor Robot Kit, but I’ve replaced the AA battery pack with a little NiMH battery to get better response from my motors. My code is barely functional, but I’m out of time and energy, so I pack up and trudge through the snow and ice to the presentation room.

The presentation is a party. There’s pizza, soda, and geeks playing with robots, but my spirits are at an all-time low. Part of my code that I thought had been functioning, suddenly seizes up, and my robot refuses to move anymore. I check my code, but cannot find any issue. I check my wiring, everything is connected. I check my code again…

There’s a rule I’ve come to trust regarding critical electronics which says they will always fail you at the most injurious moment. This rule is intrinsically tied, in my mind, to that special smell of electrical smoke that immediately proceeds the dawning of horrified realization.

blue-smoke

 

Panicked, I flipped my robot over and for a moment I was confused. My sleep-deprived brain was not sure if the Pmod HB5 had an on-board LED. Checking the other, it seemed absent, and in it’s place… the H-bridge IC. In shorting out, my H-bridge had allowed my overzealous NiMH battery to form a small ark, that glowed as brightly as an LED.

Panicked, I attempted to unplug the power, only to burn myself on the overheated connector! Fumbling with my pliers, I managed to yank it free. I waited a tense moment, wondering if the NiMH was going to explode in my lap, but curiously, the smell of the burning plastic did not abate. The battery was unplugged! That wasn’t possible, but sure enough the wire was just as hot as before!

fried-wire

This is just a recreation. Do you really think I’d stop to take a picture?!

That was the key. The battery leads had overheated, and melted through their plastic casing. They were shorting through the lead itself! Quickly, I cut the wires, and stepped away from the battery, waiting for it to explode or something. After a long, tense moment (and a lot of attention from the others in the room), I figured it was safe.

Needless to say, that pretty well killed my chances of getting the robot to work, but the demo of my speed controller code was enough to earn me a passing grade. Eventually I figured out what had gone wrong.

We had reviewed H-bridges in class, of course, and being a good student, I’d taken notes and made sure to include safety measures in my code. What I didn’t understand, however, was that even digital circuits are, at their heart, analog, and digital signals do not transition immediately or perfectly. Though my code protected against a short in theory, in practice the transition voltage had allowed the short for just a moment, and that was all it took for my over powered NiMH battery. That just goes to show how tricky electronics can be!

H-Bridge Short

I’m not sure what the moral to this story is. Certainly I learned a valuable lesson about H-bridges, and I feel like I got my feet wet (or my fingers burnt) for the first time. I think it’s a rite of passage in electronics, that eventually you’ve got to burn out an H-bridge, brick a piece of hardware, or smash something up real good.

At any rate, you don’t have to burn any H-bridges! I’ve taken what I’ve learned and written a whole tutorial on Instructables all about the proper use of H-bridges. Read that, and you’ll avoid a whole lot of stress. Break something else instead.

The infamous H-bridge, which I kept as a sort of engineering merit-badge.

The infamous H-bridge, which I kept as a sort of engineering merit-badge.

Share on FacebookTweet about this on TwitterShare on Google+Pin on PinterestShare on RedditShare on TumblrShare on LinkedInShare on StumbleUponEmail this to someone
Share.

About Author

Leave A Reply