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

Hello, I am working through "Exploring Arduino" by Jeremy Blum. In Chapter 4, "Using Transistors and Driving Motors," the first experiment is wiring up a DC motor, isolated from the Arduino, with the sketch "Controlling Motor Speed with PWM."

I carefully built the circuit, and before even messing with the sketch at all, 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.

But at 0V, instead of not running at all, the motor runs erratically, kind of a wahh-wahh-wahh-wahh, but it never goes to 0 rpm. Connecting the transistor base to the +5V (through the 1k-ohm resistor, of course) the motor runs up to it's top speed and stays there, as it should.

Upon typing in and loading up the sketch, it does indeed ramp up and down in speed, but at the low end it never stops, but does the same thing as above.

I tried swapping out the 2222 transistor and it made no difference. BUT the transistor is hot to the touch, enough to give me a little burn on my finger when I went to pull it out.

Any ideas why my motor won't slow all the way down to a stop and whether my transistor is supposed to get this hot?

[Using a 9V battery to power my circuit with the motor and either the USB cable or a 12V/1.5A power adapter cable for the Arduino board.]
Thanks.

Not familiar with this example ....Could be a power supply problem - not enough to supply everything . Run the motor off the battery and the Arduino from the USB .The transistor getting hot is an indication it is not fully switching - have you got it the right way around ?

Are you running the identical circuit as per the example ? You also must have the code loaded and be using the same board

Also a motor may not operate at the lower voltage .

What is the motor's rated voltage and full load current, can you post a link to the motor datasheet?

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.

Hi,
Check that you have the 2222 correctly oriented.

Can you please post a picture of your project so we can see your component layout?

Thanks... Tom.. :slight_smile: