A common GND

Here's a drawing from another post

The VCC can be any reasonable voltage up to the rating of the transistor, the 1k resistor would be your motor, the 10k would be smaller, and GND has to be common between the two power supplies.

If however you use a relay the two circuits are independant and the GNDs don't have to connected (but no harm done if they are either). If you use a relay though you will almost certainly have to implement the above circuit to drive it unless you are using a very small relay.


Rob