Why does this circuit need these resistors connected to the transistor?

I was following the instructions from the book, "Arduino for Dummies", and worked on this tutorial with a dc motor and it says that I need a 2.2k ohm resistor connected from a digital output pin to the transistor's middle pin. Why does it require a resistor there? Is the transistor not able to handle 5V?

Picture of Why does this circuit need these resistors connected to the transistor?
sort by: active | newest | oldest

The base of the transistor is a very low resistance from base to emitter. You put a resistor in to limit the current into the base. The current INTO the base is multiplied by the parameter marker Hfe on the datasheet into the current that flows in the collector/emitter. If the resistor is too big, your load won't turn on, if its too small the transistor dies.

If you're doing this properly, you assess the current you want in the load, call it 'I' amps, you pick a transistor, and you note its Hfe. The required basecurrent = I/Hfe.

Given you have 5V, roughly on the output of an arduino, then the base current limit resistor needs to be less than R=5 x Hfe/I

seonghoon52 (author)  steveastrouk2 years ago

Ahh it all makes sense now. Thank you sir!

Or you could just use a 1k resistor, they work fine most of the time.

petercd2 years ago

Its a current limiting resistor to prevent damage to the arduino and also provide protection against shorts.

The diode will prevent reverse currents from going back to the arduino causing damage.

If you're using a brushed motor, it might be a wise idea to add a 0.1 uF ceramic capacitor across the motor brushes to suppress arcing at the brushes

I pretty much got all that from the instructable on the right "related" column.


seonghoon52 (author)  petercd2 years ago

I appreciate your input. Thank you!