Arduino Due + Motor Shield Adafruit v2

Hello,
I’m a new user of Arduino and for my project I have to build a robot car, and control the motors with an arduino (Due) with a motor shield (Adafruit v2).

Right now, the arduino is powered by USB, and the motor shield is powered by 5 AA battery. I have changed the logic jumper from 5V to 3.3V as they said on the motor shield pdf.

I have made a really simple code which change the speed of the wheels.

The motors turn at the right speed, but after a random times, the motors turn at a constant speed and they don’t follow the program anymore.

Does anyone have a suggestion of what is the problem?

Thanks !

MotorTest.ino (1.89 KB)

Hi Red, Don't really like motor shields or any others that use their own library, it never seems that you have full control of everything... That does look like a nice job though! The TB6612 MOSFET driver is much better then the older L293/298, much less power loss, etc.

I'll take a look at the code later and get back to you..

Regards

Mel.

Here is a link to a thread in the Due section about this. http://forum.arduino.cc/index.php?topic=338008.0

I have followed your link, SurferTim, and I have read all the discussion, but unfortunately it didn’t help me. I have tried your I2C Scanner program, and it found the address 0x60 and 0x70. When I’m testing my program, the DC motors turn correctly during a random time. So the I2C communication seems to work, at least at the beginning.

I think it may be the output voltage of the motor shield IC. If the digital pins on the motor shield output 3.3 volts instead of 5 volts, it may cause the motors to malfunction. That appears to be the only difference between my Mega 2560 and the Due.

I have not received my I2C level shifter yet, so I can't test yet.

I have tried with 5 volts instead of 3.3 volts, but it still doesn't work correctly. So the problem doesn't seems to be that.

I saw that a lot of people said that the Wire Library doesn't work very well with the Due. It is still topical, or the problem is resolved?

I use 4 I2C devices on two separate boards with my Due. I have a 16 channel servo board and a 10DOF board. Both work great. I'm still waiting for my Adafruit I2C level shifter so i can safely use the servo board at 5 volts. It should be here tomorrow.

Hi, When the drive starts to give you random response, what is the voltage of the 5 AA cell pack?

Tom.... :)

When the drive starts to give me a random response, nothing change for the voltage.

I will do more test today, so I will keep you informed =)

SCL and SDA observation :

*Test with 4 motors
I have send only one speed ( setSpeed(55) ) in the loop, with a delay of 10ms: when I powered the arduino, during few seconds, there is a signal on the I2C bus. But after, SCL = 3.3V and SDA = 0V.

When I sent the speed 0 in the loop, with a delay of 10ms: there is a clock on SCL and data on SDA (picture1)

*Test with 1 motor ( setSpeed(55) )
When the motor is plugged in → SCL = 3.3V and SDA = 0V
When the motor isn’t plugged in → there is a signal on SCL and SDA, but the clock is less good (picture2)

There is another user who is having problems with the same shield and is planning on using a I2C level shifter to see if that might correct the problem. You might want to check there now and then. http://forum.arduino.cc/index.php?topic=338008.0

I don't know how the Due might respond to 5 volts on a data pin, but I imagine not well. I don't know how the motor shield might respond with a 3.3 volt power supply.