Show Posts
Pages: [1]
1  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: January 31, 2013, 05:03:56 am
Neat! Nice work. Would you mind posting the new code as a reference?  Definitely think it would be helpful for me as jump into the programming of my cube.  Thanks.
2  Using Arduino / General Electronics / Re: Help check my (basic) understanding on: January 30, 2013, 09:28:51 pm
Nickity & Lefty,

Thank you for the patience and for helping me understand these basic concepts.  This is a great, supportive community.  Parts are en route from digi-key.

More questions to come no doubt...
3  Using Arduino / General Electronics / Re: Help check my (basic) understanding on: January 30, 2013, 04:28:35 pm
I built an indicator out of various 3mm colored LEDs.  The red, green, yellow, and blue LEDs were all diffused, but the white was clear.  I sanded it with a fine sandpaper and it turned out great.  Easy does it though, a little goes a long way.  I canned my first attempt because I had sanded several flat spots into it.  ;-)  (Technically, I didn't can it, I just use it for breadboard projects where I don't care about the visual quality.  Why waste a good LED?)

At the risk of being a FET pusher, try a small MOSFET instead.  This is the perfect sort of application for them.  You should use a small (100-200R will do fine) resistor for good measure, but the FET gate (analogous to the base of a BJT) has a high impedance, so there's no need to current limit or calculate gains.  You'll need a logic level FET.

I use VN10LPs for moderate current (270mA) -- here's a link to Digikey: http://www.digikey.com/product-detail/en/VN10LP/VN10LP-ND/92610

If you're driving them all at a full 20mA, you'll need something with more gusto.  Here's a ZVN4206A good for 600mA:  http://www.digikey.com/product-detail/en/ZVN4206A/ZVN4206A-ND/92604

Those are both N-channel, so you'll be switching between the LED and ground.  (Same as NPN.)

Nickity, I'm digging this route since, frankly, it seems clearer to me... but that's probably b/c I haven't sunk down into the weeds yet.  Is there a benefit/drawback to running these at 20mA vs something lower?  It looks like the circuit will all be laid out in the same fashion so there isn't much difference between the two.  Would there be any difference in the programming?

Thanks for helping me through this beginning frustration!
4  Using Arduino / General Electronics / Re: Help check my (basic) understanding on: January 30, 2013, 03:15:36 pm

No. Think about a given pattern you may want to display that turns on all 16 leds of a single level (Row) going to a single output pin driving that row. That could be 16 X 20 milliamos of current which is more then the poor row enable pin can supply, hence the need to use 4 switching transistors to drive the 4 levels (Row). That make sense?

  Regardless, I am amidst some heady (for me) reading on transistors and hope to understand the use of them for this project if necessary.  I have some 2N2222's here and was initially planning on using these on the rows but am having some serious trouble understanding the calculations behind choosing correct resistors to use with the transistors.  Any "beginner language" help would be greatly appreciated.

A 2N2222A transistor is really not able to switch 16 x 20ma of current, you need a 'bigger' transistor.


Yes, that does make sense.  I was assuming (incorrectly) that multiplexing was for every LED.  That is, only one LED would ever be lit at a time, not just for those in a single column (driven by a single pin). 

I am starting to track with the transistors and think I am getting some of the math down...

So the max current that would potentially need to be sunk(?) from one level is 20mA*16 == 320mA
I've read that you should build in some sort of safety factor, of say 2, when selecting the transistor.  In this case I would need a transistor with a collector current (Ic) of 640mA minimum.

What should I set by base current (Ib) to?  I understand it can be low.  Is there a rule of thumb at play here?  I'll assume 20mA for the Ib?

Hfe, or the gain (amplification) to the base current, is allegedly calculated Hfe==(5*Ic)/Ib where 5 is a factor used to ensure the switch closes "hard."  If this is correct, Hfe=(5*.64)/.02 == 160mA min.  I think things are falling apart here as I am not finding transistors that seem to fit this math.  If things were correct, I'd now go to the store and try to find a transistor that has a minimum Hfe of 160mA, with a minimum Ic of 640mA, operating at 5V (or should this be 5V - LED voltage drop?).

When trying to "shop" online for a transistor that fits the above specs I was not finding much.  I believe I am doing something horribly wrong here. 






