I would like to enter how many revolutions a motor should complete to move an item down a conveyor belt, stop and, then return to the initial position. How do I code that?
Hello matt434343
Keep it simple and stupid firstly.
Run some tutorials for the hardware selected.
If you are happy with the results of the tutorials you can merge these to your project.
Have a nice day and enjoy coding in C++.
Need a lot more info....
What type of motor? Servo? Simple DC motor? You need to drive a motor with some external motor control board and power supply since an Arduino can not supply enough current.
Look at the AccelStepper library for lots of examples. Many good motor driver boards are available from https://www.pololu.com/
Hi @matt434343
welcome to the Arduino-Forum.
indeed it depends on the kind of motor.
Your question
Is very generalised.
The answer depends on the type of motor.
As for the functionality itself:
move an "item" down a conveyor-belt, stop at opposite end
then move back to start-position
for continious-rotation RC-servos or for DC-motors (brushed or brushless) two lightbarriers could detect the end-positions.
Steppermotors can be controlled much more precisely and moving down the conveyor-belt equals to a certain number of steps which must be found be experimentation or by careful calculations.
So without knowing the type of motor and the type of motor-controller you are using
a more detailed answer would include multiple tutorials how to control different types of motors with different types motor-drivers.
This is way too much demanding. You should post
- exact type of motor you are using (the datasheet of this motor)
- exactt type of motor-driver you are using (the datasheet)
If you are in the designing stage of this project.
Depending on the size, the weight of your "item" and the speed of the conveyor-belt
different types of motors would be best suited
So after these sentences I hope you can see the best thing is to read this
and then post all the detailed information.
best regards Stefan
How does the controller know the position of the item?
There will need to be some sort of feedback from the motor to be able to move the conveyor from one position to another. If the motor is a stepper then there will be a relationship between steps and the distance that the conveyor moves per step. The same principle would apply to a motor with an attached encoder.
Another way would be to monitor the position of the item with something like light gates.

Light gates.
-
The conveyor belt could have timing markings on it.
-
You could add metal studs (or magnets) to the belt that can be detected by a sensor (hall effect ).
Build a test bed without any controller.
- Simply to perform the required motions in the real world - with real items on the conveyor.
Take all your measurements to understand the speed, load, torque and timing requirements.
Now you know what’s required to achieve yiur objectives.
Choose a motor (and gearing if necessary), then you can control it with input from any sensors or switches identified.
Remember to confirm your power requirements!
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.