1. Parts |
You need at least:
|
2. Preparing the Connector |
We use the printerport for our circuit and so we have to make
the computer believe, that there is a printer at the end of the line,
which is switched on and ready to print: We connect the /Ackn-, Busy-
and Paper-empty-line to GND. Printer-ready and /Error are connected to
Vcc. Click here for information
about the parallel port. Vcc has to be rather exactly 5 volts.(4.75-4.25) Higher voltages may damage your printer-port. The simplest way to get a 5-volt-source is to use a LM7805. ![]() |
3. Connecting the LEDs |
![]() Transistor: Tested with BC 547B, but you can use any transistor with rather similar properies: NPN, Ic(max): 100mA, Uce(max):45V, P(max)=500mW, b:250-400 The circuit without the connector and the leds is so small, that you can put it into a matchbox. The simplest way to connect the LEDs is: ![]() |
4. Software |
The software to use the lights is very simple: If you want to switch on only the first red Led R1, you have to send the value 1 to the printer. (Only the LSB=Data0 is set) If you send 6 to the printer, the O1 and the G1 Led is switched on... traffic.zip contains a simple C-programm(dos) to simulate a traffic-light. You may also want to control the lights from java which is possible (with linux) using the PortTest application from project 7 (manual control) or the project 7 together with the TrafficLightAdapter from project 32. |
5. Extending the Circuit |
There are much more possibilities to use the circuit if one uses relais instead
of LEDs. The advantages are:
![]() Diode: 1N4148 U(max): 150V I(max)=100mA Circuit can also be used for switch on/off the lights in your room/around your house, control the electrical heaters,... |
Contact: e-mail: me (%) halfdog.net Last updated: 15.07.2005 |