Arduino UNO + Motor Shield Power problem

I am running a obstacle avoidance robot and when I connect directly from my laptop using a USB connector to the UNO board, the robot runs fine. The problem is when I directly connect the Ground and power (from a 9V battery) to the Ground and Vin pin on the motor shield, the robot goes "crazy" (while power is still on) obviously not doing the actions written from the code. Any help will be greatly appreciated!

What kind of 9V battery? Motors require lots of current that your battery may not be able to provide. A laptop will provide around 500ma or more.

A 9V 'transistor' battery can power your Uno (connected through the voltage regulator), but not your motors usually.

-transfinite

Thank you for the information :slight_smile: