Cannot connect Xenon to DRV8833 Motor Module

I am trying to run a DC Motor from DRV8833 module.

9V+          >  VM   of DRV8833
9V-          >  GND  of DRV8833
XENON PIN 6  >  SLP  of DRV8833
XENON PIN 2  >  AIN1 of DRV8833
XENON PIN 3  >  AIN2 of DRV8833

and have the following code on Xenon

void setup() {
    pinMode (D3, OUTPUT);
    pinMode (D2, OUTPUT);
    pinMode (D6, OUTPUT); //slp
}

void loop() {
    digitalWrite(D6, HIGH);
    
    digitalWrite(D2, HIGH);
    digitalWrite(D3, LOW);
}

I don’t understand why it was not working. Can you please advice?. I am novice 6th grader, tinkering to build a small car.

Where is your logic/common ground? (GND on Xenon also needs to connect to GND on the driver board).
Don’t mix anonymous pin numbers (e.g. XENON PIN 6) and pin labels (e.g. pinMode (D6, OUTPUT)) - while both might be the same, without explicitly saying so it’s mere conjecture that they actually are.
Are you using the DRV8833 chip or a breakout board - if the latter which?
How have you connected your motor?
Which motor are you using?

An error description should be more than just that. Try do discribe what you see (indicator LEDs, movement, magic smoke :wink: , …), hear (silence, humming, whining, …), feel (chip or motor gets hot, motor vibrates, …)

Hello @ScruffR,

I am sorry, I am totally new to this forum. Please excuse my tardiness.

The GND from 9V, XENON GND and DRV8833 GND are connected on the same line on breadboard.

I am using the DRV8833 breakout board. https://www.adafruit.com/product/3297. I am using the motor
https://www.adafruit.com/product/3777.

I connect the AOUT1 > Motor +ve
AOUT2 > Motor -ve

The motor does not make any kind of sounds. But if I connect 3.3V and GND from Xenon directly to the above motor it works fine. Once again I am sorry for not putting in more details.

Thank you very much for your help.

One thing with that motor is that it is only rated for 3.0 to 6.0V so your 9V supply may not be the safest to use.

How are you powering the Xenon?
What gateway are you using for your Xenon? (they normally don’t run without one)

You didn’t address this point

Is you Xenon breathing cyan?
I think your code isn’t really running.
To test that theory alter your code like this and see whether the D7 LED comes on or not.

void setup() {
  pinMode(D7, OUTPUT);
  digitalWrite(D7, HIGH); // indicate whether application runs at all
 
  pinMode (D3, OUTPUT);
  pinMode (D2, OUTPUT);
  pinMode (D6, OUTPUT); //slp
}

If the blue LED doesn’t light up you need to finish your device setup first and make sure the Xenon starts breathing cyan.

Hi @ScruffR,

Xenon is powered from my laptop USB. I set up Argon WIFI to do the mesh and the Xenon is connected to the Argon Mesh network.

Xenon is breathing cyan.

D7 LED is on, after I ran the code you sent.

Can you post a photo of your setup?
What happens when you connect AIN1 to GND and AIN2 to 3v3? (disconnect D2/D3 when trying)
How are you now powering the motor (since 9V is no option)?

BTW, you don’t need to permanently set the pin states in loop() this should do

const int pinFWD  = D2;
const int pinBACK = D3;
const int pinSLP  = D7;

void setup() {
    Particle.function("drive", setDrive);
    pinMode(FWD , OUTPUT);
    pinMode(BACK, OUTPUT);
    pinMode(SLP , OUTPUT);    // SLP/ (active LOW) 
}

int setDrive(String arg) {
  int dir = 0;

  digitalWrite(SLP , LOW);    // disengage driver
  digitalWrite(FWD , LOW);
  digitalWrite(BACK, LOW);

  if (arg.toUpperCase() == "FORWARD") {
    dir = +1;
    digitalWrite(FWD, HIGH);  // prepare for forward drive    
  }
  else if (arg.toUpperCase() == "BACK") {
    dir = -1;
    digitalWrite(BACK, HIGH); // prepare for reverse drive    
  }
  else
    return 0;                 // no valid direction, motor stopped

  digitalWrite(SLP, HIGH);    // wake the driver and apply preselected direction
  return dir;  
}

I took the liberty to move the SLP/ pin to D7 to have a visual feedback whether the driver is supposed to be active or not and add a function you could call remotely to select forward/backward drive.

1 Like

Hello @ScruffR,

Even after connecting AIN1 to GND and AIN2 to 3v3, the motor did not start. After your suggestion, I moved the power source for the motor driver from 9V to 4 1.5 V AAA batteries. I moved the SLP to D7 and I can see it turn ON after I flash the code to Xenon.

I am attaching pictures for your review. Thanks again for all your help.

The pins of your driver board don’t look soldered.
Just sticking them into the pin holes does not do the job.

The Adafruit page even stresses the need to solder


Hi @ScruffR,

I just finished soldering. I checked the voltages and I got AIN1 - GND (3.3V) , SLP - GND (3.3V), AIN2 - GND ( 0V) , VM - GND (6.3 V). My motor is still not running.

Sorry to say, but these solder joints don’t really look right.
You also soldered the board upside down. While this wouldn’t matter too much for testing it will give you headache when you want to run the motor for some longer time as the actual driver chip will probably overheat as it can’t dissipate enough heat that way.

Have you got anybody who can help you with unsolering these pins and resolder them the correct way and in a fashion that will give you reliable contacts.

You should read and watch that Guide to Excellent Soldering featured in the linked Adafruit page I referred you to above.

This is how your soldered board should look like
image
A nice solid coat - no blobs - of solder connecting both the pin and the soldering pad (all around).

3 Likes