5  Using Arduino / General Electronics / Re: Help check my (basic) understanding on: January 30, 2013, 12:59:54 pm
I was under the impression that because of multiplexing I wouldn't be pushing the arduino too much.  LED driver chips and the like are beyond my skill set at the moment, but I will certainly add them to the list of items to research. 

That is correct, a 3x3x3 led cube will be no problem being powered by your arduino board. You will need 3 transistors to drive the three 'levels' as a 'level driver' via 3 output pins, as it has to be able to supply up to 9 X 20 ma, more then a output pin can handle by itself. So you will need to use 12 digital pins, but keep in mind that the analog input pins can function as digital pins just by using pin numbers 14 to 19, so a Uno board is good to go.

Lefty



So, I've gone back to a 4x4x4 and am having a conversation with myself regarding the need for transistors.  As the Uno can utilize 20 pins (16 columns, 4 rows) as digital pins and because of multiplexing, shouldn't I be able to (safely) get away without transistors?  Regardless, I am amidst some heady (for me) reading on transistors and hope to understand the use of them for this project if necessary.  I have some 2N2222's here and was initially planning on using these on the rows but am having some serious trouble understanding the calculations behind choosing correct resistors to use with the transistors.  Any "beginner language" help would be greatly appreciated.

I've also attempted a first draft of a schematic for this project (attached).  It assumes the use of transistors but does not include the connections to the Uno.  I plan to have the columns connect to "digital" pins 0-13 and "analog" 0-1, while the rows will connect to "analog" 2-5.  Thoughts?  Am I tracking in the right direction?

Nickity - I am planning on "diffusing" the LEDs by sanding them.  While this won't diminish the brightness, I hope it will prevent the need for sunglasses. 
6  Using Arduino / General Electronics / Re: Help check my (basic) understanding on: January 29, 2013, 02:20:19 pm
Thanks for the quick replies.  At least I now feel like I am making some sense of all of this in my head... and yet it is clear I have a long way to go smiley

I was under the impression that because of multiplexing I wouldn't be pushing the arduino too much.  LED driver chips and the like are beyond my skill set at the moment, but I will certainly add them to the list of items to research. 

Jack - I'll be working on the schematic over the next few days and will post once it's complete.  I am thinking of using gzip's build as a go-by http://www.instructables.com/id/LED-Cube-and-Arduino-Lib/?ALLSTEPS

7  Using Arduino / General Electronics / Help check my (basic) understanding on: January 29, 2013, 01:22:43 pm
I am new to this world of the arduino (and electronics in general to be more precise) and have spent some time trying to wrap my head around many of the concepts.  After much reading I've decided to jump into building a 3x3x3 cube (wanted to do a 4x4x4 but think a 3x3 is more prudent for a first project). 

I've gone ahead a purchased a number of blue LED's from eBay which have the following specs - 3.0-3.4v, 3.22v typical, 24mA max, 13000 mcd.  In trying to calculate the resistors I need I've both used an online "calculator" and more importantly tried to apply Ohm's law as I understand it... And, this is where I need my understanding to be checked.

I understand that the Arduino Uno works at 5V.  So, if I am applying  Ohm's law correctly, I need to calculate the "voltage drop" (which I am equating to the remaining voltage after the LED), and divide by the current I want the circuit to draw (in this case based on what the LED can handle):

R=V/I
R=(5 - 3.2)/.02A == 90ohm resistor required (this uses an avg voltage of the LED and assumes a chosen 20mA current)

So, I think I should be rounding up to a 100ohm resistor to prevent more than 20mA going through the LED.  This is consistent with what the calculators are returning.  I assume rounding up to a higher resistor will simply limit the current available for use by LED resulting in an imperceptibly dimmer LED.

What I am not 100% on is how the the arduino's output current plays into this (or if it does at all).  I understand that the max input or output the pins can handle is 40mA.  I assume that it is the resistor that limits the current from the pin, hence an additional reason for choosing 20mA in the above equation.  So, hypothetically if I used a smaller resistor more current would flow through the LED potentially damaging it and the in/output pin. 

Eg. - using an imaginary 10ohm resistor
I=V/R
I=1.8/10 = .18 amps or 180mA == damage to the LED and i/o pin

Does all of this sound right?
Pages: [1]