Pager motor + Arduino

I saw a couple threads broaching this topic but it isn't completely clear to me still.

I just took apart an old electric toothbrush and removed the pager motor inside. The motor had been powered with a AA battery. Using jumper cables--one to 3.5v and the other to gnd--I was able to power the motor to spin.

I'd like to look into controlling the motor with a sketch, but I first want to make sure the Arduino can power the motor safely. In the other threads I saw talk of capacitors used between the Arduino and the motor.

Any help welcome! Below is just a picture of the motor and setup to give everyone an idea of the motor size.

The motor will probably take more then 40ma at 5v.
You have to use transistors and dont forget the base resistor.

Could you expand on that? 40ma is over the threshold that the Arduino can supply safely using the on-board power?

Could you expand on that? 40ma is over the threshold that the Arduino can supply safely using the on-board power?

Your main limits are 40 mA per pin, up to 200 mA total; that means (in theory) you could bring 5 i/o pins to a digital HIGH state, and draw 40 mA from each, and be safe. Draw any more, or use a sixth pin, and you're hosed (well, your ATMega is, anyhow).

That's in theory. In -practice-, you probably don't want to exceed 20-25 mA per pin, or even less, depending on how many pins you plan to use at any one moment of time. That, and you never want to use any component at the limits of its design, as that can be asking for trouble (unless you have no other choice, and even then you better think hard about what you are doing).

Download the datasheet for the ATMega328 from Atmel; it will tell you all you need to know and then some:

For your motor, you will most definitely want to use a transistor or mosfet driver of some sort to control it, as it will likely pull more than 40 mA. Even if it didn't, you should always use an interface of some sort (and know the current needs for that interface) for any external electronics you are interfacing that require power to control (so-called "active" components, mainly).

For motors, there are plenty of examples around (just google for "arduino motor control") for simple single transistor motor control, as well as more complex (but still fairly simple to understand) h-bridge controllers using both discrete components (transistors/mosfets) as well as packaged IC devices.

:slight_smile:

Thanks cr0sh!

Out of curiosity, what's a good way of knowing how many mA a piece of hardware is going to pull? I'm assuming smeezekitty's assumption that the motor would be more than 40mA was based upon some pre-existing knowledge--but is there a basic cheat sheet or rule of thumb?

Does the motor shield make this sort of simple interaction (Arduino to pager motor) easier? From what I can tell from the FAQ it's designed more for larger 6v+ motors.

I noticed the specs have "4 H-Bridges: L293D chipset provides 0.6A per bridge (1.2A peak) with thermal shutdown protection, internal kickback protection diodes. Can run motors on 4.5VDC to 36VDC."

A great way is a simple current meter or a data sheet if you can find it. The meter works if the current draw is constant or you can get fancy and use a scope and a low value resister in series with the load.

Experiment.

Kevin

Out of curiosity, what's a good way of knowing how many mA a piece of hardware is going to pull?

There are two ways, basically - one is to consult the datasheet for the device in question. If that isn't available, and the device is fairly basic (like a motor), then direct measurement of the current with a multimeter can be done.

I'm assuming smeezekitty's assumption that the motor would be more than 40mA was based upon some pre-existing knowledge--but is there a basic cheat sheet or rule of thumb?

Not really anything that would work in all situations...

Does the motor shield make this sort of simple interaction (Arduino to pager motor) easier? From what I can tell from the FAQ it's designed more for larger 6v+ motors.

As always, consult a datasheet:

http://www.datasheetcatalog.org/datasheet/texasinstruments/l293.pdf

Here, you'll see the L293 can run motors from 4.5 VDC to 36 VDC, up to 1 amp continuous current draw. You'll also notice its a dual-bridge, so you can run two motors with full control of direction and speed. As you approach the top-end current draw, though, you would want to incorporate a heatsink on the chip, which the datasheet describes.
Yeah; anything using an L293 is best for small motors which run on 5-6 volts, 1

I noticed the specs have "4 H-Bridges: L293D chipset provides 0.6A per bridge (1.2A peak) with thermal shutdown protection, internal kickback protection diodes. Can run motors on 4.5VDC to 36VDC."

