Nono, i'm more than willing to use resitors, and yes i read back and see that they recommend 1k or 10k resistors. I'll play around with this when i get home. My problem is, i had no idea which resistor to use, or really how to figure out which resistor to use. What i'm starting to wonder, is the voltage coming out of the emitter based on the current going through the base or the voltage? and if its the current, is the resistor going to help increase the current if enough isn't being provided? man i really need to take an analog electronics class, but there's not one offered at my school. thanks for the help!
edit: one more thing, i think on the ppdb, that the leds are protected by some kind of resistor.·
Between the prop and the transistor base you should have a resistor of about 1K. You also need a resistor between the transistor and the led, and the value of that one depends on the voltage going to the led. For 5.0V around 120 ohms, 12V around 480 ohms to get 20mA. The resistor value will vary for different leds since they have different forward voltages, and this is more noticeable at lower input voltages.
Logic gates are *almost* tinkertoys (the digital logic abstracts out most of the
*electrical* issues leaving only logic issues) but to use transistors properly, you
really do need to understand how they work, how to model them, and how to
analyze them.
Linear mode, saturation mode, Miller capacitance, biasing, common-emitter,
common-collector---if these don't make sense to you, time to go back and hit
the books.
It's really not that hard, and in the end it is a lot more fun actually learning about
these amazing devices and using them properly, than it is connecting them
randomly and releasing the magic smoke.
You should quickly get to the point where you can understand the entire schematic
of a simple superheterodyne AM receiver, and how each and every transistor and
diode does its job.
This is a shaggy dog. If you are pressed for time, just skip to the pictures and the question at the end[noparse]:)[/noparse]
I have been having all kinds of fun... and have been buried in the web. I have made some progress, but for right now... back to square 1.
Square One: making a one bit pixel.
I have RadioShack's inventory to choose from, and the LED I chose to play with for this step in the development of my 96 bit pixel was a red, high brightness LED (Radioshack part number 276-0020). It is a flat rectangular LED... and it just looks cool... so that's the one I chose.
Clearly, we can't simply drive this LED at full capacity using the output from a single Prop pin, because we can't source 70mA from a Prop pin.
So, how do we get exactly 2.6V at exactly at 70mA?
Here is an important fact that I re-discovered after playing and web-surfing for a couple of days, mostly looking at other stuff:
In a voltage divider made from resistors in series, the voltage drop at any point is simply the ratio of resistance in front(on the supply side) of that point to total resistance across the total voltage drop. A simple fact, without which I are largely incapacitated(sic)[noparse]:)[/noparse]
Vcc--->R1---->R2---->Ground (NOTE... this is fine in my window, but pops up wrong on the forum... V1 comes off between R1 and R2)
|
|
V1
In this case the total voltage drop is just Vcc-Vground(zero)... Vcc-zero, which is very close to Vcc.
V1 = Vcc minus the voltage drop at V1
The voltage drop at V1 is the ratio (R1/(R1+R2) times the total voltage drop, which is just Vcc.
Because I am eventually going to need 4V to drive another LED... I have chosen
5V for Vcc... and when I actually measured Vcc, I got 5.07V.
Remember, the value of R1 is of no consequence in determining V1. Only the ratio of R1 to R1+R2 is important. And of course, the magnitude of Vcc is important for determining V1. For any value of R1 there will always be another resistor of some value, called R2... which gives us the exact value of V1 that we want.
But the value of R1 DOES matter, because the actual resistance of R1 will uniquely determine the current flowing at V1. Given a specific value of Vcc(5.07V) each particular current will be matched by one and only one value for R1.
From Ohm, we know that
V=IR, so to find our value for R1
Vcc/I=R1.
In this case we specify a current of 70mA and a voltage of 5.07.
We take Vcc to be the measured value of 5.07 and current, I, is specified to be 0.070A for this particular LED. So clearly,
R1=5.07/0.070
R1=72.4 ohms, exactly. Of all the R1s in the world... only this R1 will give us .070A in the presence of 5.07V. Now the issue is "given this particular R1 how do we then determine the value of R2, which will give us V1=2.6V?"
R1 is going to be 72.4 Ohms, because and only because we want our current to be exactly .070 A (70 mA). Notice, that if we use R2=72.4, we get
V1 = 5.07V/2
V1 = 2.535V
with current, I, of 70 mA... not bad.
But in this case we want V1 to be exactly 2.6V.
Since 2.6V is slightly more than half of Vcc, the voltage drop that we need is slightly less than 1/2 of the total voltage drop of Vcc. (We expect R1 to be slightly less than R2.)
The voltage drop that we are looking for is 2.47 from 5.07... because the voltage that we want is 2.6V... (5.07V-2.47V = 2.6V)
So,
2.47= 5.07 * (72.4/(72.4+ R2)),
where 2.47 is the voltage drop that we need to get V1=2.6V ... so we just need to solve for R2
2.47/5.07=72.4/(72.4+R2)
(72.4+R2)=(5.07/2.47)*(72.4)
R2=(72.4/(2.47/5.07))-72.4
R2= 76.2
The proof that this is correct is as follows
V1 =Vcc-voltage drop after R1
voltage drop is (R1/(R1+R2))*Vcc
so,
V1 =5.07 - ((72.4 / (76.2 + 72.4)) * 5.07)
V1=2.599825033647
Amazing... except that in actual practice I had to set R1 = 68 and R2 = 73 in order to get measured values of exactly 2.6V and 70 milli-amps.
I suspect that this is because I am drawing current from Bean's Mini(Hittconsulting.com). The original current source measures at only about 120mA. So, we are trying to draw more than half the available current... we are sucking against a potential vacuum somewhere...[noparse]:)[/noparse]
All of this... and what do we have?
When I put the LED in as in Image 2... I get results as indicated in image two. If I simply remove the 4.7Ohm resistor... breaking that particular path to ground... my measured voltage increases from 2.111 to 2.386.
Now, if I place a 68 ohm as in the images and a 73 ohm resisitor between the anode and ground, I measure 3.66V.
What specs do I use and with what calculations to get this right the first time?
Thanks,
Rich
There is an error in photos... anode and cathode labels are reversed. sorry.
One thing that's helpful to realize when driving LEDs is that, except for making sure you have enough voltage available, you can ignore the forward voltage and just regulate the current. You will not be able to regulate both, since they are not independent variables. In other words, if you regulate the current to 70mA, the forward voltage will automatically settle to approximately the nominal forward voltage at that current. OTOH, trying to regulate the voltage and hoping that the current works out would be a mistake, since the current vs. voltage curve is so steep near the nominal forward voltage and since the forward voltage can vary from LED to LED.
The next step was to get control of the base of a transistor... without using resistors. So, a programmable voltage source was in order.
Because I wanted voltages higher than 3.3V, I decided to control a 5V source. And for this Dennis Ferron's recently published OBEX classic for the 74HC595 shift register seemed perfect.
The timing isn't exactly right, but the included code limits the shift register to 1 bit and then switches it on and off. The included code provides a duty cycle of around 50% giving 2.4V if the bit is switched on at the beginning of the repeat loop and about 2.6V if it is put at the end of the repeat loop. This is a Spin only version of Dennis' object and it provides multiple kHz performance.
Comments
edit: one more thing, i think on the ppdb, that the leds are protected by some kind of resistor.·
Logic gates are *almost* tinkertoys (the digital logic abstracts out most of the
*electrical* issues leaving only logic issues) but to use transistors properly, you
really do need to understand how they work, how to model them, and how to
analyze them.
Linear mode, saturation mode, Miller capacitance, biasing, common-emitter,
common-collector---if these don't make sense to you, time to go back and hit
the books.
It's really not that hard, and in the end it is a lot more fun actually learning about
these amazing devices and using them properly, than it is connecting them
randomly and releasing the magic smoke.
You should quickly get to the point where you can understand the entire schematic
of a simple superheterodyne AM receiver, and how each and every transistor and
diode does its job.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Basic Stamp,···· Propeller,·· · SX,·· FUN!
START:·
>Proccessing Data. . . .··
>Task Complete. . .·.
>Saving Data. . . .
>Entering SLEEP Mode. . . .
>Signing OFF
·
I have been having all kinds of fun... and have been buried in the web. I have made some progress, but for right now... back to square 1.
Square One: making a one bit pixel.
I have RadioShack's inventory to choose from, and the LED I chose to play with for this step in the development of my 96 bit pixel was a red, high brightness LED (Radioshack part number 276-0020). It is a flat rectangular LED... and it just looks cool... so that's the one I chose.
It has the following specs:
70mA
2.6V
(that's .182 watts)
giving 2400mlm (2.4 lumens... 2.4 Lux/sq meter)
Clearly, we can't simply drive this LED at full capacity using the output from a single Prop pin, because we can't source 70mA from a Prop pin.
So, how do we get exactly 2.6V at exactly at 70mA?
Here is an important fact that I re-discovered after playing and web-surfing for a couple of days, mostly looking at other stuff:
In a voltage divider made from resistors in series, the voltage drop at any point is simply the ratio of resistance in front(on the supply side) of that point to total resistance across the total voltage drop. A simple fact, without which I are largely incapacitated(sic)[noparse]:)[/noparse]
Vcc--->R1---->R2---->Ground (NOTE... this is fine in my window, but pops up wrong on the forum... V1 comes off between R1 and R2)
|
|
V1
In this case the total voltage drop is just Vcc-Vground(zero)... Vcc-zero, which is very close to Vcc.
V1 = Vcc minus the voltage drop at V1
The voltage drop at V1 is the ratio (R1/(R1+R2) times the total voltage drop, which is just Vcc.
Because I am eventually going to need 4V to drive another LED... I have chosen
5V for Vcc... and when I actually measured Vcc, I got 5.07V.
Remember, the value of R1 is of no consequence in determining V1. Only the ratio of R1 to R1+R2 is important. And of course, the magnitude of Vcc is important for determining V1. For any value of R1 there will always be another resistor of some value, called R2... which gives us the exact value of V1 that we want.
But the value of R1 DOES matter, because the actual resistance of R1 will uniquely determine the current flowing at V1. Given a specific value of Vcc(5.07V) each particular current will be matched by one and only one value for R1.
From Ohm, we know that
V=IR, so to find our value for R1
Vcc/I=R1.
In this case we specify a current of 70mA and a voltage of 5.07.
We take Vcc to be the measured value of 5.07 and current, I, is specified to be 0.070A for this particular LED. So clearly,
R1=5.07/0.070
R1=72.4 ohms, exactly. Of all the R1s in the world... only this R1 will give us .070A in the presence of 5.07V. Now the issue is "given this particular R1 how do we then determine the value of R2, which will give us V1=2.6V?"
R1 is going to be 72.4 Ohms, because and only because we want our current to be exactly .070 A (70 mA). Notice, that if we use R2=72.4, we get
V1 = 5.07V/2
V1 = 2.535V
with current, I, of 70 mA... not bad.
But in this case we want V1 to be exactly 2.6V.
Since 2.6V is slightly more than half of Vcc, the voltage drop that we need is slightly less than 1/2 of the total voltage drop of Vcc. (We expect R1 to be slightly less than R2.)
The voltage drop that we are looking for is 2.47 from 5.07... because the voltage that we want is 2.6V... (5.07V-2.47V = 2.6V)
So,
2.47= 5.07 * (72.4/(72.4+ R2)),
where 2.47 is the voltage drop that we need to get V1=2.6V ... so we just need to solve for R2
2.47/5.07=72.4/(72.4+R2)
(72.4+R2)=(5.07/2.47)*(72.4)
R2=(72.4/(2.47/5.07))-72.4
R2= 76.2
The proof that this is correct is as follows
V1 =Vcc-voltage drop after R1
voltage drop is (R1/(R1+R2))*Vcc
so,
V1 =5.07 - ((72.4 / (76.2 + 72.4)) * 5.07)
V1=2.599825033647
Amazing... except that in actual practice I had to set R1 = 68 and R2 = 73 in order to get measured values of exactly 2.6V and 70 milli-amps.
I suspect that this is because I am drawing current from Bean's Mini(Hittconsulting.com). The original current source measures at only about 120mA. So, we are trying to draw more than half the available current... we are sucking against a potential vacuum somewhere...[noparse]:)[/noparse]
All of this... and what do we have?
When I put the LED in as in Image 2... I get results as indicated in image two. If I simply remove the 4.7Ohm resistor... breaking that particular path to ground... my measured voltage increases from 2.111 to 2.386.
Now, if I place a 68 ohm as in the images and a 73 ohm resisitor between the anode and ground, I measure 3.66V.
What specs do I use and with what calculations to get this right the first time?
Thanks,
Rich
There is an error in photos... anode and cathode labels are reversed. sorry.
Post Edited (rjo_) : 5/1/2009 1:36:45 PM GMT
-Phil
hmmm.... that's juicy!!!!
Rich
Because I wanted voltages higher than 3.3V, I decided to control a 5V source. And for this Dennis Ferron's recently published OBEX classic for the 74HC595 shift register seemed perfect.
The timing isn't exactly right, but the included code limits the shift register to 1 bit and then switches it on and off. The included code provides a duty cycle of around 50% giving 2.4V if the bit is switched on at the beginning of the repeat loop and about 2.6V if it is put at the end of the repeat loop. This is a Spin only version of Dennis' object and it provides multiple kHz performance.
I'm off to give the boy a haircut.
More later,
Rich