How to use TB6612FNG with an Arduino.

δγτυημ,

Datasheet

VCC –> 5v on the arduino
STBY–> 5v on the arduino
PWMA-B –> PWM pin on the arduino or 5v
BIN-AIN –> to a ditigital pin on the arduino.
VM –> to an external supply max 15 volt.

With the pwm we control the speed od the motor and by making HIGH or LOW the B-A inputs we control the direction of rotation. For example if we make AIN1 HIGH (by applying 5v from a digital pin) and AIN2 LOW , PWMA is connected to 5v and VM is 12 volt then the A01 will  be  12v and A02 will be connected to ground.

Arduino code.

int AIN1 = 9;
int AIN2 = 8;
 
void setup() {
  pinMode(AIN1,OUTPUT);
  pinMode(AIN2,OUTPUT);
 
}
 
void loop() {
 
    digitalWrite(AIN1,LOW);
    digitalWrite(AIN2,HIGH);
    delay(1000);
 
    digitalWrite(AIN1,HIGH);
    digitalWrite(AIN2,LOW);
    delay(1000);
 
}

Leave a Reply

Your email address will not be published. Required fields are marked *