In this repository, i used QS-909 JYQD motor driver with motor hall sensor input and arduino uno to control the robot wheel.
Its a motor driver with direction and speed control, used to control brushless motor. It use 12 - 36V, up to 500W (you need heat sink for more than 60W). comes in two variants: 1) with motor hall sensor input and 2) sensorless.
#You can check some videos about it Like this : https://youtu.be/gH4Vb8bXj34
Connect EL (motor enable) to 5v, Z/F to 5v (foward direction) or 0V (Backward direction). you can Connect potentiometer for speed control (pins: 5v, VR, GND)
.
int EL = 2;
int Forw_Back = 4;
void setup() {
pinMode(EL, OUTPUT);
pinMode(Forw_Back,OUTPUT);
Serial.begin(9600);
}
void loop() {
//this arduino will receive serial data from main controller of the robot to determine some variables
while(Serial.available() > 0 )
{
String inSerial = Serial.readString();
if (inSerial.substring(0)== "Forward") // if arduino recieve "Forward" the motor will be enabled and move forward
{
digitalWrite(EL, HIGH);
digitalWrite(Forw_Back, HIGH);
}
else if (inSerial.substring(0) == "Backward") // if arduino recieve "Backward" the motor will be enabled and move Backward
{
digitalWrite(EL, HIGH);
digitalWrite(Forw_Back, LOW);
}
else if (inSerial.substring(0) == "Stop") //if arduino recieve "Stop" the motor will Stop
digitalWrite(EL, LOW);
}
}