Other Arduino Codes and Videos by Robojax
This video explains how modify the 60A PWM module and control it with Arduino. Either with potentiometer or just Arduino code.
If you don't want to control this module using external signal, and see this module fully tested under different loads, you may
have to see XY-1250 60A Module is tested and expaliend page. See how to control this module without potentiomerer
/*
* Modify XY-1250 12-50V 60A PWM to work with Arduino
if you wan to control is without potentiometer, see http://robojax.com/L/?id=308
*
* 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);
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. support me via PayPal