5v DC Motor and Arduino with the Same Power Supply

Is there any problem if I use the same power supply for both 5v DC motor and Arduino?
Please see the attached design.

Thanks

No problem. But the 5V should not go to the Vin pin, which needs 7V+, but to the pin marked 5V.

Steve

Just connect the 5V to the motor for logic control.

Not very wise to use a potentially dirty motor supply for sensitive electronics.
Especially without some regulation or decouping in between.
So good luck.

I assume you're using a darlington transistor (TIP120),
because normal transistors won't get saturated (will fry) with that ~1.3mA base current (3k3 resistor).
Leo..