Go Down

Topic: [SOLVED] How to choose a transistor ? (Read 3253 times) previous topic - next topic

007good

Jul 25, 2015, 01:27 am Last Edit: Jul 27, 2015, 03:37 pm by 007good
Hello,

I've build a circuit with a 7-segment powered by a external 9V Battery and theorically controled with the arduino trough transistor..

The problem is the following :

When everything is plugged with standard LED instead of 7-segment everything works fine ! The Led blink while arduino tell them to !!
BUT
When I plug the 4'' 7segments device, nothing blink.. I used a 220k-Ohm to protect the Led (or 7 segment) and 10K-Ohm to protect the base of transistor..
One more time, no power trough the 7 segments When it's working fine with the LED.
I guess that's the transistor work when the LED ask 1,9V (20mA), but when I plug the 7segment requiring 7,4V (same 20mA).. Then the transitor give up ?

I used the transistor of the starter kit, it was writtent maximum 6V on the base and 80V on the collector/emiter with 100mA, so I thought it was ok..

Thanks for your help to the newcomer I am :)

007good

By the way, I also tried with small 7 segments.. And it work fine ! The problem comes from the fact, that this bigger 7 segment require more power?

MAS3

#2
Jul 25, 2015, 01:49 am Last Edit: Jul 25, 2015, 01:21 pm by MAS3
Hi and welcome.

The larger 7 segment displays use multiple LEDs per segment, where the smaller ones use a single LED.
You should look for the specifications of the display before you can use it.
I see you found out something that tells you 7.4 volts and 20 mA.
So you need to make sure that you have at least this 7.4 volts.
Also, a standard transistor "eats up" about 0.7 volts.
So if you want to power the large 7 segment display, you need at least 8 volts.
9 volts would be even better.
Then you can calculate what resistor you need to reduce current to 20 mA:

9 - 0.7 - 7.4 = 0.9 volts.
You want a 0.9 volt drop over the resistor, and you already know you want to allow a max of 20 mA.
I=U*R; R=I/U, so 0.9/0.02 = 45 Ohms.
45 Ohms is not a standard value, so we'll look for the next higher standard value, which is 47.
You could also decide for 56 Ohms.
The display will light less bright, but it might live a bit longer.

Also use a resistor in the base of the transistor, something like 1K should do.
A typical NPN transistor setup will invert the signal, so keep that in mind while building your sketch.

Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

CrossRoads

#3
Jul 25, 2015, 02:58 am Last Edit: Jul 25, 2015, 02:58 am by CrossRoads
Common anode display? Use TPIC6C595 or TPIC6B595 to sink current from the segments.
Still need 9V. The shift register has some Rds associated with it, so you will need a smaller current limit resistor.
http://www.digikey.com/product-search/en?pv69=80&k=tpic6c595&mnonly=0&newproducts=0&ColumnSort=0&page=1&stock=1&quantity=0&ptm=0&fid=0&pageSize=25
http://www.digikey.com/product-search/en?pv1291=1207&k=tpic6b595&mnonly=0&newproducts=0&ColumnSort=0&page=1&quantity=0&ptm=0&fid=0&pageSize=25
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Wawa

Carefull with that.
Segments use multiple LEDs in series, but the decimal point might use one or two.
That can be solved with a zener diode with the value of the "missing" LEDs.
Leo..

007good

Hello guys,

Thanks for your answer. However, it doesn't help me yet :)
MAS3, you tell me that my resistor are not the best, too big, so it won't allow the LED to bright or less, but this is not the case. It works with those resistor.

Let me explain with pictures as I think the circuit is simple enough to do that.

The circuit just plug into a LED, it work correctly the LED is ON. So the transistor work correctly, the arduino deliver it power trough pin 2... All good



When plug into one segment of the 7 segments.. Everything OFF... I thought the 7segments could be dead, or the resistor to big..



But when I shortcut the transistor, the segment is ON.... So the 7 segment is alive, and the resistor is not too big.. it could probably bright more, but this is not the problem.. Is the transistor the problem? The arduino ?



Please help me  :smiley-confuse:

Thank you :)

MAS3

You haven't told us what transistor you are using, nor how it's wired up.
I told about the voltage drop of a transistor of about 0.7 volts.
The wire has a voltage drop of about 0.00 volts, which can be all the difference.
Your conclusions are incorrect, you can't take out a single component by shorting it, and then if it works assume that the rest is correct.
But first tell us about what transistor you used and exactly how you connected it.
That includes resistor values.
It is not visible from those photo's.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

