Got it! Check end of post for solution.

I'm running a Mega 2560 with a RAMPS 1.4 Shield which is usually used for 3D printing applications. For my use case I only want to get at the stepper motor drivers. The RAMPS is pulling its own 12V power supply (using an old xbox 360 brick rated for 12V and have tested with a multimeter) and the Arduino is pulling 5V from an RPI. But for some reason I seem unable to get the stepper motor A4988 drivers to pull anything from the 12V power supply. The LED on the RAMPS turns on, and the stepper drivers are pulling a little power (also tested) but obviously not enough to get them to make the motors turn. In other words, the RAMPS isn't using the external power supply.

I'm NOT using any of the 3D printer firmware like Marlin since it can't compile on Raspbian and I only want to get at the Stepper Motor Drivers and now in my case the PS_ON pin...

Here's the schematic:


My code for trying to get the motors to turn (and flip the PS_ON switch) is as follows:

int PS_ON = 12;
int X_STEP_PIN = 54;
int X_DIR_PIN = 55;
int X_ENABLE = 38;
int NUM_OF_STEPS = 400;
int WAIT_TIME = 500;
int LED_PIN = 13;

void setup(){

  digitalWrite(LED_PIN, HIGH);


  pinMode(PS_ON, OUTPUT);


  pinMode(X_DIR_PIN, OUTPUT);
  pinMode(X_STEP_PIN, OUTPUT);
  pinMode(LED_PIN, OUTPUT);
  pinMode(X_ENABLE, OUTPUT);

  digitalWrite(PS_ON, LOW);
  digitalWrite(X_ENABLE, LOW);

  digitalWrite(X_DIR_PIN, HIGH);
  for(int n = 0; n < NUM_OF_STEPS; n++){
    digitalWrite(X_STEP_PIN, HIGH);
    digitalWrite(X_STEP_PIN, LOW);


  digitalWrite(X_DIR_PIN, LOW);
  for(int n = 0; n < NUM_OF_STEPS; n++){
    digitalWrite(X_STEP_PIN, HIGH);
    digitalWrite(X_STEP_PIN, LOW);
    digitalWrite(LED_PIN, !digitalRead(LED_PIN));

void loop(){


Any thoughts would be appreciated.

Here's how I got it to work.

Firstly if you're going to use a Xbox 360 PSU to power the RAMPS you need to tie together the red wire and the blue wire to force the box out of standby and make it give out a constant 12V (if you buy a 3rd party psu then the wire colors/layout will be different and you're on your own, but all the ones made by Microsoft for the base xbox 360 are color coded like this, including current Xbox One PSUs as far as I can tell).

There's also the option of connecting the blue to VCC and the red to GND on the RAMPS board (im not sure why that also works, but it's also mentioned in the docstring of the config.h or config_adv file under power supply settings in the Marlin firmware which is where I got the idea)

At that point, if you're reading 12V on a multimeter on the 5A rail of the RAMPS, make sure the RAMPS is able to power itself without the Arduino, if it can you should be good to go. There seems to be no need to get at the PS_ON at this point and you can power the RAMPS without any firmware.


Got it working without using any firmware, going to sleep. Will update post in the morning for how I got it working for anyone else with a similar question in the future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.