I'm trying to reverse a sensored brushless motor which uses a sine wave controller. the reverse connector has two wires connected by a molex and it moves the motor in the reverse direction when those connectors are bridged and in the forward direction when disconnected.
But I couldn't get to switch the direction of the motor without touching the reverse connector. I've tried using a relay module to switch between forward and reverse direction but it doesn't work as intended; if one of the reverse pins is connected to NC and the other to COM it reverses when it receives HIGH signal but doesn't move at all when it receives LOW signal rather than move forward. But it it's switched to NO then it moves forward when the input signal is high but doesn't move if the input is LOW signal rather than move in the reverse direction.
I've not sure what I'm doing wrong and any help/suggestion is really appreciated. Code snippet to move the motor is below:
int reverse_pin1 = 5;
int throttle_pin = 6;
int hall1 = 2;
int hall2 = 18;
int hall3 = 19;
void setup() {
pinMode(throttle_pin,OUTPUT);
pinMode(reverse_pin1,OUTPUT);
Serial.begin(9600);
pinMode(hall1, INPUT);
pinMode(hall2, INPUT);
pinMode(hall3, INPUT);
}
void loop() {
digitalWrite(reverse_pin1, LOW);
//digitalWrite(reverse_pin1, HIGH);
analogWrite(throttle_pin, 100);
}