Unfortunately, this bridge likely won't work with your motor, as you motor is likely a 1.5-3.0 VDC motor; while you could "overvolt" the motor with 4.5-5.0 VDC, its bearings and other parts will likely fail in short order, leaving you with a burned out motor.

Your best best for this kind of motor would be to build your own discrete transistor h-bridge, made from NPN and PNP transistors; 2n2222 (NPN) and 2n2907 (PNP) transistors are complements of each other, and likely perfect for the job - here's an example circuit of such a bridge:

http://www.solarbotics.net/library/circuits/driver_4varHbridge.html

You can build it in a very tight back-to-back transistor mounting fashion - as shown on the page.

Finally - on measuring the current of a motor:

For small motors (which you are fairly certain pull under 10 amps), putting a multimeter in series with the motor can work fine. Put the meter on current measurement for 10 amps, put the positive probe in the current measurement jack (some meters have a separate jack for 10A measurement; if you know your motor is likely under the smaller amperage measurement, you can leave it there, but it is generally best to start high, then work low - keeps you from blowing your meter).

Hook the meter in series with your motor, then verify everything (including the meter setting!). Then, hook it up to your power supply or battery, and run the motor. Note the reading of the amperage with the voltage. This is the running no-load current.

If your motor is small enough (don't try this on really large motors), grab the shaft to slow it down, or even stop it (briefly!) and note the current reading for the voltage; it should be much greater. This is the stall current.

Your h-bridge should be sized to handle the stall current, at least briefly; its design should allow for continuous running capability of the motor at a current about 50-70% of the amount between the running current and stall current. For example, if your running current is 10mA, and the stall current is 100mA, then the h-bridge should allow for up to 100mA intermittently, but have a continuous rating of around 45-65mA.

For larger motors (>10 amp current draws), the best way to measure is via a very small value shunt resistor (this can be something simple like a small length of thick copper wire). Knowing the resistance of copper wire for its cross section (gauge) and length, you can measure the voltage drop across the wire using you meter, then apply Ohm's Law to calculate the resulting current being used.

:slight_smile:

Unfortunately, this bridge likely won't work with your motor, as you motor is likely a 1.5-3.0 VDC motor; while you could "overvolt" the motor with 4.5-5.0 VDC, its bearings and other parts will likely fail in short order, leaving you with a burned out motor.

What is the data sheet voltage drop across that h-bridge? If it is 1-2v then the motor might be ok. A diode in series on the power supply could provide another .7v drop.

Thanks for the helpful responses!

I'm going to take a look at the information available and see what I think I can come up with--the links cr0sh provided look to be about at my level of expertise. Any follow ups, I'll be sure to post! This isn't for any particular project but just simply a dabble into motors.

What is the data sheet voltage drop across that h-bridge? If it is 1-2v then the motor might be ok. A diode in series on the power supply could provide another .7v drop.

The datasheet I posted doesn't seem to list that information; the closest thing to an answer I could find was:

Output voltage range, VO: –3 V to VCC2 + 3 V

Where VCC2 is 4.5-36 V - so at the lowest input voltage of 4.5 VDC, the output could go as low a -3V and as high as +7.5V; I'm not sure whether that means a "yes" or a "no", actually (leaning towards yes, gut feeling).

:-?

If you had a space 293 laying around, it would be worth trying, but I'd hate to be wrong and recommend buying an entire Arduino shield that wouldn't work.

Though as Danrosey points out, he's only playing around, so if the shield interests him and he thinks he could use it for something else in the future (which I'm sure he could!), maybe he should go for it!

:slight_smile:

Though as Danrosey points out, he's only playing around, so if the shield interests him and he thinks he could use it for something else in the future (which I'm sure he could!), maybe he should go for it!

You're exactly right. I think it'll definitely come in handy and could be fun to put together.

How can the output voltage be greater then the input voltage?

How can the output voltage be greater then the input voltage?

On the motor shield I have, you put a battery pack into an ext-power block.

They could also have a voltage step-up.