Other Arduino Codes and Videos by Robojax

Control XY-1250 10-50A 60A 3000W PWM motor Speed controller using Arduino

Control XY-1250 10-50A 60A 3000W PWM motor Speed controller using Arduino

This video explains how modify the 60A PWM module and control it with Arduino. Either with potentiometer or just Arduino code.
  1. Main Review of 10-50V 60A 3000W PWM (YouTube)
  2. Using Potentiometer with Arduino (Code and video)

 /*
 * Modify XY-1250 12-50V 60A PWM to work with Arduino
 * 
 * Written by Ahmad Shamshiri
 * on Saturday Jun 15, 2019 at 16:14
 * in Ajax, Ontario, Canada
 * www.Robojax.com
 * Watch the video instruction: https://youtu.be/k13iTmvPtUU
 */
#define pwmPin1 5
#define pwmPin2 6
#define controlPin A0

void setup() {
  pinMode(pwmPin1,OUTPUT);
  pinMode(pwmPin2,OUTPUT);
  Serial.begin(9600);

}

void loop() {
  int potValue = analogRead(controlPin);
  Serial.print(potValue);
  int pwm =map(potValue, 0,1023, 0, 255);
  pwm = toPWM(80);
  analogWrite(pwmPin1,pwm);
  analogWrite(pwmPin2,pwm);
  Serial.print(" ");  
  Serial.println(pwm);
  delay(500);
}

/*
 * @brief converts % value from 0 to 100% to 0-255
 * @param v is integer value representing % from 0-100
 * @return will return value from 0 to 255
 */
int toPWM(int v){
  return map(v, 0,100,0,255);
}//



   

If you found this tutorial helpful, please support me so I can continue creating content like this. You can support me on Patreon ( Launched June 14, 2019): http://bit.ly/2ZnITLz

Or support me via PayPal