MX2 LEDs to GPO Help
MX2 LEDs to GPO Help
Hi. I have an older version of the MX2 (no direct fan or temp monitoring).
I want to connect 4 leds to the GPOs (two blue - around 3.3V /two red - around 1.7 V).
I know the first 3 GPOs are at 5V with current limiting resistors. But will I need to add a resistor with my LED when using the first 3 GPOs because the 5V would kill my red LEDs for sure. Or maybe I misunderstand how the built in resistors work?
What about GPOs 4-6? I can make that 5V by changing the jumper but those don't have resistors so I definately need to add one for my LEDs there?
Finally, to connect the LEDs to the GPO pins, do I just take a 2 pin connector (like the ones on HD and power LEDs) and plug it in for the corresponding GPO pins?
I want to connect 4 leds to the GPOs (two blue - around 3.3V /two red - around 1.7 V).
I know the first 3 GPOs are at 5V with current limiting resistors. But will I need to add a resistor with my LED when using the first 3 GPOs because the 5V would kill my red LEDs for sure. Or maybe I misunderstand how the built in resistors work?
What about GPOs 4-6? I can make that 5V by changing the jumper but those don't have resistors so I definately need to add one for my LEDs there?
Finally, to connect the LEDs to the GPO pins, do I just take a 2 pin connector (like the ones on HD and power LEDs) and plug it in for the corresponding GPO pins?
Re: MX2 LEDs to GPO Help
Yes you are correct.tok3n wrote:Hi. I have an older version of the MX2 (no direct fan or temp monitoring).
I want to connect 4 leds to the GPOs (two blue - around 3.3V /two red - around 1.7 V).
I know the first 3 GPOs are at 5V with current limiting resistors. But will I need to add a resistor with my LED when using the first 3 GPOs because the 5V would kill my red LEDs for sure. Or maybe I misunderstand how the built in resistors work?
What about GPOs 4-6? I can make that 5V by changing the jumper but those don't have resistors so I definately need to add one for my LEDs there?
Finally, to connect the LEDs to the GPO pins, do I just take a 2 pin connector (like the ones on HD and power LEDs) and plug it in for the corresponding GPO pins?[/quote]
Yup.
That was simple

