I recently bought a single brushed DC motor driver (DRV 8838) in hopes of a small h-bridge for running a dc motor clockwise and counter-clockwise. However, I am still struggling on how to get it all working through arduino code. I understand that ENABLE controls the speed of the motor, and PHASE controls the direction. I am just getting lost in how to put it in code to get the motors running. Do I just use pins from an Arduino Uno to plug into those two, and set them HIGH or LOW depending on direction, and speed?
I cannot seem to find any information on other people using this driver with Arduino? Is it possible, if so, can anyone direct me a link or advice with code to help me get started?
I got code to work with this driver, however it only seems to run off a USB through Arduino Uno. Am I able to get the ATMEGA328 standalone to work with it, and with a 3V or so battery?
Can anyone please help? I currently have it hooked up like the data sheet provided and it works when through a Arduino Uno USB. However, when I try the same connections through ATMEGA328 standalone, I just hear clicking sounds and it does not turn. Why?
Something like:
digitalWrite (ph_pin, direction) ;
analogWrite (en_pin, drive_level) ;
This is what I have written, at the moment it was just setup as a test to see if it would work.. and it does, it goes clockwise for a short time, pauses for a short time, goes counter clockwise for a short time, then pauses for a short time before repeating. This code works when I have everything plugged into the Arduino Uno's USB port and run through the computer.. but when I do the same connections I have for a breadboard with just a standalone ATMEGA328, it does not work. Why is this?
int enablePin = 3
int phasePin = 4
void setup()
{
pinMode(enablePin, INPUT);
pinMode(phasePin, OUTPUT);
}
void loop()
{
digitalWrite(enablePin, HIGH);
digitalWrite(phasePin, HIGH);
delay(100);
digitalWrite(enablePin, LOW);
digitalWrite(phasePin, LOW);
delay(500);
digitalWrite(enablePin, HIGH);
digitalWrite(phasePin, LOW);
delay(100);
digitalWrite(enablePin, LOW);
digitalWrite(phasePin, LOW);
delay(500);
}
Anything I could do to make it run off a standalone ATMEGA328 and around 3V?
Man, I have the same problem?
When i connect Arduino by USB motors work, but without it doesn't.
Tell me please have you resolved it?