Special considerations while using DC motors
Very small DC motors that have current requirements of less than 30 mA may be run for very short periods (a few seconds) of time by directly powering them from the Arduino pins. This may be done for experimental purposes only; however, in practical settings, directly powering a DC motor from the Arduino pins is not recommended.
Unlike other DC powered components that we have seen so far, the average DC motor requires a lot of current, much more than what can be supplied by an Arduino Uno pin. A separate power source must be used for powering DC motors. Hence grasping the concept of using multiple power sources in a single standalone circuit becomes extremely essential.
Note
Fundamental - Multiple power sources:
When working with devices that require large currents that cannot be supplied by the Arduino board, separate power sources should be used. One for powering the Arduino (the brain of the circuit) and another more powerful source for the DC motor...