Henry J.
President
Matrix Orbital
President
Matrix Orbital
So just to make certain:
1. For the first 3 GPO, since they are giving 5V and I'm using 3.3 and 1.7V LEDs, I will need the proper resistors in line with my LEDs for those GPOs?
2. Same with GPOs 4-6? Once I make them 5V via the jumper.
3. Then what does it mean in the manual when it says GPOs 1-3 have a current limiting resistor? It is still giving off 5V when you connect the LEDs so you need an addition resistor anyway?
1. For the first 3 GPO, since they are giving 5V and I'm using 3.3 and 1.7V LEDs, I will need the proper resistors in line with my LEDs for those GPOs?
2. Same with GPOs 4-6? Once I make them 5V via the jumper.
3. Then what does it mean in the manual when it says GPOs 1-3 have a current limiting resistor? It is still giving off 5V when you connect the LEDs so you need an addition resistor anyway?
-
- Matrix Orbital
- Posts: 255
- Joined: Thu Sep 13, 2001 6:00 pm
- Location: Calgary, Alberta, Canada
Just thought I should jump in here. GPOs 1-3 (on this particular hardware version) have 240 ohm resistors in place already. GPOs 4-6 have no resistors, so you WILL need to add your own.
You will first need to figure out the resistance that you need. Typically LEDs need about 20mA of current to operate (exotic, small or large LEDs may need more or less). Since you're using 3.3V and 1.7V LEDs you'll need the resistor to drop 1.7V and 3.3V respectively. At 20mA that would be 85 ohms and 165 ohms respectively. If in doubt use this formula:
R_led = (V_source - V_led) / (I_led)
R_led - required resistance
V_source - the source voltage (usually 5V)
V_led - usually 1.2V for common leds, but can be higher or lower, check the specs
I_led - usually 20mA (0.020 A), but again can vary, check the specs
So I would put your 3.3V leds on GPOs 4-6 in series with about a 100 ohm resistor which will give you about 17mA of current (again check the specs of the LED to make sure it can handle that) and put your 1.7V LEDs on GPOs 1-3 to get about 14mA of current with the 240 ohm resistors that are already on the board.
You will first need to figure out the resistance that you need. Typically LEDs need about 20mA of current to operate (exotic, small or large LEDs may need more or less). Since you're using 3.3V and 1.7V LEDs you'll need the resistor to drop 1.7V and 3.3V respectively. At 20mA that would be 85 ohms and 165 ohms respectively. If in doubt use this formula:
R_led = (V_source - V_led) / (I_led)
R_led - required resistance
V_source - the source voltage (usually 5V)
V_led - usually 1.2V for common leds, but can be higher or lower, check the specs
I_led - usually 20mA (0.020 A), but again can vary, check the specs
So I would put your 3.3V leds on GPOs 4-6 in series with about a 100 ohm resistor which will give you about 17mA of current (again check the specs of the LED to make sure it can handle that) and put your 1.7V LEDs on GPOs 1-3 to get about 14mA of current with the 240 ohm resistors that are already on the board.
James McTavish, P.Eng
Director of Engineering
Matrix Orbital
Director of Engineering
Matrix Orbital
-
- Matrix Orbital
- Posts: 255
- Joined: Thu Sep 13, 2001 6:00 pm
- Location: Calgary, Alberta, Canada
Resistance and voltage are two seperate and neccessary things. By putting on a current limiting resistor on GPOs 1-3 we make it so that if somebody shorted out the two pins there would only be 5V/240 ohm = 20 mA of current which wouldn't fry the unit. If somebody was drawing 10mA of current, the voltage available at the pins would be:
5V - (voltage drop across the resistor)
and Ohms law is V=I*R so:
5V - (0.010A)*(240 Ohms) = 2.6V
So as you draw more current the, voltage available at GPO pins 1-3 will drop. GPOs 4-6 have a much lower impedance so their drop will be far less.
You are right that 5V directly would fry the LEDs, but only because there is too much current. LEDs/diodes are unusal devices in that the voltage drop is always the same, no matter how much current is flowing through them. This means that LEDs don't control the current through them. The current control comes from the resistor. When your LED is droping 1.7V, there is 3.3V left over (assuming a 5V source). Since the only other thing in the circuit is the resistor, that drop must happen across the resistor. And using Ohm's law, I=V/R gives you the current that will result from that.
With GPOs 1-3 there is already a resistor that is there for you, and it's 240 ohms so assuming your 1.7V LED (just as an example), there would be 3.3V left over from a 5V supply so:
I = (3.3V)/(240 Ohms) = 14 mA
which your LED should be able to handle (but double check the specifications!)
As for GPOs 4-6, they have a very low resistance (on the order of a couple of Ohms, which can be ignored). So you will need to include a resistor to limit the current through the LED (as described above).
5V - (voltage drop across the resistor)
and Ohms law is V=I*R so:
5V - (0.010A)*(240 Ohms) = 2.6V
So as you draw more current the, voltage available at GPO pins 1-3 will drop. GPOs 4-6 have a much lower impedance so their drop will be far less.
You are right that 5V directly would fry the LEDs, but only because there is too much current. LEDs/diodes are unusal devices in that the voltage drop is always the same, no matter how much current is flowing through them. This means that LEDs don't control the current through them. The current control comes from the resistor. When your LED is droping 1.7V, there is 3.3V left over (assuming a 5V source). Since the only other thing in the circuit is the resistor, that drop must happen across the resistor. And using Ohm's law, I=V/R gives you the current that will result from that.
With GPOs 1-3 there is already a resistor that is there for you, and it's 240 ohms so assuming your 1.7V LED (just as an example), there would be 3.3V left over from a 5V supply so:
I = (3.3V)/(240 Ohms) = 14 mA
which your LED should be able to handle (but double check the specifications!)
As for GPOs 4-6, they have a very low resistance (on the order of a couple of Ohms, which can be ignored). So you will need to include a resistor to limit the current through the LED (as described above).
James McTavish, P.Eng
Director of Engineering
Matrix Orbital
Director of Engineering
Matrix Orbital
I see. So while GPOs 1-3 give off 5V - with the 240ohm resistor that is there, the actual voltage is less. My red LEDs are 1.7V and 20 mA. When I usually hook up resistors for LEDs find one that drops the current so that the voltage is at or near the rated forward voltage. So for 1.7V I would probably use a resistor at 180 ohms. 0.02A x 180 ohm = 3.6V dropped from 5 which gives 1.4 thru the resistor.
But with the 240 ohm built in resistors, wouldnt the voltage drop be 0.02A x 240 = 4.8V? Only 0.2V for the LED?
Or maybe I misunderstand how resistors and LEDs work...
But with the 240 ohm built in resistors, wouldnt the voltage drop be 0.02A x 240 = 4.8V? Only 0.2V for the LED?
Or maybe I misunderstand how resistors and LEDs work...
-
- Matrix Orbital
- Posts: 255
- Joined: Thu Sep 13, 2001 6:00 pm
- Location: Calgary, Alberta, Canada
You've almost got it. The LEDs will ALWYAS drop their rated voltage (under normal conditions). The resistor always picks up the slack. So don't work from
Current*Resistance=Drop across resistor
Supply-Drop across resistor=Drop across LED
Work it out this way:
Supply - Drop across LED = Drop across resistor
(If you need to figure out the resistance you require)
Drop Across Resistor / Desired current = Required resistance
OR
(If you have the resistance and you want the supplied current)
Drop Across Resistor / Resistance = Supplied current
So for the 240 ohm resistor, we'll work it out for both your 1.7V and 3.3V LEDs
1.7V:
5V(supply) - 1.7V(LED drop) = 3.3V(Drop across resistor)
3.3V(Drop across resistor) / 240 ohm (Resistance) = 13.75mA (Supplied Current)
3.3V:
5V(supply) - 3.3V(LED drop) = 1.7V(Drop across resistor)
1.7V(Drop across resistor) / 240 ohm (Resistance) = 7.08mA (Supplied Current)
The more current (up to the rated max) you give an LED the brighter it is. So the resistor allows you to tune the current and hence the brightness. Just remember the LED will always drop its rated voltage and the resistor will be forced to drop whatever is left over. You use ohms law to determine what resistance you need for a desired current or what current you'll get from a resistance.
Current*Resistance=Drop across resistor
Supply-Drop across resistor=Drop across LED
Work it out this way:
Supply - Drop across LED = Drop across resistor
(If you need to figure out the resistance you require)
Drop Across Resistor / Desired current = Required resistance
OR
(If you have the resistance and you want the supplied current)
Drop Across Resistor / Resistance = Supplied current
So for the 240 ohm resistor, we'll work it out for both your 1.7V and 3.3V LEDs
1.7V:
5V(supply) - 1.7V(LED drop) = 3.3V(Drop across resistor)
3.3V(Drop across resistor) / 240 ohm (Resistance) = 13.75mA (Supplied Current)
3.3V:
5V(supply) - 3.3V(LED drop) = 1.7V(Drop across resistor)
1.7V(Drop across resistor) / 240 ohm (Resistance) = 7.08mA (Supplied Current)
The more current (up to the rated max) you give an LED the brighter it is. So the resistor allows you to tune the current and hence the brightness. Just remember the LED will always drop its rated voltage and the resistor will be forced to drop whatever is left over. You use ohms law to determine what resistance you need for a desired current or what current you'll get from a resistance.
James McTavish, P.Eng
Director of Engineering
Matrix Orbital
Director of Engineering
Matrix Orbital
-
- LCD?
- Posts: 3
- Joined: Fri Oct 03, 2003 2:28 pm
- Location: London-New Zealand
Hello all,3.3V:
5V(supply) - 3.3V(LED drop) = 1.7V(Drop across resistor)
1.7V(Drop across resistor) / 240 ohm (Resistance) = 7.08mA (Supplied Current)
The more current (up to the rated max) you give an LED the brighter it is. So the resistor allows you to tune the current and hence the brightness. Just remember the LED will always drop its rated voltage and the resistor will be forced to drop whatever is left over. You use ohms law to determine what resistance you need for a desired current or what current you'll get from a resistance.
I have a LK204-25 LCD. Its got 6 GPOs all of which have 240ohm resistors, I also have 4 Blue LEDS they are 3.3volts max and 50ma Max(maplin JA28F). The manual says the total amount the GPOs can handle is 20mA. Looking at the above this would indicate to me that i could replace the 240 ohm resistor with an 85 ohm (for the maximum of 20mA output)
1.7 / 20mA = 85 ohm. Will the Led even work with 20mA?
if my figures are correct my next question then becomes "the manual states that if i connect a device with a higher resistance than 240 ohms the resistor can be shorted out with a bit of wirewrap wire" does that mean that if it is less than 240 it cant be shorted? does it mean that i ve gone off on some bizare tangent, does it mean i should stick to Lego?...

