0% found this document useful (0 votes)
153 views1 page

Led Driving Using Parellel Port - Colour

This document describes how to create a simple circuit to drive LEDs using a computer's parallel port. The circuit connects an LED and resistor in series to each of the parallel port's data pins. Sending a 1 to a data pin turns the connected LED on, while a 0 turns it off. Software can control the eight LEDs independently by outputting values to the different data pins. Sample C code is provided to output values and turn the LEDs on and off. Photos show examples of circuits built according to the described design.

Uploaded by

api-3744897
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
153 views1 page

Led Driving Using Parellel Port - Colour

This document describes how to create a simple circuit to drive LEDs using a computer's parallel port. The circuit connects an LED and resistor in series to each of the parallel port's data pins. Sending a 1 to a data pin turns the connected LED on, while a 0 turns it off. Software can control the eight LEDs independently by outputting values to the different data pins. Sample C code is provided to output values and turn the LEDs on and off. Photos show examples of circuits built according to the described design.

Uploaded by

api-3744897
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

LED DRIVING USING PARELLEL PORT

Simple LED driving circuits


You can make simple circuit for driving a small led through PC
parallel port. The only components needed are one LED and one 470 ohm resistors. You
simply connect the diode and resistor in series. The resistors is needed to limit the
current taken from parallel port to a value which light up acceptably normal LEDs and is
still safe value (not overloading the parallel port chip). In practical case the output
current will be few milliampres for the LED, which will cause a typical LED to somewhat
light up visibly, but not get the full brigtness.

Then you connect the circuit to the parallel port so that one end of the circuit goes
to one data pin (that one you with to use for controlling that LED) and another one
goes to any of the ground pins. Be sure to fit the circuit so that the LED positive
lead (the longer one) goes to the datapin. If you put
the led in the wrong way, it will not light in any
condition. You can connect one circuit to each of the
parallel port data pins. In this way you get eight
software controllable LEDs.

The software controlling is easy. When you send out 1


to the datapin where the
LED is connected, that LED
will light. When you send 0
to that same pin, the LED
will no longer light.

Here are two photos of


circuit above I have built:

Pn those circuits I have wired the ground wire


only to one ground pin (it works also well, you can use any of the ground pins).

Here is the C program to on/off position of LED; n=1 for on, n=0 for off.

#include <stdio.h>
#include <dos.h>
#include <conio.h>
/********************************************/
/*This program set the parallel port outputs*/
/********************************************/
void main (void)
{
clrscr(); /* clear screen */
outportb(0x378,n); /* output the data to parallel port *///(0xff)
getch(); /* wait for keypress before exiting */
}
Article by Malay Majithia Ist IT, LDCE
[email protected]

You might also like