Arduino motors not moving using ps2 controller

Hi everyone,
I am a beginner with Arduino I have been working on a project consisting of three motors but i cant seem to get my motors to run. I have tested each motor individually and made sure they all work but when i connect it to the circuit it does not work.
Here is my parts list :
Arduino UNO
3 Servo Motor - Standard 6 Volt with Metal Gear - 13kg
PS2 Joystick 2 axis module
Voltage Regulator 5v
Electrolytic Capacitor - 1uF/50V
Capacitor Ceramic 100nF
HeatSink TO-220
BreadBoard - Half Size
Jumper Wires Pack - M/M
All the code is from this project here: Robotic Arm from Recycled Materials - Arduino Project Hub
I wired it all up according to the diagram

When i run it on my laptop the code works and when i observe on the serial monitor the values change but the motors do not move.
Would appreciate any guidance.
Thanks

Post the code you're using here rather than hoping we'll wander all over the internet trying to find it.

But one problem is not enough power for the servos. You need a SEPARATE 5/6V supply of at least 3A to run 3 standard size servos safely. Trying to run any type of motor/servo from the Arduino 5V pin is a bad idea though you sometimes get away with a single micro servo for a quick test.

Steve

No power to them! :roll_eyes:

Im supplying the arduino with a 12v external power supply and running it out of the Vin pin, would it not work from that?
The code is in a library in this website - GitHub - Circuito-io/Robotic-Arm
That is the main code below.
// Include Libraries
#include "Arduino.h"
#include "Joystick.h"
#include "Servo.h"

// Pin Definitions
#define JOYSTICK_PIN_SW 2
#define JOYSTICK_PIN_VRX A3
#define JOYSTICK_PIN_VRY A4
#define SERVOSM1_1_PIN_SIG 3
#define SERVOSM2_2_PIN_SIG 4
#define SERVOSM3_3_PIN_SIG 5

// Global variables and defines
const int servoSM1_1RestPosition = 20; //Starting position
const int servoSM1_1TargetPosition = 150; //Position when event is detected
const int servoSM2_2RestPosition = 20; //Starting position
const int servoSM2_2TargetPosition = 150; //Position when event is detected
const int servoSM3_3RestPosition = 20; //Starting position
const int servoSM3_3TargetPosition = 150; //Position when event is detected
// object initialization
Joystick joystick(JOYSTICK_PIN_VRX,JOYSTICK_PIN_VRY,JOYSTICK_PIN_SW);
Servo servoSM1_1;
Servo servoSM2_2;
Servo servoSM3_3;

// define vars for testing menu
const int timeout = 10000; //define timeout of 10 sec
char menuOption = 0;
long time0;

// Setup the essentials for your circuit to work. It runs first every time your circuit is powered with electricity.
void setup()
{
// Setup Serial which is useful for debugging
// Use the Serial Monitor to view printed messages
Serial.begin(9600);
while (!Serial) ; // wait for serial port to connect. Needed for native USB
Serial.println("start");

servoSM1_1.attach(SERVOSM1_1_PIN_SIG);
servoSM1_1.write(servoSM1_1RestPosition);
delay(100);
servoSM1_1.detach();
servoSM2_2.attach(SERVOSM2_2_PIN_SIG);
servoSM2_2.write(servoSM2_2RestPosition);
delay(100);
servoSM2_2.detach();
servoSM3_3.attach(SERVOSM3_3_PIN_SIG);
servoSM3_3.write(servoSM3_3RestPosition);
delay(100);
servoSM3_3.detach();
menuOption = menu();

}