please help
Thanks in advance
PS England won the rugby - yippy

Its better to have a trebuchet and not need one. than need one and not have one.
-
- Matrix Orbital
- Posts: 255
- Joined: Thu Sep 13, 2001 6:00 pm
- Location: Calgary, Alberta, Canada
The LEDs would work, but they wouldn't be as bright. Since the power is supplied directly from the microprocessor, the limit is 20mA of current. Any more than this an you blow the output on the processor, if not the processor itself. If you want to drive the LED with those outputs, you will need to use a transistor level shifter. If you want to know how, let me know and I will post a circuit 

James McTavish, P.Eng
Director of Engineering
Matrix Orbital
Director of Engineering
Matrix Orbital
-
- LCD?
- Posts: 3
- Joined: Fri Oct 03, 2003 2:28 pm
- Location: London-New Zealand
Hi James,
I would be very interested in a circuit that would allow me to do that. ive just had my soldering iron nicely warmed up for a home built 25 switch keypad(that does your head in when you use a strip board and wire
!!),
please post.
thanks very much
Carrick Mortimer
I would be very interested in a circuit that would allow me to do that. ive just had my soldering iron nicely warmed up for a home built 25 switch keypad(that does your head in when you use a strip board and wire

please post.
thanks very much
Carrick Mortimer
Its better to have a trebuchet and not need one. than need one and not have one.
-
- Matrix Orbital
- Posts: 255
- Joined: Thu Sep 13, 2001 6:00 pm
- Location: Calgary, Alberta, Canada
What you need is a simple RTL inverter:

The 15K resistor is optional. All it does is limit the current through the base, which the 240 Ohm resistor on the display will do anyways. The only other reason you would want it is to cut down on power consumption. The transistor is pretty much any old NPN transistor. The top resistor is the current limiter for your LED. Since you have a 3.3V led, a 5v supply leaves 1.7V left over. So pulling out our friend Ohms law:
R = V/I = 1.7V/0.05A = 34 Ohms
Which is a pretty small resistor. You can use a 12V power supply which would mean that you have 8.7V left over or:
R = V/I = 8.7V/0.05A = 174 Ohms. Just one word of word of warning. If the LED is specified for 3.3V MAX and 50mA MAX then DO NOT ROUND DOWN. In fact I would round up a little just to give yourself a little bit of a margin. Your LED won't be quite as bright but if the power spikes you won't blow it.
To connect this to the LK204-25 are fairly simple. The outside rail of pins is the actual switched signal. Connect it to the base of the transistor. The inside rail is your +5V (if you use 5V). Attach the grounds to your power supply ground. Obviously if you use a 12V source you will have to supply that too, just make sure that it's ground is tied to the ground of the LK204-25 (all grounds have to be common!).
You could also use just about any switching MOSFET transistor instead of an NPN. Just depends on what you have laying around
If you want to drive multiple LEDs with a single GPO:
1) Half the resistance at the top (eg 174 Ohms -> 87 Ohms)
2) Put the other half of the resistance (eg 87 Ohms) in series with EACH LED
3) Connect all the resistor/LED pairs in parallel from the collector (the top part of the transistor) to ground.
Hope this helps. If you have any more Q's feel free to post them.

