Control XY-1250 10–50A/60A 3000W PWM Motor Speed Controller Using Arduino
This video explains how to modify the 60A PWM module and control it with Arduino. Either with a potentiometer or just Arduino code.If you don't want to control this module using an external signal, and see this module fully tested under different loads, you may have to see XY-1250 60A Module is tested and explained page. See how to control this module without a potentiometer Chapters of this video
196-Resources for this sketch
Language: C++
/*
* Modify XY-1250 12-50V 60A PWM to work with Arduino.
If you want to control it without a potentiometer, see http://robojax.com/L/?id=308
*
* Written by Ahmad Shamshiri
* on Saturday, June 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);
analogWrite(pwmPin1,pwm);
analogWrite(pwmPin2,pwm);
Serial.print(" ");
Serial.println(pwm);
delay(500);
}
/*
* @brief Converts a percentage value from 0 to 100% to 0-255.
* @param v An integer value representing a percentage from 0-100.
* @return A value from 0 to 255.
*/
int toPWM(int v){
return map(v, 0,100,0,255);
}
Resources & references
Files📁
No files available.