Delphi... what a doubt!!!

P

Thread Starter

Paulo

I've got to design a program to school using delphi which will control some leds (low current).
Teachers told me I better use opto-couplers otherwise I'm gonna burn up my motherboard...
Well, I find it diffcult to use it since I don't even know how. Then I got to know about a buffer CI (74LS541) which may solve my problem. Is it? I mean, can I use it instead of the opto-couplers? Is it as safe as?
Please, can anyone email me? I really don't wanna get my computer useless..
 
T

Thomas Hergenhahn

In principle, it is a good idea to use optocouplers, whenever you connect something to your computer. But if all you need to control are leds, it's pointless, because you must drive the optcoupler's input led.
Where do you want to connect your leds? If you don't want to construct bus interface logic for
PCI or ISA bus, you may want to use the serail or parallel ports.
You may safely use the serial ports status lines with a total load of about 20 mA. Mice do it also. So if you connect a LED to DTR and RTS, each may draw 10 mA. Use 1.5 kilo ohms resistors in series. The lines change from -12V to +12V.
On parallel port, you have eight data output lines You could drive a LED at 5 to 10 mA with most boards. Bit if you connect 8 led's, the total output current may be too much for the prot driver. With parallel ports you can use any kind of TTL or CMOS driver chips to drive the leds. As some boards do not provide proper TTL level signals, use ICs 74HC14 or 4050. The 74LS541 is a buffer. This means it has a little memory to store the state of 8 lines. This doesn't make much sense if you connect up to 8 leds to the parallel port. You would need extra logic to generate a clock signal to tell the IC "grab the line state now". It makes sense if you want to connect multiple of them to the parallel port or 1 or more to the bus. In these cases you would need additional address decoding logic.
The drawback with ICs on parallel port is that you need an external power source for the ICs and LEDs. Use 5V, not more, to minimize the risk to damage your board. Further there can be a risk of damage, if your external power is on but your computer not. In this case, a current may flow back into the computer.
The 4050 uses very little input current. Hence you can connect large resistors in series (10 to 100 kiloohms). These will protect the port from backward current.
_______ 560 Ohms
100k__ I I ___
Port--I__I-I 4050 I---I___I-LED-
I______I

If you need more information contact:
[email protected]
 
K

kalpak dabir

assuming you are using the parallel port, no need for any buffering if you control the LED current to less than 2 mA, only make sure you connect the LED such that when o/p of port pin is low the LED will glow, that is use the o/p in sinking mode. If you want a good brightness, then ls541 or 244 will do , better to use an open collector TTL buffer like 7407 or 06. Optos are preferred because of their isolation between i/p and o/p, especially when the applied voltage or load is unknown or far away from the system or inductive load like a relay. look up a good book like the one by Douglas Hall.
 
Paulo:
> I've got to design a program to school using delphi which will control
> some leds (low current). Teachers told me I better use opto-couplers
> otherwise I'm gonna burn up my motherboard...

Hmm, considering opto-couplers are just leds, there's obviously something more there.

- instructive: the leds are just a demonstration load, and the
teachers want you to know how to do a proper opto-isol.
- lead length / placement: the leds are placed in an area where
shorting to high voltage is conceivable.
- ignorance: you have to use opto-isol because That's How It's Done.
- all of the above

> Well, I find it diffcult to use it since I don't even know how.

Read up the documents on the opto-isolators. One side will look like a LED, wire that up to the computer output like a LED. The other will look
like a transistor (with no base), wire that up into whatever you're controlling as though it were a transistor.

> Then I got to know about a buffer CI (74LS541) which may solve my
> problem. Is it? I mean, can I use it instead of the opto-couplers?

I don't remember the part numbers, but if it's a buffer, then no. It doesn't do the `isolation' part of `opto-isolation'. A proper opto-isol
has an air gap between the two halves of the circuit, and can insulate several thousand volts (500V if it's a really small one).

HTH - HAND

Jiri
--
Jiri Baum <[email protected]> http://www.csse.monash.edu.au/~jirib
MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools
 
R

Ralph Mackiewicz

I doubt you need optical isolation to drive LEDs. If you have a few bucks to spend, buy a digital I/O board and just wire some LEDs to the outputs. Measurement Computing sells one for US$89:

"http://www.measurementcomputing.com...=821&mscssid=3TL6K5KNABUG8K0XKC7QKRHW65GB9G6E":http://www.measurementcomputing.com...=821&mscssid=3TL6K5KNABUG8K0XKC7QKRHW65GB9G6E

I think your motherboard will be safe driving LEDs from this board. You shouldn't need optical isolation unless you are going to drive large, inductive or noisy loads like a motor or large relays/solenoids. If the purpose is to learn software, not how to wire TTL circuits into a motherboard (more likely to damage it than
an LED), and you have some spare change this would suit your purpose better. Maybe find one cheaper on eBay even.

Regards,
Ralph Mackiewicz
SISCO, Inc.
 
Top