// Main logic of your circuit. It defines the interaction between the components you selected. After setup, it runs over and over again, in an eternal loop.
void loop()
{

if(menuOption == '1') {
// PS2 X Y Axis Joystick Module - Test Code
// Read Joystick X,Y axis and press
int joystickX =  joystick.getX();
int joystickY =  joystick.getY();
int joystickSW =  joystick.getSW();
Serial.print(F("X: ")); Serial.print(joystickX);
Serial.print(F("\tY: ")); Serial.print(joystickY);
Serial.print(F("\tSW: ")); Serial.println(joystickSW);

}
else if(menuOption == '2') {
// Servo - Generic Metal Gear (Micro Size) #1 - Test Code
// The servo will rotate to target position and back to resting position with an interval of 500 milliseconds (0.5 seconds) 
servoSM1_1.attach(SERVOSM1_1_PIN_SIG);         // 1. attach the servo to correct pin to control it.
servoSM1_1.write(servoSM1_1TargetPosition);  // 2. turns servo to target position. Modify target position by modifying the 'ServoTargetPosition' definition above.
delay(500);                              // 3. waits 500 milliseconds (0.5 sec). change the value in the brackets (500) for a longer or shorter delay in milliseconds.
servoSM1_1.write(servoSM1_1RestPosition);    // 4. turns servo back to rest position. Modify initial position by modifying the 'ServoRestPosition' definition above.
delay(500);                              // 5. waits 500 milliseconds (0.5 sec). change the value in the brackets (500) for a longer or shorter delay in milliseconds.
servoSM1_1.detach();                    // 6. release the servo to conserve power. When detached the servo will NOT hold it's position under stress.
}
else if(menuOption == '3') {
// Servo - Generic Metal Gear (Micro Size) #2 - Test Code
// The servo will rotate to target position and back to resting position with an interval of 500 milliseconds (0.5 seconds) 
servoSM2_2.attach(SERVOSM2_2_PIN_SIG);         // 1. attach the servo to correct pin to control it.
servoSM2_2.write(servoSM2_2TargetPosition);  // 2. turns servo to target position. Modify target position by modifying the 'ServoTargetPosition' definition above.
delay(500);                              // 3. waits 500 milliseconds (0.5 sec). change the value in the brackets (500) for a longer or shorter delay in milliseconds.
servoSM2_2.write(servoSM2_2RestPosition);    // 4. turns servo back to rest position. Modify initial position by modifying the 'ServoRestPosition' definition above.
delay(500);                              // 5. waits 500 milliseconds (0.5 sec). change the value in the brackets (500) for a longer or shorter delay in milliseconds.
servoSM2_2.detach();                    // 6. release the servo to conserve power. When detached the servo will NOT hold it's position under stress.
}
else if(menuOption == '4') {
// Servo - Generic Metal Gear (Micro Size) #3 - Test Code
// The servo will rotate to target position and back to resting position with an interval of 500 milliseconds (0.5 seconds) 
servoSM3_3.attach(SERVOSM3_3_PIN_SIG);         // 1. attach the servo to correct pin to control it.
servoSM3_3.write(servoSM3_3TargetPosition);  // 2. turns servo to target position. Modify target position by modifying the 'ServoTargetPosition' definition above.
delay(500);                              // 3. waits 500 milliseconds (0.5 sec). change the value in the brackets (500) for a longer or shorter delay in milliseconds.
servoSM3_3.write(servoSM3_3RestPosition);    // 4. turns servo back to rest position. Modify initial position by modifying the 'ServoRestPosition' definition above.
delay(500);                              // 5. waits 500 milliseconds (0.5 sec). change the value in the brackets (500) for a longer or shorter delay in milliseconds.
servoSM3_3.detach();                    // 6. release the servo to conserve power. When detached the servo will NOT hold it's position under stress.
}

if (millis() - time0 > timeout)
{
    menuOption = menu();
}

}

// Menu function for selecting the components to be tested
// Follow serial monitor for instrcutions
char menu()
{

Serial.println(F("\nWhich component would you like to test?"));
Serial.println(F("(1) PS2 X Y Axis Joystick Module"));
Serial.println(F("(2) Servo - Generic Metal Gear (Micro Size) #1"));
Serial.println(F("(3) Servo - Generic Metal Gear (Micro Size) #2"));
Serial.println(F("(4) Servo - Generic Metal Gear (Micro Size) #3"));
Serial.println(F("(menu) send anything else or press on board reset button\n"));
while (!Serial.available());

// Read data from serial monitor if received
while (Serial.available()) 
{
    char c = Serial.read();
    if (isAlphaNumeric(c)) 
    {   
        
        if(c == '1') 
			Serial.println(F("Now Testing PS2 X Y Axis Joystick Module"));
		else if(c == '2') 
			Serial.println(F("Now Testing Servo - Generic Metal Gear (Micro Size) #1"));
		else if(c == '3') 
			Serial.println(F("Now Testing Servo - Generic Metal Gear (Micro Size) #2"));
		else if(c == '4') 
			Serial.println(F("Now Testing Servo - Generic Metal Gear (Micro Size) #3"));
        else
        {
            Serial.println(F("illegal input!"));
            return 0;
        }
        time0 = millis();
        return c;
    }
}

}

Im supplying the arduino with a 12v external power supply and running it out of the Vin pin, would it not work from that?

NO definetly NOT!! The servos MUST be separately powered from an appropriate 5-6 Volt power source of adequate current capacity !! :woozy_face:

I have access to a lab power supply, would i be able to supply the voltage to the motors via this bread board? Arduino Compatible Breadboard with 830 Tie Points | Jaycar Electronics
And if so how would i wire it to power each motor ?
Thanks

A lab power supply would be Ok if it can be set to 6Volts and be capable of suppling the required stall current (3Amps for 3 servos).
The bread board would work for test purposes with decent wiring , as in 20 gauge wires. Individual wires for + and - supply into the breadboard from each servo and wiring into the power supply . Check continuity of all wiring before applying the power , of course. :nerd_face:

Bad idea to connect servos or any other motor via a breadboard. They are intended for low currents only. The servos may simply not work and/or may damage the internal connections in the breadboard.

Steve

Remember that the ground of the motor power supply must be connected to the Arduino ground. :face_with_raised_eyebrow: