Arduino Motor Shield VNH2SP30 điều khiển 2 động cơ 30A

Arduino Motor Shield VNH2SP30 điều khiển 2 động cơ 30A

Arduino Motor shield VNH2SP30 30A

Ngừng kinh doanh

Mã sản phẩm: BNAO

Arduino Motor Shield VNH2SP30 Dải điện áp: 5.5v-16v, Dòng tối đa: 30A, Dòng liên tục: 14A

DỊCH VỤ & KHUYẾN MÃI LIÊN QUAN
  • Cộng thêm 18 điểm tích lũy
  • TP.HCM: Miễn phí vận chuyển đơn hàng từ 300k
    Tỉnh thành khác: Miễn phí vận chuyển đơn hàng từ 500k

    Xem thêm các khuyến mãi vận chuyển khác.

Sản phẩm liên quan

Chi tiết sản phẩm

Arduino Motor Shield VNH2SP30 là một lựa chọn tối ưu mạnh mẽ thay thế cho module thông dụng L298 với 2 cầu H, module sử dụng 1 cặp IC VNH2SP30 full-bridge với khả năng tải dòng cao cho 2 motor lên đến 30A.

THÔNG SỐ KỸ THUẬT

  • Dải điện áp: 5.5v-16v
  • Dòng tối đa: 30A
  • Dòng liên tục: 14A
  • Trở kháng nội MOSFET: 19mΩ (mỗi chân)
  • Tần số PWM tối đa: 20khz
  • Có chân current sensor (có thể kết nối với chân analog để đo dòng)
  • Bảo vệ quá dòng và quá áp

SƠ ĐỒ KẾT NỐI ARDUINO MOTOR SHIELD VNH2SP30

Arduino Motor Shield VNH2SP30 điều khiển 2 động cơ 30A

Skematic

Hướng dẫn sử dụng

———————CODE THAM KHẢO———————-

/*
 * Cắm trực tiếp Shield lên Arduino Mega/Uno.
 * A1 B1 kết nối với động cơ 1.
 * A2 B2 kết nối với động cơ 2.
 * Cấp nguồn 5.5 - 16V cho Shield.
 * Mở Serial Monitor:
 *  Gửi '1' dừng động cơ.
 *  Gửi '2' quay 2 động cơ.
 *  Gửi '3' đảo chiều động cơ.
 *  Gửi '+' tăng tốc độ động cơ.
 *  Gửi '-' giảm tốc độ động cơ.
 */


#define BRAKE 0
#define CW    1
#define CCW   2
#define CS_THRESHOLD 15   // Definition of safety current (Check: "1.3 Monster Shield Example").

//MOTOR 1
#define MOTOR_A1_PIN 7
#define MOTOR_B1_PIN 8

//MOTOR 2
#define MOTOR_A2_PIN 4
#define MOTOR_B2_PIN 9

#define PWM_MOTOR_1 5
#define PWM_MOTOR_2 6

#define CURRENT_SEN_1 A2
#define CURRENT_SEN_2 A3

#define EN_PIN_1 A0
#define EN_PIN_2 A1

#define MOTOR_1 0
#define MOTOR_2 1

short usSpeed = 150;  //default motor speed
unsigned short usMotor_Status = BRAKE;
 
void setup()                         
{
  pinMode(MOTOR_A1_PIN, OUTPUT);
  pinMode(MOTOR_B1_PIN, OUTPUT);

  pinMode(MOTOR_A2_PIN, OUTPUT);
  pinMode(MOTOR_B2_PIN, OUTPUT);

  pinMode(PWM_MOTOR_1, OUTPUT);
  pinMode(PWM_MOTOR_2, OUTPUT);

  pinMode(CURRENT_SEN_1, OUTPUT);
  pinMode(CURRENT_SEN_2, OUTPUT);  

  pinMode(EN_PIN_1, OUTPUT);
  pinMode(EN_PIN_2, OUTPUT);

  Serial.begin(9600);              // Initiates the serial to do the monitoring 
  Serial.println(); //Print function list for user selection
  Serial.println("Enter number for control option:");
  Serial.println("1. STOP");
  Serial.println("2. FORWARD");
  Serial.println("3. REVERSE");
  Serial.println("4. READ CURRENT");
  Serial.println("+. INCREASE SPEED");
  Serial.println("-. DECREASE SPEED");
  Serial.println();

}

