PDA

View Full Version : Elementary question on electronics



aVaTar
01-26-2011, 01:56 AM
Hi guys,

I'm trying to build a breakout board for OC Mastercard. I need to light up pairs of LEDs and the way I figured to do it was to use a simple transistor driver per output.

This is my first try out of self designed electronics, and I just wanted someone with knowledge to approve the design :)
4743

Basically, I'm a bit confused as to existence of 2 grounds - one from mastercard and one I want to connect to the board.
Correct me if I'm wrong but I can't use mastercard's ground for LEDs cause that will cause LED current to flow through the chip and not the board.

On the picture is one driver, I'll have 38 of them, all emitters connected to common ground.

Also, do I need to connect master card ground to ground on the board? It's one power supply...

fordgt40
01-26-2011, 05:28 AM
Hi

I cannot comment on the circuit, but have you tried actually running the leds off the mastercard output? On my MIP and a number of other panels I have two leds wired in parallel and they work fine. People say that you should not do this, but I find that if the leds are of the same spec and you determine a resistor size by using a multimeter to limit the current to the mastercard max capacity of 20ma, then all is ok. Admittedly, the light output will be down, but I needed two leds to get the light spread on annunciators - so could sacrifice some light output.

David

RadarBob
01-26-2011, 05:32 AM
This will work ok if you connect your ground, the OC ground on pin 2 and common psu ground together.

Rather than connect your ground to Pin 2, I would run a separate ground wire back to the same psu -ve terminal that your Master is supplied from.

That way there is no danger of exceding the current carrying capacity of the PCB track, if your ground becomes disconnected, and the led current returns via the PCB.

The +5V rail doesn't need to be the same one that powers the Master - Just need to make sure that the ground reference is the same.

Drive current will flow from the chip on the master via your resistor through the transistor base and then return to the common ground.

Transistor will turn on and pull the bottom end of your led/resistor combination towards ground, with the (much higher) led current again returning to common ground psu terminal.

Rather than discrete transistors you could use a chip with an array of transistors in such as ULN2003 - Inputs of the chip are TTL compatible - So you don't need a resistor (in fact, it's built-in). Will drive a load up to 500mA per output as well.

Try a search for the datasheet.


Best Regards,

Rob

aVaTar
01-26-2011, 05:56 AM
On my MIP and a number of other panels I have two leds wired in parallel and they work fine
That probably would work but I have 2 LEDs in a serial connection so will have to drive em from 5 volts source.



This will work ok if you connect your ground, the OC ground on pin 2 and common psu ground together.

Rather than connect your ground to Pin 2, I would run a separate ground wire back to the same psu -ve terminal that your Master is supplied from.

That way there is no danger of exceding the current carrying capacity of the PCB track, if your ground becomes disconnected, and the led current returns via the PCB.

The +5V rail doesn't need to be the same one that powers the Master - Just need to make sure that the ground reference is the same.

Drive current will flow from the chip on the master via your resistor through the transistor base and then return to the common ground.

Transistor will turn on and pull the bottom end of your led/resistor combination towards ground, with the (much higher) led current again returning to common ground psu terminal.

Rather than discrete transistors you could use a chip with an array of transistors in such as ULN2003 - Inputs of the chip are TTL compatible - So you don't need a resistor (in fact, it's built-in). Will drive a load up to 500mA per output as well.

Try a search for the datasheet.


Best Regards,

Rob

Ah man, that's nice. I was pulling my hair out with all those 40 transistors and 80 resistors and arranging them on a PCB (Autoplacer just doesn't cope). So I just need a few ULN2003 + LED Resistors and that's all.
Thanks for clearing out what to do with the ground. I guess the best approach is to just have a connector with +5 and Gnd going back to the same PSU

RadarBob
01-26-2011, 06:55 AM
Yes, separate cable back to the PSU sounds good.

You could actually use a PSU of a different voltage for indicator supply if you wanted - Provided that you keep all the grounds connected together.
-In case you also wanted to drive incandescent lamps such as a korry indicators off 24V for example.

Cheers,

Rob

aVaTar
01-27-2011, 02:06 AM
Thanks for explaining Rob! Much appreciated!

aVaTar
03-07-2011, 05:57 PM
Hi again, guys. So... I finally built a darlingtoin arrays based breakout board for driving my LEDs, but what I didn't take into account is the voltage drop across each darlington pair(I use ULN2803s) and as a result the green LED pair is barely lit at all. When going straight into +5 supply it's fine...
I figured I need to bump the voltage a bit. As I initially intended to use a PSU, I thought I could use the 7 volts trick (+12 and +5(as GND)) to get the 7v difference in potential. But this means that +5 rails acts as ground and sinks current, which migth work as far as PSU is concerned but will not work if connecting mastercard to (+5, GND) and Breakout Board to (+12, +5) as +5 Rail will short directly onto GND :shock: .

So in short if I want to use 2 different PSUs, how should I go about connecting them? Is common GND essential(e.g. when GND from PSU1 is wired to GND from PSU2) or is it a general recommendation but not a necessity? Also maybe there's still an easy way to make +5 into +7?

Maybe someone has an advice for a simple and cheap step-up converter?

