# Help with a resistor choice

#### cassity69

Joined Dec 18, 2013
37
Greetings, i have four 7 segment displays which have to be configured with a pic microcontroller to show certain speeds and weight from a stepper motor and load cell... anyway for now im confused as to which resistor to choose whilst connecting to a 5v supply when using a 2N3904 transistor
is this something i have to calculate because ive seen different values on different images

any help would be great
thanks

#### cassity69

Joined Dec 18, 2013
37
i forgot to mention its the base resistor i need to find

#### tshuck

Joined Oct 18, 2012
3,534
Assuming you are trying to use the transistor as a switch, the rule of thumb is to use a beta of 10, to ensure good saturation.

This means you will design for a base current that is one tenth of the collector current.

#### cassity69

Joined Dec 18, 2013
37
oh beta = hfe i understand so i use 10 for that

#### cassity69

Joined Dec 18, 2013
37
ok so how do i find out the voltage drop that is all i need

#### ScottWang

Joined Aug 23, 2012
7,398
The value of resistor will affecting the frequency response of transistor, and the duty cycle will affecting the brightness of 7-seg LEDs, if you considering the power dissipation then you can try it from 10K to 1K, and just testing form the right side of the 4 digits.

#### cassity69

Joined Dec 18, 2013
37
and the collector current i find on data sheet?
sorry i need to get this spot on

#### tshuck

Joined Oct 18, 2012
3,534
ok so how do i find out the voltage drop that is all i need
Typical assumption is 0.65 -0.7, however, the datasheet will give you a value for the diode drop at a rated current, and, hopefully, a graph of the diode drop voltage with respect to collector current.

And, yes, hfe is beta...

Edit: according to this datasheet, your diode drop will probably be on the higher side of the 0.65V-0.9V range. Also, it looks like your Vce saturation voltage is around 0.2V.

Last edited:

#### tshuck

Joined Oct 18, 2012
3,534
and the collector current i find on data sheet?
sorry i need to get this spot on
Collector current is determined by what you want the maximum amount of current through your transistor is (e.g. the maximum current when all the LEDs are on) .

#### cassity69

Joined Dec 18, 2013
37
hmmm i havent really looked into how much current i want i just want all four displays to be able to show what i want
a tad confused i know its simple i shouldnt be struggling with it, its the last part of my hardware build

#### cassity69

Joined Dec 18, 2013
37
ok so the voltage drop of the data sheet is shown as the base saturation. minumum being 0.65 and maximum being 0.85 - 0.95.... so im safe to go with 0.7? so its just the collector current

#### tshuck

Joined Oct 18, 2012
3,534
It's nothing to be ashamed of if you haven't had to deal with it before.

You will probably need to have one for each display, assuming each LED is calculated for 20mA (7 * 20mA = 140mA, and maximum collector current is 200mA). Of course, you can reduce the amount of current for each LED and maintain good brightness, thereby reducing the amount of collector current to design for.

How are you intending to hook these up so we can give you specific help?

#### tshuck

Joined Oct 18, 2012
3,534
ok so the voltage drop of the data sheet is shown as the base saturation. minumum being 0.65 and maximum being 0.85 - 0.95.... so im safe to go with 0.7? so its just the collector current
No, this is the voltage drop from the base to the emitter at the rated currents. So, if you have Ic = 50mA and Ib = 5mA, this drop will be between 0.65V and 0.95V.

#### cassity69

Joined Dec 18, 2013
37
oh ok erm basically i have four seperate 7 segs, ideally i would like 2 pairs because im intending on displaying a speed of my stepper motor which will need two digits, aswell as the weight of the load on the load cell which will need a decimal point as it will be 1-5kg but with small increments. but ill have to just do it with the 4 single ones for now so maybe there is a way of driving them as a pair so maybe only needed two transistors and two resistors?

at the minute i have the stepper and a variable resistor ( acting as the accellerator) this is wired up correctly and i have it working.
im using a darlington driver and a pic

someone advised me on just using arounf a 2 k resistor as it doesnt really matter as long as its between 1.8 and 4 ish

#### cassity69

Joined Dec 18, 2013
37
right im being kicked out of my office, ill view this thread first thing tommorow morning with the hardware in front of me . thanks for you help tshuck

#### tshuck

Joined Oct 18, 2012
3,534
Okay, so since you are attempting to use a NPN, is it safe to assume you are using common cathode seven segment displays?

If so, I would imagine that you would hook it up as seen here. The link is for use with a Raspberry Pi, but don't worry, it is more or less the same.

If, however, you have a common anode seven-segment display, you should use a PNP transistor and hook it up like this.