void loop() 
{
  char user_input;   
  while(Serial.available())
  {
    user_input = Serial.read(); //Read user input and trigger appropriate function
    digitalWrite(EN_PIN_1, HIGH);
    digitalWrite(EN_PIN_2, HIGH); 
     
    if (user_input =='1')
    {
       Stop();
    }
    else if(user_input =='2')
    {
      Forward();
    }
    else if(user_input =='3')
    {
      Reverse();
    }
    else if(user_input =='+')
    {
      IncreaseSpeed();
    }
    else if(user_input =='-')
    {
      DecreaseSpeed();
    }
    else
    {
      Serial.println("Invalid option entered.");
    }
      
  }
}

void Stop()
{
  Serial.println("Stop");
  usMotor_Status = BRAKE;
  motorGo(MOTOR_1, usMotor_Status, 0);
  motorGo(MOTOR_2, usMotor_Status, 0);
}

void Forward()
{
  Serial.println("Forward");
  usMotor_Status = CW;
  motorGo(MOTOR_1, usMotor_Status, usSpeed);
  motorGo(MOTOR_2, usMotor_Status, usSpeed);
}

void Reverse()
{
  Serial.println("Reverse");
  usMotor_Status = CCW;
  motorGo(MOTOR_1, usMotor_Status, usSpeed);
  motorGo(MOTOR_2, usMotor_Status, usSpeed);
}

void IncreaseSpeed()
{
  usSpeed = usSpeed + 10;
  if(usSpeed > 255)
  {
    usSpeed = 255;  
  }
  
  Serial.print("Speed +: ");
  Serial.println(usSpeed);

  motorGo(MOTOR_1, usMotor_Status, usSpeed);
  motorGo(MOTOR_2, usMotor_Status, usSpeed);  
}

void DecreaseSpeed()
{
  usSpeed = usSpeed - 10;
  if(usSpeed < 0)
  {
    usSpeed = 0;  
  }
  
  Serial.print("Speed -: ");
  Serial.println(usSpeed);

  motorGo(MOTOR_1, usMotor_Status, usSpeed);
  motorGo(MOTOR_2, usMotor_Status, usSpeed);  
}

void motorGo(uint8_t motor, uint8_t direct, uint8_t pwm)         //Function that controls the variables: motor(0 ou 1), direction (cw ou ccw) e pwm (entra 0 e 255);
{
  if(motor == MOTOR_1)
  {
    if(direct == CW)
    {
      digitalWrite(MOTOR_A1_PIN, LOW); 
      digitalWrite(MOTOR_B1_PIN, HIGH);
    }
    else if(direct == CCW)
    {
      digitalWrite(MOTOR_A1_PIN, HIGH);
      digitalWrite(MOTOR_B1_PIN, LOW);      
    }
    else
    {
      digitalWrite(MOTOR_A1_PIN, LOW);
      digitalWrite(MOTOR_B1_PIN, LOW);            
    }
    
    analogWrite(PWM_MOTOR_1, pwm); 
    
  }
  else if(motor == MOTOR_2)
  {
    if(direct == CW)
    {
      digitalWrite(MOTOR_A2_PIN, LOW);
      digitalWrite(MOTOR_B2_PIN, HIGH);
    }
    else if(direct == CCW)
    {
      digitalWrite(MOTOR_A2_PIN, HIGH);
      digitalWrite(MOTOR_B2_PIN, LOW);      
    }
    else
    {
      digitalWrite(MOTOR_A2_PIN, LOW);
      digitalWrite(MOTOR_B2_PIN, LOW);            
    }
    
    analogWrite(PWM_MOTOR_2, pwm);
  }
}

HÌNH ẢNH SẢN PHẨM

Arduino Motor Shield VNH2SP30 điều khiển 2 động cơ 30A

Arduino Motor Shield VNH2SP30 điều khiển 2 động cơ 30A

Phản hồi khách hàng
Nshop reviewer

Nshopvn.com · 07/03/2019 10:51 AM

uniE735uniE735uniE735uniE735uniE735

Arduino Motor Shield VNH2SP30 điều khiển 2 động cơ 30A giá chỉ 180.000₫

Hộ kinh doanh Linh kiện điện tử Nshop / GPĐKKD số: 41X8035261 do UBND Quận Tân Phú cấp ngày 08/05/2019

Điện tử NShop Tân Phú: 1 Bùi Xuân Phái, Tây Thạnh, Tân Phú, TP. HCM – 📞 0902 64 39 78

Điện tử NShop Quận 9: 7 Trần Hưng Đạo, Hiệp Phú, Quận 9, TP. HCM – 📞 093 27 23 186

NSHOPVN.COM © 2019 - 2021

DMCA.com Protection Status Đã thông báo bộ công thương