arduino controlling hobbywing car esc power

So I have a Hobbywing xerun 150A ESC controlling a sensorless brushless motor. I can control the motor just fine using the servo library, but I wanted to turn the ESC on and off using the arduino. The esc has a second cable going to a little box with a pushbutton, which causes it to enter program mode, and a switch, which turns it on and off. I was thinking that I could take it apart, and replace the pushbutton and switch with relays or mosfets and control the esc power with the arduino. There are three wires (red, black, white). When the pushbutton is pressed, red is shorted to white. When the switch is flipped, red is shorted to black. If the switch is on and the pushbutton is pressed, all are shorted together. Can anyone suggest a schematic using relays/mosfets to control this?\

Thanks

Does the ESC come with it's own BEC?

Please link to the datasheet of the ESC. There are probably easier ways to achieve your goal.

The esc does have a bec but I am not using it.
Datasheet:
http://www.hobbywing.com/uploadfiles/sx/file/Manual/HW-09-80.pdf
thanks

If what you want is an additional mechanism to ensure that the motor remains off until the Arduino commands it on, then I suggest you connect the contacts of a reed relay in series with the black wire. That way, the switch will have be on and the Arduino will have to energise the reed relay in order for the ESC to be on. I don't advise bypassing the switch or replacing it completely, because you need to have some means of making sure the ESC stays off while you are working on the system.

You can get 5V reed relays that can be driven direct from an Arduino pin - some even have the flyback diode built-in. Preferably, after breaking the black wire, put a multimeter in series with and measure the current when you turn the switch on, to ensure that the current is within the rating of the reed relay contacts. I think it's unlikely to be more than a few milliamps or tens of milliamps, but it's best to make sure.

I have a bunch of old relays, so i'll try that. Thanks!

This has been the most helpful post for me thus far so thank you, but I still can't seem to get my motor to run and I can't figure out why.

My project is a little different as I am going to use it to drive a brushless inverter motor from a Samsung washing machine to drive a popcorn coating mixer. I can't find any information about the motor other than it is brushless with three terminals. I can get the motor to jolt by connecting two of the wires to a 12V car battery which gave me the idea of using Arduino and a ESC to be able to run programmable spin cycles (like a washing machine).

I bought a Hobbywing Ezrun 150A Pro ESC which the guy at the RC store should be able to do it. I have gone through countless searches and manuals to make it happen but to no avail. My connection is as above, although I am connecting it to 12V lead acid battery (just to test).

In my code below you can see I have put in the calibration setup to calibrate the ESC according to the manual. This step seems to work in that the lights flash accordingly.

However, when I connect the motor it doesn't even budge. I tried reading the voltage values from the output terminals using a multimeter and nothing really happens. The red light blinks after a while which I think means the signal is screwed up (manual not that clear as it talks about audible sounds)(manual link: EUROBUSINESS). I noticed some of you have been able to make it work so I am hoping anyone could see where I went wrong. Big thank you in advance.

#include <Servo.h>

#define MAX_SIGNAL 2000
#define MIN_SIGNAL 700
#define MOTOR_PIN 9

int idle = (MAX_SIGNAL + MIN_SIGNAL) / 2;                     
int slow = (MAX_SIGNAL - idle) / 3;
int med = slow * 2;
int fast = MAX_SIGNAL;
int callibrate = 2;

Servo motor;

void setup() {

  motor.attach(MOTOR_PIN);

  /*
   * First time callibration (todo if button is pressed do callibration setup)
   */
  if(callibrate == 1) {
    Serial.begin(9600);
    Serial.println("First time callibration.  Turn off ESC.  Hit enter when done.");
    motor.writeMicroseconds(idle);                              // Channel should be in REV (nope)
    delay(2000); // delay makes the program feel like it is thinking at least :-)
    while(!Serial.available());
    Serial.read();
  
    Serial.println("On the ESC, hold the set key and let go as soon as you see the red LED flash.  Hit enter for next step.");
    while(!Serial.available());
    Serial.read();
  
    motor.writeMicroseconds(idle);                              // neutral point
    delay(2000);
    Serial.println("Callibrating Neutral Point: Press the set key once, then hit enter to continue.");
    while(!Serial.available());
    Serial.read();
  
    motor.writeMicroseconds(fast);
    delay(2000);
    Serial.println("Callibrating  Forward Point: Press the set key once, then hit enter to continue.");
    while(!Serial.available());
    Serial.read();
  
    motor.writeMicroseconds(MIN_SIGNAL);
    delay(2000);
    Serial.println("Callibrating Reverse Point: Press the set key and hit enter to continue.");
    while(!Serial.available());
    Serial.read();
  
    Serial.println("ESC Should now be callibrated.  Setting to Neutral and ready to go in");
    motor.writeMicroseconds(idle);
    Serial.println("Three.");
    delay(1000);
    Serial.println("Two.");
    delay(1000);
    Serial.println("One.");
    delay(1000);
    Serial.println("READY!");
    delay(3000);
  }
  /*
   * Start up initialisation
   */
  if(callibrate != 1) {
    motor.writeMicroseconds(idle);                            
  }
}

void loop() {
  /*
   * Testing phase
   */
  if(callibrate == 1 || callibrate == 2) {
    // loop values to test
    int i;
    if(callibrate == 1) {
      Serial.println("Speeding up..");
    }
    for(i = idle; i <= fast; i++) {
      motor.writeMicroseconds(i);
      delay(100); // slow down the exceleration
    }
    if(callibrate == 1) {
      Serial.println("Max speed reached..");
    }
    delay(5000);  // five seconds of max speed
    if(callibrate == 1) {
      Serial.println("Slowing down..");
    }
    for(i = fast; i >= idle; i--) {
      motor.writeMicroseconds(i);
      delay(100);
    }
    if(callibrate == 1) {
      Serial.println("Idle..");
    }
    delay(5000);
  }

  /*
   * todo Run phase
   */
}