Controlling motor speed with PWM; Chapter 4 in Jeremy Blum - Exploring Arduino

I found: Chapter 4 | Exploring Arduino

The first circuit is related to the one in question. It uses a 1k base resistor which is far too large so
yes I'd expect the transistor to get very hot.

150 ohms is the right sort of value, assuming the motor pulls 0.6A at most.

I just wanted to test the motor circuit with a +5 V signal on the transistor base and a 0 V (ground) signal on the transistor base, to see that it was working.

By the way the 5V must go via the base resistor to the transistor, otherwise you've just melted
your transistor internally. BJT's are current driven, forcing 5V between base and emitter is going
to blow it away. The base resistor provides a 30mA or so base current which is within
spec for the device.