Maker Pro
Maker Pro

how to connect an LED to PC

Greetings,
How to connect an LED to the PCs PPI and make it glow by program?
Thanks in advance.


Ya know, this is kind of interesting.

http://www.taomc.com/bits2bots/litbit.htm

(Amazing what one can learn when trying to answer someone else's
question.)

I have a new question for the group. I don't have any LEDs lying
around, but I have a few light bulbs lying around. I know that the
data output voltage is 5V, but what is the maximum safe current to
draw? I'm guessing that, since resistors are required for the LEDs,
the current is fairly high - hundreds of milliamps, I'm guessing. But
I also wouldn't want my light bulb to fry my parallel port, if it draws
too much current.
 
So if it's 2.6 mA max (data pins to ground), are the 470-ohm resistors
still necessary? (grin)

Michael

Parallel ports are very easy to blow, that is why I suggested
experimenting with the more robust serial port.
You certainly want to buffer the output with some kind of line driver.
A 2n2222 (or similar small silicon NPN) in emitter follower will work
if you just want to keep it simple
 
Ya know, this is kind of interesting.

http://www.taomc.com/bits2bots/litbit.htm

(Amazing what one can learn when trying to answer someone else's
question.)

I have a new question for the group. I don't have any LEDs lying
around, but I have a few light bulbs lying around. I know that the
data output voltage is 5V, but what is the maximum safe current to
draw? I'm guessing that, since resistors are required for the LEDs,
the current is fairly high - hundreds of milliamps, I'm guessing. But
I also wouldn't want my light bulb to fry my parallel port, if it draws
too much current.


This circuit was loads of fun.
http://mrdarrett.googlepages.com/blinkm.bmp

I used a modified version of this: http://www.cpemma.co.uk/555pwm.html

I used it to drive a 6V light bulb (in lieu of the the motor and diode)
with a 9V battery. My 4-year-old son loved it.

