Coding for DC motor to stop, rotate, and reverse rotate

Hi,
I'm a graduate student majoring chemical engineering,
so totally new to Arduino uno.

As a part of my research I need to use the motor to adjust the location of sensor.
What I intend to do is divide a certain path length for the sensor to move into several points (the distance between each points would be exactly same, of course).
Initially sensor will stay at the starting point for few seconds, move to the next position and stay the same amount of time as the first time, and so on.
Then finally the process need to be repeated from the endpoint to the starting point.

Can anyone explain what I need to do with coding?
Breadboard layout advise will be appreciated as well! :slight_smile:

It'll take details to answer this. Imagine the open ended questions I could ask a chemical engineer.

Can't be done with just a DC motor, since you have no position control. You are
looking for motion control, which means you will either need to augment your motor
with encoder, position sensors or some means of determining the actual position,
or move to using a stepper motor which can do open-loop position control.

Better is to use a servo motor with your sensor on its body. If you mention the angle and the timing I could post the wiring and the code for it…!

If the degree of movement for your project is not greater than 180 then you're looking for an analog feedback servo.

There are tutorials online to look how to make use of this kind of servo with an arduino.

What is the range of travel? - Scotty