PNP base resistor - Page 1
Forum section: electronics / beginners

author: dande
author_rank: Contributor
timestamp: December 17, 2014, 09:24:46 am
content: Hi All!I've tried to drive RGB leds with 4 PNP BJTs, one BJT is connected to each one of C1..C8, and the other three should drive the cathodes of the leds. RR1..8, GR1..8, BR1..8 are connected to three 74HC595s respectively.Naturally this doesn't work. When I'm driving the bjts' base with 0 volts, everything is as expected, but when I drive it with 5V to turn the transistor off, it is still on, the leds are almost imperceptibly dimmer. My theory is that I miscalculated the 1K base resistors, and the voltage drop is too large on them to turn the bjts completely off.The BC807-16 PNPs in question are these:http://www.tme.eu/hu/Document/443bea0044bb250f58448ece9d8ed297/bc807.pdfCan you help me please with the issue? Should I use a smaller base resistor? If yes, what value?Thanks in advance!!

author: mij59
author_rank: Frequent Contributor
timestamp: December 17, 2014, 09:47:21 am
content: Hi,The voltage at the emitter of the transistor is greater than 5,7V , so it won't turn off.Lower the voltage of C1...A better way is to use a npn transistor, connect the resistor and led to the collector, emitter to ground.You could also use a n-channel mosfet.

author: dande
author_rank: Contributor
timestamp: December 17, 2014, 10:00:16 am
content: Thanks!How can the voltage be greater than the supply voltage?Supply voltage is 5V. I already have the board made and assembled, I knew I shouldn't have experimentedwith transistorsAnyhow, I've attached the full schematics, the driving circuit is on the second page, can you please give me an idea on howto lower the C1..C8 voltage?Thank you so much!!

author: mij59
author_rank: Frequent Contributor
timestamp: December 17, 2014, 11:17:33 am
content: If you using only one power supply there's no need to lower the voltage of C1.. , circuit should work.Please post some photo's of the board.

author: KJDS
author_rank: Super Contributor
timestamp: December 17, 2014, 11:21:50 am
content: Measure the voltage at the transistor base when it's in the on and off state

author: dande
author_rank: Contributor
timestamp: December 17, 2014, 11:26:25 am
content: You can find the images I took while assembling the board in this album:http://imgur.com/a/wO5nLI have to tell you that this is my first "complex" board, and I (as the example shows) lack some fundamentalknowledge here and there regarding electronics))

author: Zero999
author_rank: Super Contributor
timestamp: December 17, 2014, 11:36:12 am
content: Your schematic is almost impossible to follow.The transistors are configured as emitter followers so don't need any base resistors.It think the problem is you've got some of the LEDs sharing the series resistor so an LED is getting its power from another transistor which is on.Redraw part of the circuit with everything connected together and it should become more clear.

author: mikerj
author_rank: Super Contributor
timestamp: December 17, 2014, 11:51:07 am
content: Just to clarify, are you having problems turning off Q1 to Q24? Do Q25 to Q32 work as expected?

author: mij59
author_rank: Frequent Contributor
timestamp: December 17, 2014, 11:59:07 am
content: Just thinking the impossible, a software error ?

author: dannyf
author_rank: Super Contributor
timestamp: December 17, 2014, 12:03:29 pm
content: QuoteWithout seeing how both the anodes / cathodes are driving, it is hard to tell.Generally, you want to drive the load on the collectors. So in your case, the cathodes should be switched via npn and the anaode via pnp. In the case of small led indicators, they can be easily driven by the 595s.

author: Zero999
author_rank: Super Contributor
timestamp: December 17, 2014, 12:04:53 pm
content: Quote from: Hero999 on December 17, 2014, 11:36:12 amSome of them are also configured as common emitter so do need base resistors.Are you planning to multiplex the LEDs?

author: dande
author_rank: Contributor
timestamp: December 17, 2014, 12:05:04 pm
content: mij59: everything is possible!The only reason I am suspecting that I did something wrong on hw side, because when I write a code to turn on all BJTs delay for 1s then turn off them, I see the flicker, only very dimly.I've created a simplified schematic, just to show the main idea behind the whole stuff. The only difference is thatmine have 8 rows and 8 columns. At one moment only 1 column should be on.mikerj: Neither of the bjts are turned offEDIT: Sorry, I forgot to change the default value on the column base resistors, those are 1k too!

author: dande
author_rank: Contributor
timestamp: December 17, 2014, 12:09:26 pm
content: Quote from: Hero999 on December 17, 2014, 12:04:53 pmyes! only one column is ON at a time, and then I drive (at least try to) the RGB cathodes for every row. Then I jump to the next column, and so on...

author: KJDS
author_rank: Super Contributor
timestamp: December 17, 2014, 12:11:26 pm
content: Quote from: dande on December 17, 2014, 12:05:04 pmSo what do the voltages read?

author: dande
author_rank: Contributor
timestamp: December 17, 2014, 12:13:27 pm
content: Quote from: KJDS on December 17, 2014, 12:11:26 pmI am at work at the moment, I have to go home to measure everything, it was in the middle of night when I measured everything, and don't remember it at all.So, the attached schematic is theoretically not wrong? :/

author: dannyf
author_rank: Super Contributor
timestamp: December 17, 2014, 12:14:09 pm
content: QuoteYou could have the wrong sequence here.

author: dande
author_rank: Contributor
timestamp: December 17, 2014, 12:16:02 pm
content: Quote from: dannyf on December 17, 2014, 12:14:09 pmTo be honest, I've tried to turn off every bjts without any luckThe leds are on whatever I do

author: dannyf
author_rank: Super Contributor
timestamp: December 17, 2014, 12:27:34 pm
content: With so much information you have provided, there is very little others can do to help you.You know you are in a tough spot if others ask you to help them help you.

author: Zero999
author_rank: Super Contributor
timestamp: December 17, 2014, 12:36:25 pm
content: It does sound like you've got the programming wrong here.Try setting all of the outputs to high and all the LEDs should all turn off. If they don't. Verify you have the correct pin out/footprints for all of the transistors.

author: dande
author_rank: Contributor
timestamp: December 17, 2014, 12:57:17 pm
content: Quote from: dannyf on December 17, 2014, 12:27:34 pmI am sorry dannyf, I am in a tough spot, because I don't know what else can I provide at the moment, and I knowthat this is my fault because of the lack of my understanding, can you please tell me some guidelines what kind of informationyou need to help me further (besides measurements, which I can only do at home)?To recap:- I am using an ATmega168A MCU to control 4 74HC595s. The 74HC595s are controlled using SPI code- 1 shift register is used to control the column PNPs, every output of this shift register is connected to Col1, Col2 ...- The other 3 are controlling the rows for every color, for example 1 74HC595 is connected to RedRow1, RedRow2, RedRow3 ... and so on- Whatever data I send to the shift registers, the LEDs stay on, if (in code) I switch all Columns and every rows' every color to 5V, the LEDs are still on.

author: dande
author_rank: Contributor
timestamp: December 17, 2014, 12:58:28 pm
content: Quote from: Hero999 on December 17, 2014, 12:36:25 pmAnyhow I set the outputs of the shift registers the LEDs stay on

author: Zero999
author_rank: Super Contributor
timestamp: December 17, 2014, 01:01:22 pm
content: Isolate the part of the circuit which is causing the problem. Disconnect all of the shift registers and connect Col1, Col2 and RedRow1, GreenRow1 and BlueRow1 to +5V and all the LEDs should turn off.

author: Andy Watson
author_rank: Super Contributor
timestamp: December 17, 2014, 01:57:49 pm
content: Quote from: dande on December 17, 2014, 12:58:28 pmSo the transistors are not behaving as transistors? I would double-check the pin-out - make sure that the PCB corresponds to the schematic and the footprint.

author: hamdi.tn
author_rank: Frequent Contributor
timestamp: December 17, 2014, 02:23:21 pm
content: as andy said check your transistor footprint, if you used the default PNP model from altium library , it have a different pin arrangement than the transistor you have.

author: dande
author_rank: Contributor
timestamp: December 17, 2014, 05:38:32 pm
content: Came home, checked it out. Yup, wrong footprint. I am on the edge of crying like a little child.What are my options now? In my footprint, I have collector on pin 1, base on 2 and emitter on 3, are there any PNP BJTs withthis footprint? Should I just remove the BJTs and hope that the 74HC595s can handle the current?Or should I just frame the board, put it on my wall to remind me why I have triple check the footprints?Thanks all! You've been an enormous help!

author: hamdi.tn
author_rank: Frequent Contributor
timestamp: December 17, 2014, 05:46:34 pm
content: been there myself, just try to rotate it so the right pin meet the right pad and solder it that way, i did that, but i didn't have that much transistor to remove and solder again.

author: Falcon69
author_rank: Super Contributor
timestamp: December 17, 2014, 05:51:01 pm
content: cn you bend the pins, and flip the chip upside down maybe? Hand solder them?

author: hamdi.tn
author_rank: Frequent Contributor
timestamp: December 17, 2014, 06:02:10 pm
content: i think what you will have to do is to rotate the package 120° trigonometric direction so pin 1 take 2 pin 2 take 3 and pin 3 fixed to 1

author: mij59
author_rank: Frequent Contributor
timestamp: December 17, 2014, 06:36:50 pm
content: Quote from: dande on December 17, 2014, 05:38:32 pmDon't cry over the board use a handkerchief.Replace the transistors with TO92 footprint transistors and use the board to do further testing.The 74HC595 can't handle the current .

author: dande
author_rank: Contributor
timestamp: December 17, 2014, 06:43:20 pm
content: Quote from: mij59 on December 17, 2014, 06:36:50 pm)well, at least the MCU part with the power supply is working correctly with the programmer part. I just need to be happywith what went good on the first try. It should have been a christmas present, and because I have to work, I won't have time tosource the needed parts. Also, I am not sure that the 74HC595s are working correctly, but I'll test that it later.I now need a nice little frame with the title "F*cktard! Check the footprints!!" Any ideas?

author: KJDS
author_rank: Super Contributor
timestamp: December 17, 2014, 08:30:17 pm
content: It's easy enough to fit a transistor with the legs swapped. I've done it more often than I care to remember.Next time, go through each part you want to use in the layout and check the footprint and pin out. Rename it to "78L05 checked" or move it into a directory named checked.

author: dande
author_rank: Contributor
timestamp: December 17, 2014, 08:33:05 pm
content: Quote from: KJDS on December 17, 2014, 08:30:17 pmThank you! It is great advice!To be honest, I don't want to "hack" the board, one of the idea behind it was it's "niceness", as I said it was meantto be a gift, but I got a couple of fallbacks, since I've learned already, that "Murphy always gets you"

author: KJDS
author_rank: Super Contributor
timestamp: December 17, 2014, 09:11:03 pm
content: It's well worthwhile building up enough transistors fitted "wrongly" to show that it works. Otherwise you'd relay out the board, get it made and discover another silly fault that would have been easily fixed if you'd done a little more testing on the first version.I've made some horrible horrible mods on first iteration layouts, but doing so meant that the second version worked properly.

author: dannyf
author_rank: Super Contributor
timestamp: December 17, 2014, 09:27:33 pm
content: You can swap C/E pins and they will continue to function as a switch, with low beta.