Varying DC Motor speed causing unusual outcome

Recently, i have encountered a problem with a mobile application that controls DC motors. The DC motors does not follow to what i have programmed. For example, when i set delay(500), it provides me with a delay longer than what i have programmed.

After some troubleshooting, i realized that the problem lies with the motor speed that i have set. Instead of setting the motor at full speed (motor->setSpeed(255);), i set the motor at half speed (motor->setSpeed(127);).

Does anyone know what are the possible reasons for this? I am suspecting that the DC motors will need a higher requirement for voltage if i set the motor at full speed. However, when i increase the voltage input to the Arduino, it gives me the same problem.

Thanks in advance! :slight_smile:

Without knowing how you have things connected, what motor you are using, how much current the motor draws, what power supply you are using, whether the Arduino and motor have separate power supplies, it's a bit difficult to give any suggestions!!!!!

Paul

Thank you for the reply. And apologies for the lack of information.

My connection is rather simple. I have an Arduino Uno, Annikken Andee bluetooth shield and an Adafruit Motor Shield, all stacked upon each other. The DC motor that i am using is the common yellow gearbox that has a voltage of 3V-9V. More information can be found in the link below.

https://www.bananarobotics.com/shop/Yellow-Gear-Motor-with-48-to-1-reduction-ratio

Whenever i have 2 seperate supply : (USB to Arduino and 6V to motor shield), the problem does not exist. However, when i remove the USB supply and only supply only 6V to the motor shield, the DC motors will gives me some unusual outcome.

Do you suppose that when you remove the power to the Arduino, the Arduino no longer controls the motor?

Paul

Yes. When i remove the USB power to the Arduino, it no longer controls the motor according to what i have programmed. It gives some unusual outcome instead. For e.g. delay longer than expected.

calai:
Yes. When i remove the USB power to the Arduino, it no longer controls the motor according to what i have programmed. It gives some unusual outcome instead. For e.g. delay longer than expected.

Perhaps the Arduino will not work with out power applied. All my Arduino stop immediately when I remove power. Why not power your Arduino from a separate supply?

Paul

There is more than one Adafruit motor shield.
The ones I know have a V-in jumper to channel motor supply to the Arduino.
But that should only work reliably when motor supply is stable, and > ~6.5volt.
Arduino's 5volt regulator might not be able to make a stable 5volt if V-in drops below that.
That could lead to unexpected behaviour.
Leo..

I can understand now and am convinced with the reason provided. Thank you for the help. :slight_smile: