Getting a DC motor to rotate X times

Hi,

I am a complete beginner to Arduino and wish to use it as part of a project.

I need to set up a small DC motor to be able to rotate a set amount of times (likely between 1 and 10 full rotations at the push of a button), and I need the motor to finish in the same position as the position it starts in, is this possible to do and if so what would be my best steps for achieving this?

Thanks :slight_smile:

You will need a shaft encoder and a motor driver. If only full rotations are required, a disk or gear with one slot or hole in it, combined with detector, will work to count revolutions. Something like this.

Getting a DC motor to stop at a specific angle, even with an encoder, is not a trivial exercise.

Tell us about the project you want to create. There may be a better way.

...R

The possibilities are PID loop and encoder, or use a stepper motor instead.

Can you say a bit more about what you are trying to do? That might make the decision
for you.

Thank you for your responses, I will try and post a video later to show what I am trying to rotate.

To put into words it is basically a shaft with an indent in it of about 10 cubic centimetres which is designed to be filled with powder and rotated around 180 degrees, dispense the powder below, and then back to its original position to refill and dispense as many times as requested.

By the looks of things a stepper motor currently seems like the simplest suggestion for this project but I am still very interested to hear any suggestions.

:slight_smile:

+1 for stepper.

+2

Renfree:
Thank you for your responses, I will try and post a video later to show what I am trying to rotate.

To put into words it is basically a shaft with an indent in it of about 10 cubic centimetres which is designed to be filled with powder and rotated around 180 degrees, dispense the powder below, and then back to its original position to refill and dispense as many times as requested.

By the looks of things a stepper motor currently seems like the simplest suggestion for this project but I am still very interested to hear any suggestions.

:slight_smile:

You need to design your system with mechanical stops at the locations desired. The stops will have micro switches to tell you the stop has occurred. You may no even need an Arduino.

Paul

Renfree:
Thank you for your responses, I will try and post a video later to show what I am trying to rotate.

To put into words it is basically a shaft with an indent in it of about 10 cubic centimetres which is designed to be filled with powder and rotated around 180 degrees, dispense the powder below, and then back to its original position to refill and dispense as many times as requested.

That sounds like a job for a servo. And it doesn't describe something that can "rotate a set amount of times (likely between 1 and 10 full rotations)". So where do the full rotations come in?

Steve

Renfree:
designed to be filled with powder and rotated around 180 degrees,

That is a half-turn.

Why did you say "between 1 and 10 full rotations" in your Original Post. There is a huge difference in the options available between the two requirements.

What @Paul_KD7HB has suggested seems like an ideal solution if the momentum of the system is low enough so nothing will be damaged when an end-stop is hit.

I am using a system similar to that to control the rotation of a turntable for model trains. But my turntable only rotates in one direction and I use a servo to withdraw the end-stop when the turntable needs to move further. The end-stop is extended again before the turntable's next track reaches it.

...R

So for my design a 180 degrees clockwise turn and a 180 degrees anti clockwise turn will also do the job just as well as one full 360 degrees rotation, which of these options is generally easier to put together?

The thing that will be most important is the precision of the turn and ensuring it returns back to the same position that it starts at.

Sorry for the confusion and thanks again for your help!

That is exactly what servos are designed to do...move to an exact position and then on command move back to the start position. Your only problem is that many servos only travel about 120-160 degrees so you need to look for one that will travel a full 180 degrees and has enough power for whatever weight you need to handle.

Steve

Is there any need to be concerned about the longevity of a hobby servo? I suspect they are generally not designed for 24/7 use.

A simple geared DC motor with end-stops as proposed by @Paul_KD7HB would get my vote.

...R

Yes, hobby servos are not engineered for 24/7 or anything remotely like that.

A robotics servo with longevity data in the datasheet or a stepper get my votes.

Rotating 1 to 10 times then waiting for a button push doesn't sound like running constantly 24/7 to me. But if that really is an (unstated) requirement then I too might put up with the additional mechanical complexity of arranging the mounting and triggering of limit switches.

As normal we only have partial project details to go on. Whatever the real requirements are there are several ways of doing it relatively easily.

Steve


This is a very common geared DC motor used in robot cars. It has an axis coming out on both sides. On one end you can attach a wheel, on the other end a rotary encoder plate. The plate has 24 slots. Have a LED and a light transistor read the slots. And a motor board drive the motor. Done.