Had to use an old '486, booting from a DOS disk. I tried the Porttalk
thing on my Win2k laptop
(http://www.beyondlogic.org/porttalk/porttalk.htm), with mixed results.
Simple debug scripts worked fine on Porttalk on Win2k...

on:
C:\>debug
-a100
mov dx,378
mov al,1
out dx,al
ret
(enter)
rcx
7
non.com
w
q

off:
C:\>debug
-a100
mov dx,378
mov al,0
out dx,al
ret
(enter)
rcx
7
noff.com
w
q

(now you have on.com and off.com, loads of fun.)

But a more advanced program using Turbo C++ 1.0 for DOS failed
miserably with keyboard input. (Had to use a DOS disk, booted the '486
with it, then the lights blinked like they should.)

Just curious, what would a recommended resistor value be? Is 100 ohms
good enough? Nothing seemed to get too hot with mine.

Michael
 
Greetings,
Thank you all for your reponses.I think before using the
serial the data rate has to be set and it involes some more work to be
done.Is it possible to send some data to a dummy address and connect an
led to the data bus .
Thanks .
 
E

ehsjr

Jan 1, 1970
0
So if it's 2.6 mA max (data pins to ground), are the 470-ohm resistors
still necessary? (grin)

Michael

Where's you get 470 ohms? That won't limit the current enough.

Ed
 
ehsjr said:
Where's you get 470 ohms? That won't limit the current enough.

Ed


Oh, good point. Got that from a random page on LEDs.

To limit current to 2.6 mA, I'd need 2 k-ohm, right? (R = 5V / 0.0026A)
 
E

ehsjr

Jan 1, 1970
0
Oh, good point. Got that from a random page on LEDs.

To limit current to 2.6 mA, I'd need 2 k-ohm, right? (R = 5V / 0.0026A)

Well, you need to take the LED Vf drop into account.
Assuming 1.8v for the LED, 2K would limit it to ~1.6 mA
The general case is (Vsource - Vf)/R = I

Ed
 
E

ehsjr

Jan 1, 1970
0
I posted a page on my website re: controlling a light bulb by parallel
port:
http://mrdarrett.googlepages.com/blinky

Is a 2 k-ohm resistor big enough? Should I make it larger, just to
stay on the safe side?

Coming soon: PWM motor control via parallel port.

Michael

You don't get a lot of base drive with that 2K resistor,
and yet you want to be darn sure you protect the port.

If you really intend to drive an incandescant bulb, you'd
be better off with a darlington, like a TIP120. In terms
of figuring the base resistor, you would be able to use a
4.7K. The TIP120 in your circuit with 4.7K base resistor
could drive a bulb that needs up to 1 amp.

You can use the idea embodied in the circuit with a small
transistor and drive a LED with that circuit, provided you
put a proper resistance in series with the LED.
Here's a diagram:


+9 --------------------+
|
[470]
|
[LED]
|
/c
Pin 2 -----[3.3K]---| PN2222 or similar
\e
|
Gnd -------------------+

The above will give you about 15 mA through
the LED, and limit the current drawn from
the parallel port to ~1.5 mA, worst case.

Ed
 
ehsjr said:
You don't get a lot of base drive with that 2K resistor,
and yet you want to be darn sure you protect the port.

If you really intend to drive an incandescant bulb, you'd
be better off with a darlington, like a TIP120. In terms
of figuring the base resistor, you would be able to use a
4.7K. The TIP120 in your circuit with 4.7K base resistor
could drive a bulb that needs up to 1 amp.

Ah. I was planning on driving even bigger loads than my incandescent
lamp. I drove a 1A 12V blowdryer fan with an IRF530, with the setup on
my website. My MOSFET got kinda warm - about 105 F with a heatsink.
(I used a diode and two caps as the 555 PWM circuit recommended.)

Is a 3.3k still good for an IRF530?

Thanks!

Michael
 
E

ehsjr

Jan 1, 1970
0
Ah. I was planning on driving even bigger loads than my incandescent
lamp. I drove a 1A 12V blowdryer fan with an IRF530, with the setup on
my website. My MOSFET got kinda warm - about 105 F with a heatsink.
(I used a diode and two caps as the 555 PWM circuit recommended.)

Is a 3.3k still good for an IRF530?

Thanks!

Michael

Hmmm... since you change the design with every post, I'd
recommend a "universal interface" between the parallel port
and the device driver you choose. The interface would be
there strictly to protect the parallel port, and/or to
drive low current (< 175 mA) devices directly.
You would use the output from it to control the driver
for whatever device you intend to use. A ULN2003 comes in
in a 16 pin DIP and provides 7 darlington transistors
so you can use it for 7 pins. You could use a 3.3K
resistor between each PP pin and the corresponding
input pin on the ULN2003.

With regard to your IRF530 - putting 5 volts on the
gate won't turn it all the way on. The resistor at
3.3K would be fine*, but the gate voltage is low.

* = you need very little current on the gate - except
when you need rapid turn on. But your 5 volts already
is a problem which superceeds that.

Ed
 
J

jasen

Jan 1, 1970
0
Ya know, this is kind of interesting.

http://www.taomc.com/bits2bots/litbit.htm

I was wondering what hardware PPI indicated, a web search gave little info.
(Amazing what one can learn when trying to answer someone else's
question.)

oh yeah, the parallel port is great for simple interfacing.

IIRC 11 outputs and 5 inputs.
I have a new question for the group. I don't have any LEDs lying
around, but I have a few light bulbs lying around. I know that the
data output voltage is 5V, but what is the maximum safe current to
draw?

there;s a resistor inside the port that'll limit the current you get to a
safe amount (less than 5mA), not enough to light a lamp.
I'm guessing that, since resistors are required for the LEDs,

they arenin this application they aren't.
the current is fairly high - hundreds of milliamps,

no.
 
ehsjr wrote:
....
With regard to your IRF530 - putting 5 volts on the
gate won't turn it all the way on. The resistor at
3.3K would be fine*, but the gate voltage is low.

* = you need very little current on the gate - except
when you need rapid turn on. But your 5 volts already
is a problem which superceeds that.

Ed


Gate fully open at 10VDC, then? (from reading the V_GS charts on an
IRF530 spec sheet from digikey)

Michael
 
E

ehsjr

Jan 1, 1970
0
ehsjr wrote:
...





Gate fully open at 10VDC, then? (from reading the V_GS charts on an
IRF530 spec sheet from digikey)

Michael

10V will turn it on for you to drive heavy current,
(presumably) like the motor will draw. I don't know
what "gate fully open" means - I assume you mean
turn the mosfet fully on.

Ed
 
ehsjr said:
10V will turn it on for you to drive heavy current,
(presumably) like the motor will draw. I don't know
what "gate fully open" means - I assume you mean
turn the mosfet fully on.

Ed


Ok thanks!

Michael
 
Top