The 15K resistor is optional. All it does is limit the current through the base, which the 240 Ohm resistor on the display will do anyways. The only other reason you would want it is to cut down on power consumption. The transistor is pretty much any old NPN transistor. The top resistor is the current limiter for your LED. Since you have a 3.3V led, a 5v supply leaves 1.7V left over. So pulling out our friend Ohms law:
R = V/I = 1.7V/0.05A = 34 Ohms
Which is a pretty small resistor. You can use a 12V power supply which would mean that you have 8.7V left over or:
R = V/I = 8.7V/0.05A = 174 Ohms. Just one word of word of warning. If the LED is specified for 3.3V MAX and 50mA MAX then DO NOT ROUND DOWN. In fact I would round up a little just to give yourself a little bit of a margin. Your LED won't be quite as bright but if the power spikes you won't blow it.
To connect this to the LK204-25 are fairly simple. The outside rail of pins is the actual switched signal. Connect it to the base of the transistor. The inside rail is your +5V (if you use 5V). Attach the grounds to your power supply ground. Obviously if you use a 12V source you will have to supply that too, just make sure that it's ground is tied to the ground of the LK204-25 (all grounds have to be common!).
You could also use just about any switching MOSFET transistor instead of an NPN. Just depends on what you have laying around

If you want to drive multiple LEDs with a single GPO:
1) Half the resistance at the top (eg 174 Ohms -> 87 Ohms)
2) Put the other half of the resistance (eg 87 Ohms) in series with EACH LED
3) Connect all the resistor/LED pairs in parallel from the collector (the top part of the transistor) to ground.
Hope this helps. If you have any more Q's feel free to post them.
James McTavish, P.Eng
Director of Engineering
Matrix Orbital
Director of Engineering
Matrix Orbital