DK ELectronics v1.0 Motor shield

I have search the forums + net for a definitive set of info on this shield, without success.
I was given one of these by a friend who never got it working, not unlike many of the threads I found concerning the board.

Two full days work with a meter and software test I have produced a definitive set of info that makes the shield work every time, I have tested on UNO + Mega.

The various diagrams floating arround have one set of definitions, the software library has other and finally the board bears little relationship to either.

If anyone would like details of my results which have enabled me to interface two DC motors the other two would simply be a complementary image in terms of the external pin out. The major errors are in the control of the 74hc295 latch, people don't seem to understand the timing requirement to ensure this latch is loaded correctly, I have produced a timing diagram to assist. I have no as yet written a true library since I have only one need and hence straight coding was a simple answer.

Please indicate how you want the details I will monitor for any responces.

3 Likes

Hi tgsuperspec,

I've also been trying to get the DK Electronics motor control shield working for some time,
using Adafruit's AFMotor/examples/DCMotorTest.ino sketch, without succes however.
Of course I have installed the libraries that came with it.
If I switch on Arduino's Monitor it says "tick, tock, tech" as it should according to the sketch.
The small DC Motor doesn't run at all, not on M1, M2, M3 or M4.

Would you be so kind to share your experiences with me, I would be very grateful.
Please send it via e-mail, my address is: edschijf@upcmail.nl

With kindest regards,

Ed R. Schijf
The Netherlands

http://www.robotshop.us/media/files/PDF/adafruit-motor-shield-arduino-user-guide.pdf

Is this of any relevance, can you post a picture of the shield please?

Tom...... :slight_smile:

Hi for anyones info I think this is the circuit for DK shield

Tom.... :slight_smile:

Hi there,
Together with the help of Tom George I found the solution to the problems with the Motor Shield.
I used the wrong libraries version 2, while this Motor Shield is version 1.
Downloaded "Adafruit-Motor-Shield-4bd21ca.zip", unzipped it and renamed the result "AFMotor".
Then I adapted the textfile "Keywords.txt", which is a one-line sentence so that it read:
AF_DCMotor KEYWORD1, etc.
run KEYWORD2
and so on, and so on.
After this the DK Electronics v1.0 Motor Shield worked alright! How simple it can be?

I also wrote "tgsuperspec" a personal mail for not answering people's messages for help.
Ed

Hi HHarry14
I have the same problem with DK motor shield but I can't find the v 1.0 of the library. Could you post where you found it?
Thank you

I have found that I have the same problem with carriage return character, that HHarry14 comented, in the whole library. After fixing it seem to run properly. I left you the files I used and the code with I tested it.

#include <AFMotor.h>

AF_DCMotor MotorIzq(2);
AF_DCMotor MotorDer(3);



void setup()
{
MotorIzq.setSpeed(255);
MotorDer.setSpeed(255);
}

void loop()
{
    MotorIzq.run(FORWARD); //delante
    MotorDer.run(FORWARD);
    delay(1000);
    MotorIzq.run(RELEASE); //paro
    MotorDer.run(RELEASE);
    delay(100);
    MotorIzq.run(BACKWARD); //atras
    MotorDer.run(BACKWARD);
    delay(1000);
    MotorIzq.run(RELEASE); ///paro
    MotorDer.run(RELEASE);
    delay(100);
    MotorIzq.run(FORWARD); //giro izquierda
    MotorDer.run(BACKWARD);
    delay(1000);
    MotorIzq.run(RELEASE); //paro
    MotorDer.run(RELEASE);
    delay(100);
    MotorIzq.run(BACKWARD); //giro derecha
    MotorDer.run(FORWARD);
    delay(1000);
    MotorIzq.run(RELEASE); //paro
    MotorDer.run(RELEASE);
    delay(100);
}

AFMotor_fixed.rar (7.43 KB)

Hi!
I have a DK Electronics motor shield and i use the V1 AdaFruit library. It seems work but no, it doesn't work
For DC motor in port M4 works in "Forward" mode but not in "Backward" mode. In ports M1,M2 and M3 works fine both modes.
So for stepper motor port X2 doesn't work and works fine in port X1.
I tried to replace the L293 and make the same. doesn't work port M4 in DC motors.

has anyboy an idea? Thanks

I've got the DK electronics shield ans started to program my "smart car" with 4 motors..... but

  1. each motor is working individually
  2. when I wrote a "sketch" to control all 4 motors using the IR remote, M! and M2 doesn't seem to work, but M3 and M4 work fine
  3. initially I thought the L293D chip corresponding to M1 and M2 might have burnt, but it is also not the case because of 1)

The only thing in between me and a working "smart car" is this issue....

