DC motor only runs when arduino is connected to pc

Hi,
Welcome to the forum.

To add code please click this link;

What 9V battery are you using?
One of these?
ab-base_2_142

Do you have a DMM?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia: