1

I try to connect arduino with motor using DRV-8835. The problem I have - simply nothing happens. I used tutorial from http://www.instructables.com/id/The-SnapMobile-Start-Your-Physical-Computing-Engin/step6/Building-the-Prototype-Wiring-Up-the-Arduino-the-D/

Code for arduino:

void setup() {
    pinMode(7, OUTPUT);
    pinMode(5, OUTPUT);
    pinMode(8, OUTPUT);
}

void loop() {
  digitalWrite(8, HIGH);
  digitalWrite(7, HIGH);
  analogWrite(5, 255);
}

Maybe someone has scheme how to connect wires to motor. Now I'm not sure if I made a mistake or motor driver is broken.

enter image description here

  • You might try wiring the enable and direction pins active (high?) to skip the arduino. But check the motor wiring, too. Do the motors spin when directly connected to your motor power supply without the PCB? (The motor supply voltage is appropriate for the motors, right? And you aren't running them off the Arduino or USB power? And these are DC motors, not steppers or something more exotic?) – Chris Stratton Aug 13 '14 at 21:39
  • I use dagurobot.com/goods.php?id=86 . In fact I didn't try to connect battery(4x 1.5V) to motor. I'm newbie and little afraid of destroy motor – Michael Aug 13 '14 at 21:51
  • Ok. I tried without arduino and motor driver and motor works so it's not motor fault – Michael Aug 13 '14 at 22:11
  • Do you have any LEDs and resistors you could use to check the Arduino outputs in place of the motor driver? Or you could use a voltmeter to measure them. – Chris Stratton Aug 13 '14 at 22:15
  • Yes. I checked it and there is no output - at least using LED and resistor – Michael Aug 13 '14 at 22:27
1

Try this code:

void setup() {
    pinMode(8, OUTPUT);//MODE
    pinMode(5, OUTPUT);//AENBL
    pinMode(7, OUTPUT);//APHASE
}

void loop() {
  pinMode(7, HIGH);//APHASE
  pinMode(8, HIGH);//MODE
  pinMode(5, HIGH);//AENBL
  delay(200);
  pinMode(5, LOW);//AENBL
}

Here is a description of the breakout board, this shows a requirement of PWM on AENBL for speed control. Try different delays.

0

Setting AENBL HIGH should drive the motor at full speed - it has the same effect as analogWrite(5, 255). Dropping it from high to low should stop the motor.

Are you sure the DRV8835 is working properly? You can in theory diagnose it with a logic analyzer, but a scope will work better as the motor outputs aren't really logic. My test setup (yeah, I had one die on me) watched PHASE (just make sure it would toggle), MODE (should be HIGH), and AENBL (should show a square wave for the PWM duty cycle) as logic inputs, then watched the motor outputs on the scope to verify that one of them is the inverse of AENBL and the other is HIGH. Which follows AENBL and which is HIGH depends on PHASE, so you can toggle it if you can only check one output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.