KS0556 Keyestudio 8833 Motor Driver Expansion Board: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
(Created blank page)
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== Description ==


The 8833 motor driver expansion board uses PH2.0 terminals and an 8833 motor driver chip driven by the two-channel H bridge whose the largest current can be up to be 1.5A. It also integrates an IR receiver, ultrasonic sensor ports, analog ports, line tracking interfaces and pin headers for BT wifi and servo drivers. <br>
== Parameters ==
* Voltage USB 5V,DC 6-9V
* Current Max current is 3A,the real output is around 1A(2A, when the motor is loaded)
* Max Power
* Max power is 27W; in fact, it is 9W
* Working Temperature: -10~50℃
* Size: 69*56*18mm
* Weight: 25.5g
* Environmental attributes: ROHS
<br>[[Image:图片1---0556.png|600px|frameless]]<br>
Schematic Diagram:
<br>[[Image:图片2---0556.png|600px|frameless]]<br>
'''Install jumper caps'''
<br>[[Image:图片3---0556.png|600px|frameless]]<br>
Then connect motors
<br>[[Image:图片4---0556.png|600px|frameless]]<br>
Test Code
<pre>
#define ML_Ctrl 4  //define control pins of the left motor
#define ML_PWM 6  //define PWM control pins of the left motor
#define MR_Ctrl 2  //define control pins of the right motor
#define MR_PWM 5  //define PWM control pins of the right motor
byte speeds_L = 200; //initial speed of the left motor is 200
byte speeds_R = 200; //initial speed of the right motor is 200
String speeds_l, speeds_r; //receive character strings of PWM,used to transfer into the PWM value
void setup() {
 
  pinMode(ML_Ctrl, OUTPUT);
  pinMode(ML_PWM, OUTPUT);
  pinMode(MR_Ctrl, OUTPUT);
  pinMode(MR_PWM, OUTPUT);
 
}
void loop() {
      Car_front();  //go forward
      delay(2000);
      Car_back();  //go back
      delay(2000);
      Car_left();  //turn left
      delay(2000);
      Car_right();  //turn right
      delay(2000);
      Car_Stop();  //stop
      delay(2000);
}
/***************motor running**************/
void Car_back() {
 
  digitalWrite(MR_Ctrl, LOW);
  analogWrite(MR_PWM, speeds_R);
  digitalWrite(ML_Ctrl, LOW);
  analogWrite(ML_PWM, speeds_L);
  delay(10);
}
void Car_front() {
 
  digitalWrite(MR_Ctrl, HIGH);
  analogWrite(MR_PWM, 255 - speeds_R);
  digitalWrite(ML_Ctrl, HIGH);
  analogWrite(ML_PWM, 255 - speeds_L);
  delay(10);
}
void Car_left() {
 
  digitalWrite(MR_Ctrl, HIGH);
  analogWrite(MR_PWM, 255 - speeds_R);
  digitalWrite(ML_Ctrl, LOW);
  analogWrite(ML_PWM, speeds_L);
  delay(10);
}
void Car_right() {
 
  digitalWrite(MR_Ctrl, LOW);
  analogWrite(MR_PWM, speeds_R);
  digitalWrite(ML_Ctrl, HIGH);
  analogWrite(ML_PWM, 255 - speeds_L);
  delay(10);
}
void Car_Stop() {
 
  digitalWrite(MR_Ctrl, LOW);
  analogWrite(MR_PWM, 0);
  digitalWrite(ML_Ctrl, LOW);
  analogWrite(ML_PWM, 0);
  delay(10);
}
</pre>
== Test Result ==
The motor will rotate clockwise for 2s then anticlockwise for 2s, turn left for 2s, turn right for 2s and stop for 2s.

Latest revision as of 16:07, 4 July 2022

Description

The 8833 motor driver expansion board uses PH2.0 terminals and an 8833 motor driver chip driven by the two-channel H bridge whose the largest current can be up to be 1.5A. It also integrates an IR receiver, ultrasonic sensor ports, analog ports, line tracking interfaces and pin headers for BT wifi and servo drivers.


Parameters

  • Voltage USB 5V,DC 6-9V
  • Current Max current is 3A,the real output is around 1A(2A, when the motor is loaded)
  • Max Power
  • Max power is 27W; in fact, it is 9W
  • Working Temperature: -10~50℃
  • Size: 69*56*18mm
  • Weight: 25.5g
  • Environmental attributes: ROHS


图片1---0556.png


Schematic Diagram:


图片2---0556.png


Install jumper caps


图片3---0556.png

Then connect motors


图片4---0556.png

Test Code


#define ML_Ctrl 4  //define control pins of the left motor
#define ML_PWM 6   //define PWM control pins of the left motor
#define MR_Ctrl 2  //define control pins of the right motor
#define MR_PWM 5   //define PWM control pins of the right motor

byte speeds_L = 200; //initial speed of the left motor is 200
byte speeds_R = 200; //initial speed of the right motor is 200
String speeds_l, speeds_r; //receive character strings of PWM,used to transfer into the PWM value

void setup() {
  
  pinMode(ML_Ctrl, OUTPUT);
  pinMode(ML_PWM, OUTPUT);
  pinMode(MR_Ctrl, OUTPUT);
  pinMode(MR_PWM, OUTPUT);
  
}


void loop() {


      Car_front();  //go forward
      delay(2000);
      Car_back();   //go back
      delay(2000);
      Car_left();   //turn left
      delay(2000);
      Car_right();  //turn right
      delay(2000);
      Car_Stop();   //stop
      delay(2000);

}


/***************motor running**************/
void Car_back() {
  
  digitalWrite(MR_Ctrl, LOW);
  analogWrite(MR_PWM, speeds_R);
  digitalWrite(ML_Ctrl, LOW);
  analogWrite(ML_PWM, speeds_L);
  delay(10);
}

void Car_front() {
  
  digitalWrite(MR_Ctrl, HIGH);
  analogWrite(MR_PWM, 255 - speeds_R);
  digitalWrite(ML_Ctrl, HIGH);
  analogWrite(ML_PWM, 255 - speeds_L);
  delay(10);
}

void Car_left() {
  
  digitalWrite(MR_Ctrl, HIGH);
  analogWrite(MR_PWM, 255 - speeds_R);
  digitalWrite(ML_Ctrl, LOW);
  analogWrite(ML_PWM, speeds_L);
  delay(10);
}

void Car_right() {
  
  digitalWrite(MR_Ctrl, LOW);
  analogWrite(MR_PWM, speeds_R);
  digitalWrite(ML_Ctrl, HIGH);
  analogWrite(ML_PWM, 255 - speeds_L);
  delay(10);
}

void Car_Stop() {
  
  digitalWrite(MR_Ctrl, LOW);
  analogWrite(MR_PWM, 0);
  digitalWrite(ML_Ctrl, LOW);
  analogWrite(ML_PWM, 0);
  delay(10);
}


Test Result

The motor will rotate clockwise for 2s then anticlockwise for 2s, turn left for 2s, turn right for 2s and stop for 2s.