All about the L298N H-bridge motor controller module

Oh boy, was I confused about this module at first! I found a fair amount of bits and pieces about it, but could not find the complete info that I was looking for. So I decided to create this tutorial for others who want to understand it better. I’m not an expert, but I have figured it out well enough to make what I think is a very clear and complete basic ‘primer’ on this device. Whether it’s right for your project is up to you to determine, but here’s info about the module itself, and especially about the mysterious jumpers (at least they were the biggest mystery to me).

What is it?

This module is a very inexpensive and convenient package based on the L298 dual full-bridge rectifier chip made by ST Microelectronics. It can be used to drive speed and direction for one servo or two standard DC motors, and drive other inductive loads like relays and solenoids. It can be controlled by microcontrollers like the Arduino.

Here is the description of the chip (not the module) from ST: The L298 is an integrated monolithic circuit in a 15-lead Multiwatt and PowerSO20 packages. It is a high voltage, high current dual full-bridge driver designed to accept standard TTL logic levels and drive inductive loads such as relays, solenoids, DC and stepping motors.

You can see the data sheet on their website here: http://www.st.com/en/motor-drivers/l298.html .

You could just purchase the chip and component parts and wire up your own parts, but this complete module is probably cheaper than the combined parts, and it’s certainly more convenient. As of January, 2017, the modules are selling on ebay for under $2.00! At this price they’re from China of course, but you can purchase them at higher prices in the United States if you can’t wait for the long shipping times from China.

I’ve read in forums that the L298 chip is about 15 or 20 years old, so there are better(?) chips available now. People seem to like the Pololu A4988 https://www.pololu.com/product/1182 .  Stepper motor current limiting is apparently one of the big improvements, but none of the current-limiting chips come in this neat module format that I’m aware of. So this L298N module is fun and handy, certainly great for testing and little projects, but be careful if you need current-limiting features when driving stepper motors.

The module components

Here’s where I was the most confused. If you look at the auctions on Ebay you get the typical Chinese-translated-to-English descriptions that are neither complete nor understandable. And searching for other resources on the internet or YouTube results in some great information, I was not able to find any one source that was all-inclusive like I’m hoping this one is (for a basic primer anyway).

…More coming soon…

My new CD is available now!

cd-art-tear-downs

cauldron                    junction box

Learn About Halloween
Animatronics!

And other animated gadgets and props!

Get 17 videos and close-up photos!

CD mailed to you — or download right now!

Click here to see the complete ‘Witch’s Legs in Cauldron’ video on youtube

Click Here to Learn More and Order!

 

Ways to Lift Lids (as in opening coffin lids for Halloween props)

I thought I would offer some ideas on different ways to open box lids. My main motivation has been finding a good way for lifting the lid of small Halloween coffin props, but the techniques can be used for many other applications as well.

I love to play around making these things as a hobby, but I need to make smaller versions of these because I don’t have enough room for full-sized ones. Here’s an example of a nice full-sized one by MrTmartindale on YouTube.

Seeing as I was recently playing around with pulleys I thought I would start with probably the most basic way to lift a lid — with a string!

open2a            open3a

There are a lot of potential problems with this arrangement:

It’s visible.

You need to reverse the polarity on the motor for up and down directions.

It takes up a lot of space.

It needs a lot of parts: string, string pulley, pulley support, motor, motor pulley, motor mount, and some way to reverse the motor direction.

More ideas and videos coming soon…

Playing with Pulleys

Today I’m starting to experiment using pulleys. They’re not used all that much in animatronics. I’m guessing it’s because they’re not as strong, predictable, or reliable as gears. But sometimes they can be useful. I see them a lot on the outside of gearboxes like this one, where the inside is chock full of gears (click photos to open larger versions in a new window):

geartrain_3285-15

I’m guessing this is the case when they don’t have room inside a standard  gearbox (if there is such a thing in animatronic toys) and when speed, direction, or power transfer are not critical. Although, I wonder why they just don’t re-design the gearbox to accommodate this arrangement with gears? I have come across two toys where the drive belt has broken and rendered the toy’s animations useless.

Now these little gearboxes are tremendous to use in small animatronics, but it’s not possible for most of us to design our own gearboxes on this small of a scale. So pulleys are one way to drive our own hobby animatronics.

Enter my beginning learning design!

hobby motor and pulley

The first thing I had to do was get myself a little hobby motor. They are easy to find in just about any animated toy. They are pretty generic can usually run on anything from 1-1/2 to 6 volts DC or so. The problem with using just the motor is that they spin way too fast (around 10,000 RPM), and they have no power. Gears, or pulleys, are used to slow down the rotation and increase power.

To be continued

Using Arduino Nano and a relay to fire a solenoid

In my previous post I talked about using a motor, a cam, and a switch to fire a solenoid. That just wasn’t going to work because it was too hard to get the right pace of the solenoid firing. The motor voltage changed its speed, and the cam idea was too difficult to adjust the cam shape and location.

In this post I’m showing how I switched to the Arduino Nano to control the firing rate of the solenoid. With the Arduino, it’s a 30-second program change to change the rate of the solenoid firing as opposed to the ridiculously difficult process with motor and cams.

The first video below shows the solenoid firing using the default settings in the sample ‘Blink’ program in the Arduino IDE.

 

The video below shows the solenoid firing after I modified the delay settings in the ‘Blink’ program.