How about this one for instance: http://cgi.ebay.com/Tiny-Step-Up-PWM-Converter-2-9-5V-5-15V-OUT-12W-/170593777304?pt=LH_DefaultDomain_0&hash=item27b82e7698

Will it do the trick or am I better off with a separate PSU (say 7v or 6 if I can find one) do drive outputs?

RadarBob
03-07-2011, 08:39 PM
Ah yes, there is about 1V saturation voltage drop on those drivers when they are turned on - So you have only 4V available.

You could probably do away with the led resistor if you run two leds in series - The led will only draw excessive current and be damaged if it has in excess of the maximum forward voltage across it. The resistor is only there to drop the difference between supply voltage, and the required operating voltage (which is less the VFmax) to prevent this from happening.

Check the max forward voltage (VFmax) of the leds you are using - Varies widely according to type: 'standard' is probably about 2.5-3V whereas 'hi-brite white' could be 4-5V. This way though, you don't have the 'headroom' to adjust your light levels if you need to balance up the indicators with others in your setup - Unless you find that you get lots of light with no resistor - In which case you can always introduce some.

The datasheet will usually give you typical operating voltage (VFTyp) and for the led and also quote a light output for a given typical forward current - So as a starting point, I would select a resistor value that will drop the difference between supply and VFTyp at this typical forward current.

I don't like the sound of the +5/12V trick though - Not good practice.

Although you could make it work if you use power supplies that are fully floating - That is to say, 0V is not Gnd - So, in your example, if you used separate floating PSU's for the +5/+12V to the +5V used for the master supply, there would be no problem connecting +5V to 0V.

If the master supply 0V was also Gnd, then the 0V of your floating +5/+12v would effectively become -5V with respect to Gnd, and your +12V would become 12V above that or +7V - But you have to be careful of your references,and I would advise against it.

If it were me, I would either wire my leds in parallel (if I had to use 5V) - Or use a separate PSU of the next 'standard' and readily available voltage - Which could be +12V.

However, my logic would run along the lines of: I want to standardise on a voltage for indicators, and I might want to use some original parts possibly having incandescent lamps (e.g. Korries) - So I would go with close to what is used on the A/C, pick 24V and calculate a new resistor value.

Hope this helps - Just my thoughts on the matter

Cheers,

Rob

aVaTar
03-07-2011, 09:02 PM
Thanks for your input Rob!
Unfortunately I did the job before thinking it through completely: the LEDs are already wired up in a series, glued then painted. In some cases("six pack" indicators for instance, I can't access them at all anymore - it's all sealed and soldered...:) )

I agree in regards to the 7V hack, too much risk in getting the reference voltages wrong somewhere...

The output voltage is not enough even without resistor. The problem is with different types of LEDs. Orange once are OK, but Green ones are barely lit :(
Not sure what will be with blues.
Another option is to step up with voltage to +12v, but then resistors are going to dissipate a lot of power: say (12 - 5)v * 20ma = 0.14W per LED pair, times 40 and it is 5.6 watts per output board at least.

Rob, do you think it is a tolerable number and I should just go that way? - it's simple - just needs resistors.
Otherwise, what do you think about the step-up converter option? - Also relatively simple, needs resistors + $10 for converter. On the bright side - improved efficiency?
Other than that I could just use a ready-made PSU, but it will probably cost more(locally) than a converter from ebay and might not be as flexible with voltages

RadarBob
03-08-2011, 03:53 AM
All understood - There is quite a difference between led colours - Blue and white are generally a bit heavier on current/voltage I think.

Yes, 12 or 24V with suitable resistors would be fine. Typical standard resistor is about 0.3W, so no problem there. As you say, there will be some wasted power but 6W is no big deal IMO.

I wouldn't bother with the converter option - I would have thought that efficiency would actually be worse?

I would use a ready made PSU. A lot of folks use computer type PSUs I think - Just need to connect one wire (Green I think) to 0V to get it to power up.

Cheers,

Rob

aVaTar
03-09-2011, 11:41 PM
Actually, the converter would be more efficient, since it transfers(converts) 90% of power whereas resistors would transfer only 40%.
But as you said 6W is not that much, so for simplicity's sake I'll just use 12v supply
Thanks for your help Rob!

Leo Bodnar
03-10-2011, 03:11 PM
The most efficient would be boost LED current controller but it is probably a waste of effort to control just a few LEDs.
I am not sure they are made in anything larger then SOT or SOIC sized packages.

aVaTar
03-10-2011, 03:47 PM
The most efficient would be boost LED current controller but it is probably a waste of effort to control just a few LEDs.
I am not sure they are made in anything larger then SOT or SOIC sized packages.

Do you mean PWM base driver? I planned to use one for brightness control on the back-lighting LEDs by pluging it into the +12 Bus for the whole MIP.

Leo Bodnar
03-10-2011, 04:54 PM
It's similar to DC-DC converter but instead of regulating voltage it regulates current. There are buck and boost varieties. Efficiency is usually 85-95%. There are literally hundreds of them. Here is a random pick from the ones I have personally used.
http://www.fairchildsemi.com/ds/FA%2FFAN5331.pdf
R1 and R2 are actually for current measurement - they dissipate almost nothing so 0.125W is fine. Overall efficiency is about 90%.