You can use this circuit to coontroll the speed an the direction of rotation of a dc motor with arduino

pnp transistors = bc640 npn transistors = bc639 and one bc540(q6)