007good

#7
Jul 27, 2015, 01:43 pm Last Edit: Jul 27, 2015, 01:51 pm by 007good
Hello MAS53,

Transistor : https://www.arduino.cc/documents/datasheets/BC547.pdf
Resistor : 220 Ohms for the LED (I don't have any smaller yet) - 4,7 KOhms for the base.

+ of the 9V to the collector
Pin 2 of the arduino trough the resistor to Base
Emitter trough the resistor to the segment of the 7-segments

You say that the 0,7V that take the transistor can be the problem, because that doesn't leave enough voltage to the LED right ? I can try with a 12V battery ? :)

MAS3

That's not the best way to do this.
You are using a NPN transistor.
The problem is that you seem to be using a common cathode display, is that correct ?

You should use a NPN transistor in the cathode line of a LED.
You can't do that if you have a common cathode display.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

007good

#9
Jul 27, 2015, 02:07 pm Last Edit: Jul 27, 2015, 02:09 pm by 007good
Yes it is a common cathod display.

Thing is I will need transistor at both anode pin and common cathode, because there will be 3 displays like that connected to the same arduino.
So all "same" segment connected to the same pin of the arduino. And each cathode to a pin. 7 anode + 3 cathode = 10pins.
Then I "light" let say number 1 with cathode 1, delay few millisecond, "light" 2 with cathode 2. And it "print" 12.

All this worked very fine with those small common cathode 7-segments : http://www.tme.eu/fr/Document/8096a7da4d6b8f0b5b1ecc419ba019ae/CC56-11EWA.pdf

But with the bigger one, not even able to light one segment  >:(

By the way : here is the datasheet of the "big" 7 segments
http://www.kingbrightusa.com/images/catalog/SPEC/SC40-19SURKWA.pdf

MAS3

You can use the BC547 for the cathodes, so to select the display.
You'd have to connect the cathode to the collector, and GND to the emitter.

For the anodes, you still need a transistor because you can't send 9 volts directly from an Arduino pin.
But because you are controlling the VCC here, you'd need a BC557 (which is complementary to your BC547), a PNP transistor.
This transistor gets the resistor connected, it doesn't matter whether it is connected to VCC and emitter or to collector and segment.
This means each segment needs its own resistor.

You told in your first post you were using a 220K Ohm resistor, because those are the only ones available to you right now.
I assume you made a mistake and meant 220 Ohm.
If you put 4 of those in parallel, you will create a new resistor of 55 Ohm.
That will be close enough to the right value.
So for your tests, you can still create the right circumstances this way to light up a single segment.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

CrossRoads

#11
Jul 27, 2015, 02:56 pm Last Edit: Jul 27, 2015, 02:56 pm by CrossRoads
Your final setup needs to be like this. PNPs to drive the segments, NPN to turn on the digits one by one.
The resistor for the decimal point will be a different value than for the segments.
For the segments:
(12V - 0.7V - 0.7V - 7.8 )/.02 = 140 ohm, can use a standard 150 ohm
For the decimal point:
(12V - 0.7V - 0.7V - 3.9 )/.02 = 335, can use a standard 330 ohm
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

007good

Hello MAS53,
Than you for your reply.
I connected my transistor to the cathode (to control the complete display), and it works well.

Can you explain to me what the difference between NPN and PNP that make the PNP working when connecting to the anode and NPN doesn't ? But NPN work with cathode (will PNP work with cathode?).

Also why those same NPN transistor worked with both anode and cathode on the smaller system ?

MAS3

NPN is used to sink current, meaning to pull it down to GND.
PNP is used to source current, to pull it up to VCC.

The transistor is built up in a different way.
Transistors are diodes with an extra layer, creating 2 diodes in one.
You need to open the diode to have the complete part conduct.
The two types are a pair of diodes pointing towards each other, or a pair of diodes pointing away from each other.
This of course is a simplified explanation, but it shows these transistors are polarity sensitive.

CrossRoads made a nice drawing in the post above your last, showing the control of each segment.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

007good

Thank you MAS53 and CrossRoads for your explanation.
Evertything is clear !

I ordered the PNP transistor, will get them tomorrow for testing.

Go Up