Highly appreciate any suggestions...................

here's my code with the IR remote functions (IR part is working because of 2) )

#include <IRremote.h>


#include <AFMotor.h>


IRrecv irrecv(A5);
decode_results results;

AF_DCMotor motor1(1);
AF_DCMotor motor2(2);
AF_DCMotor motor3(3);
AF_DCMotor motor4(4);




int status=0; //0-off 1-forward 2-back

void setup()
{
   Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver

  motor1.setSpeed(150);
    motor2.setSpeed(150);
      motor3.setSpeed(150);
        motor4.setSpeed(150);
}

void loop()
{
  
  if (irrecv.decode(&results)) {
        translateIR(); 
    irrecv.resume(); // Receive the next value
  }

/*
if(status==0)
{
     motor2.run(FORWARD);
     status=1;
}
*/

}





void translateIR() // takes action based on IR code received
{

  switch(results.value)
  {

  case 3810010651:  //CH-   0xFFA25D    test
   motor1.run(FORWARD);
    Serial.println(" CH-            "); 
    break;

  case 1033561079:                              //forward   0xFF18E7
  GO_FORWARD();
    break;

  case 2351064443:                                  //left   0xFF10EF
  TURN_LEFT();
    break;

  case 1217346747:                                  // stop 0xFF38C7
  RELEASE_ALL();
    Serial.println(" 5              "); 
    break;

  case 71952287:                                   //right  0xFF5AA5
  TURN_RIGHT();
    break;

  case 465573243:                                  //back  0xFF4AB5
   GO_BACK();
    break;
  }

  delay(500);


} //END translateIR

 void GO_FORWARD()
 {
     motor1.run(FORWARD);
     motor2.run(FORWARD);
     motor3.run(FORWARD);
     motor4.run(FORWARD);
   
 }
 
 void TURN_LEFT()
 {
     motor1.run(BACKWARD);
     motor2.run(FORWARD);
     motor3.run(FORWARD);
     motor4.run(BACKWARD);
 }
 
   void TURN_RIGHT()
   {
    motor1.run(FORWARD); 
    motor2.run(BACKWARD); 
    motor3.run(BACKWARD); 
    motor4.run(FORWARD);  
     
   }
   
  void GO_BACK()
  {
    motor1.run(BACKWARD); 
    motor2.run(BACKWARD); 
    motor3.run(BACKWARD); 
    motor4.run(BACKWARD); 
    
  }
  
  void RELEASE_ALL()
  {
      motor1.run(RELEASE);
      motor2.run(RELEASE);
      motor3.run(RELEASE);
      motor4.run(RELEASE); 
  }

I have the same problem with carriage return character, that HHarry14 comented,

This is the classic character return problem: difference between windoze and Unix / Mac systems.

The dos2unix utility allows simple conversion in either direction.

The file referred to above can be found here:
http://www.bitsandparts.eu/documentation/113/Motor-Shield-library-4bd21ca.zip

I just bought the shield but when I attach it to the Arduino, the power LED won't light and the power light on the Arduino board doesn't light up either.

When I remove the boar the Arduino is responsive.
How do I fix it?

I have all the libraries installed. How can I fix this?

If I remove the 5V pin both LED's on the Arduino and shield light up.
Is this an indication of the problem with the shield?

How can I fix this?

C2 was shorted, this fixed the problem

Hi,
was the capacitor, if it is polarised, in the correct way?

Tom.... :slight_smile:

Does anyone know which pin is the transmitter pin on the DK electronics motor shield?

Hi,
What do you mean by the transmitter pin?

Tom..... :slight_smile:

Hello all,

I just bought the same shield and had the same problems you guys discussed here. With the help of the previous post I was able to make it work some what but seems like it has other problems. For example if I run a code for the first time it works but then if i change any thing in the code it does not execute it. It keep running the previous code. Even if i change the motor port in the code ( lets say it is connected to M1, but I change it to M2 in the code) the motor still runs and it executes what ever the code was before changing. Does any one have any idea how to fix it ?

Thanks

Hi guys!

Can someone please be kind to read my question on the DK Electronics motor shield on the forum?

Thanks!

I'm new to this, but I haven't seen that issue. I'm still trying to get my motors turning as well.

Now I'm thinking I should reset the arduino every time I load a new sketch.

So far all the code is being seen, but no motor movement.

4 AA batteries to the +M and GND.
The boards are hooked up to USB.
I've integrated the Blink program into it and it does blink once at the end of the loop as programmed.

This robot motor set is the on eBay.

I'm wondering if I don't have enough power.

I did put in a carriage return in the keywords.txt file above the motor lines and I believe I'm using that library.