I have just bought a DRV8833 driver (product 2130). Whenever I try to use it, it goes into fault mode. This is strange because:
- It is cool to the touch.
- I am using a 9 volt battery for the Vin pin.
- It happens with ANY motor (even just one).
This is my Arduino code:
[code]// This is not relevant
#include <IRremote.h>
// This is my home-made DRV8833 library
#include <DRV8833.h>
// This is not relevant
#include “remoteDetector.h”
const int right1 = 5, right2 = 6, left1 = 9, left2 = 10, blinkerPin = 13, faultPin = 12;
unsigned long lastMillis = 0;
int interval = 1000;
int blink = LOW;
DRV8833 driver = DRV8833();
const int speed = 150;
void setup() {
// put your setup code here, to run once:
driver.attachMotorA(right1, right2);
driver.attachMotorB(left1, left2);
pinMode(blinkerPin, OUTPUT);
digitalWrite(blinkerPin, LOW);
pinMode(faultPin, INPUT_PULLUP);
Serial.begin(9600);
irrecv.enableIRIn();
lastMillis = millis();
}
void loop() {
// put your main code here, to run repeatedly:
if (millis() - lastMillis > interval)
{
blink = !blink;
digitalWrite(blinkerPin, blink);
lastMillis = millis();
}
if (digitalRead(faultPin) == LOW)
{
interval = 100;
}
else
{
interval = 1000;
}
switch(getSignal())
{
case None:
break;
case Stop:
Serial.println(“Stop”);
stop();
break;
case Left:
Serial.println(“Left”);
left();
break;
case Right:
Serial.println("Right");
right();
break;
case Forward:
Serial.println("Forward");
forward();
break;
case Backward:
Serial.println("Backward");
backward();
break;
case Rotate:
Serial.println("Rotate");
rotate();
break;
};
}
void stop()
{
driver.motorAStop();
driver.motorBStop();
}
void left()
{
stop();
driver.motorBForward(speed);
driver.motorAStop();
}
void right()
{
stop();
driver.motorBStop();
driver.motorAForward(speed);
}
void forward()
{
stop();
driver.motorAForward(speed);
driver.motorBForward(speed);
}
void backward()
{
stop();
driver.motorAReverse(speed);
driver.motorBReverse(speed);
}
void rotate()
{
stop();
driver.motorBForward(speed);
driver.motorAReverse();
}
[/code]
I am worried that my DRV8833 may be dysfunctional.
This is my circuit: