Pages: [1]   Go Down
Author Topic: Pull downs, transistors and LED's  (Read 1160 times)
0 Members and 1 Guest are viewing this topic.
North Queensland, Australia
Online Online
Edison Member
*
Karma: 65
Posts: 2110
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,
I have recently been working on a small project involving RGB LED's and multiplexing.
It is based on two videos I found on youtube:




I have made some changes and additions to the design, but I'm not completly sure it is correct. I intend to drive it using SPI so I have used two 74HC595N shift registers to essentially control the multiplex. I have a few queries about the pull up/down resistors:

I want the system to be disabled till I'm ready so I have pulled up the OE pin to disable the register outputs. On the anode multiplex of 2n3904 transistors I have a 10K pulling the bases LOW,

when the register is active and outputing a high, will the connection go through the 100K transistor base or to the 10K pull down?  

I'm pretty sure the pull down resistors need to be something like 200K or 1M, I just didn't notice this until I did up the schematic.

And the same question for the cathodes, just inverted.

My other concern involves the base resistors on the anode transistors: Will the current limiting resistors on the LED's further limit the current set by the base resistors causing a voltage drop too low?

Or do the base reisitors only set a maximum current flow, and if so, do I actually need the limiting resistors, or inversly keep the limiting resistors and remove the base resistors?

I used this page to work out the base resistors: http://www.rason.org/Projects/transwit/transwit.htm
Hopefully my calculations were correct, It worked out near 96k, so I used 100k resistors that I had handy.
I also replaced the videos NPN transistors on the cathodes with PNP using this page.


And to get 20mA at the LED's I calculated my current limiting resistors using 5v. Is this correct or do I need to use resistors for 3.3v supply?

My LED info:
Common cathode
Forward Voltage ( @ 20mA )
R = 2.1v
G = 3.0v
B = 3.0v

I calculated:
R = 145 Ohms ( using 150 )
G & B = 100 Ohms

Any advice would be greatly appreciated, the LED's were mildly expensive so I'm quite reluctant to turn it on without some input from a knowledgeable few.

« Last Edit: March 07, 2013, 11:48:09 pm by pYro_65 » Logged


Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26473
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Your connections don't make sense to me.
You need to drive the anodes High and the cathodes Low to turn on an LED.
You transistors don't appear to be set to do that.
I would think you'd have PNPs controlling current from +5 into the anodes, and NPN's sinking current to ground for the cathodes.
You have 6 RGB common cathode LEDs?
From the shift register, connect 3 current limit resistors to all the Rs connected in parallel, same for the Bs, same for the Gs.
From the shift register, connect 6 base current limit resistors to 6 NPN transistors. Connec the emitters to ground. Connect 1 collector to each of the LEDs.
Drive the anodes high/low as desired, drive 1 cathode low. drive same cathode high.
Repeat for the next 5.
Do it quickly for flicker free operation.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 46
Posts: 2865
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The pull-down is common to all the transistors for a given type of driver... it is likely very ok but I question the 100K resistor as the resistor would limit the base current (remember transistors are current operated devices) to 50uA Ib X Beta ~ 80 @ 20 ma Ic would only allow 4 ma of collector current to flow (.00005A X Hfe = 80@ 20 ma Ic = .004 A (assuming a 5V drive signal) 10K would be a more representative value for a 50 - 60 mA max current. base resistors of that size will pretty much eliminate any possible damage to the LED's but would make the display rather dim according to the math involved. The 80 figure for Beta or Hfe comes from an interpolation from the Fairchild data sheet and is typical of the device family regardless of MFR.

Doc

Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 46
Posts: 2865
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually it is some more crappy engineering as the High side transistors are emitter followers and they as a class have one issue , the emitter voltage MUST be .6 - .7 volts below the base voltage in order to turn the transistor on. So 5V (base) = 4.3 - 4.4 V emitter). The only really useful part of that 'scheme'... is that it needs positive logic through out to make it work. Nothing needs to be inverted.

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

North Queensland, Australia
Online Online
Edison Member
*
Karma: 65
Posts: 2110
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks guys for some input.

Quote
You have 6 RGB common cathode LEDs?

No, sorry. I left that information out accidentally.
I have 72 RGB LED's connected in a 6x12 grid giving 18 anode pins and 12 cathode pins.

Quote
Your connections don't make sense to me.
You need to drive the anodes High and the cathodes Low to turn on an LED.
You transistors don't appear to be set to do that.

My intention was to use HIGH for the anodes and LOW for the cathodes. And it appears I have placed my 2n3904 transistors backwards, now the emitters go to the anodes.

Was this what you where pointing out?

Quote
I would think you'd have PNPs controlling current from +5 into the anodes, and NPN's sinking current to ground for the cathodes.

Is this a better combination for say: NPN vs PNP performance, or more for a different active logic?

I found this comment on the youtube remarks: "for the Anode transistors...don't need base resistors (emitter follows the base just 0.6V lower)."

Is this correct? From what I have read it seems a base resistor is required.

I have also recalculated the base resistors at 37869 so I put in 40K, I am still unsure about the 10K pull up/down resistors and weather they must be more than the 40K base resistor.

Are there any guidelines for using pull up/down resistors?

« Last Edit: March 07, 2013, 11:50:02 pm by pYro_65 » Logged


Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26473
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd say you need to get the right tools for the task, in this case the right chips.
I'd suggest a uC with more IO, and a current sink chip that will be way less tedious to wire up than all those transistors.

I'd go with a chip in the 40 pin '1284 series, with 32 usable IO pins. Keep D0, D1 free for messages from a PC, or sketch downloading, or use as input switches.
Wire your anodes in parallel as  columns, and wire the cathodes in parallel as rows.
Store your pattern to display in an 18x12 array.
(1284 has 16K SRAM too, can store several)
Write a simple loop to multiplex thru the LED array:
Code:
void loop(){
if ( millis() - next_udpate) >=on_duration){
next_udpate = next_update + on_duration;
turn off current cathode
next_row = next_row+1;
if next row == 12, next row = 0;  //reset back to top
read next array row, write the anodes, drive next cathode low
}
and while waiting for next refresh time to occur, can be checking for serial message, change the array, read buttons, etc
}

Make sense?


* 644_rgb_array.jpg (118.54 KB, 720x960 - viewed 18 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

North Queensland, Australia
Online Online
Edison Member
*
Karma: 65
Posts: 2110
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi CrossRoads,

My initial non rgb prototype was done on a mega, but in an effort to understand EE concepts more than my current level I set my self a challenge. I also have little need for ram as the patterns I wish to display can be generated quickly at run time. However as I add more peripherals I many need more ram to work with, and my mega is still an option. But for now I would like to stick with some variation of my original design. Next year I hopefully can get into a uni course, and I would like to have a bit of practical experience under my belt.

And at the moment the led grid is only half the size I intend to work with. I might also put an order in for a 1284 just to check it out.
Logged


Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 46
Posts: 2865
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Knock off Chinese 2560's are about $20.00 - $25.00 now... on Ebay. The ones with 8U USB devices... Just a thought. mine was a freebie from a friend there, even says Arduino on it, that's why it was a freebie. Name copyright violation. Seems to work ok, once everyone here held my hand so's I could get it working (USB Driver issues and my stupidity. For as long as I have been working with PC's I should not have been fooled that way). Bought a $15.00 Uno for the same reason... They (Ebay pulled it) Right after mine was shipped, Go Figure.

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26473
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, fine, you want a challenge, I can accept that.
You still need to wire up things correctly so current can flow.
I think you need something like this, and then have your 2nd layer of transistors controlling the multiplexing of the transistors.
Low turns on the PNP transistors, High turns on the NPN transistors.


* discrete_rgb_drive.jpg (35.39 KB, 960x720 - viewed 20 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26473
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The end result would be something like this where transistors controlled the muxing of a 5x5x5 cube.
You are changing the control with the addition of the PNP transistors.


* 5x5x5_cube_transistors.jpg (101.8 KB, 960x720 - viewed 20 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: