Controlling geared motor and servo motor with elegoo mega 2560

does anyone have advice on how to control a geared motor and stepper motor with mega 2560. i have the elegoo most complete starter kit for the mega 2560, i need to be able to control direction and speed with the geared motor and direction with the stepper motor.


Welcome to the forum

The second 'photo shows a servo. Is that what you have ?

yes, that is the servo that i have

sorry, i meant to say servo instead of stepper motor

You mention controlling the direction of the stepper servo, What exactly do you mean by that ?

A servo such as the one pictured can be commanded to move to an angle, usiually between 0 and 180 degrees (or less). If that is what you want to do then it can be done using the Servo library

To control the motor you will need to use a motor driver board to which you send commands to control the speed and direction of rotation of the motor

You will need an external power supply for both devices as the Arduino cannot provide enough power for them

so, for the servo i would just command it to move to an angle and then move back to zero if i wanted it to return to the original position

Yes, as long as it is real servo and not a "continuous rotation servo" whose angle cannot be controlled, only its speed and direction

how should i set up the hardware with a breadboard.

What is your experience of electronics and programming ?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.