News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Star Trek lights

Started by thomas_remkus, October 22, 2008, 03:18:27 PM

Previous topic - Next topic

thomas_remkus

I stayed up late last night and was watching some pretty cool old sci-fi movies. I love all those old lights that blink that supposedly mean something. I was thinking this morning about that and was thinking on taking a COM port cable and cutting off one end. Then taking those wires and hook up some resisters and LEDs. Has anyone done this? There must be a configuration that's possible to get a simple configuration without having to resort to some UART-something to get plenty of lights.

I'm just looking for thoughts from people and advice. I thought COM over Printer port because of the ease to get COM cables (uh, I have plenty) and I might use that printer port.

-thomas

FORTRANS

QuoteI was thinking this morning about that and was thinking on taking a COM port cable and cutting off one end. Then taking those wires and hook up some resisters and LEDs. Has anyone done this? There must be a configuration that's possible to get a simple configuration without having to resort to some UART-something to get plenty of lights.

Hi,


   You can get a breakout box or LED box that is used to diagnose
serial port problems.  They just plug into the RS-232 port or cable
and have LED's for many of the signals.  That would save you the
cutting and soldering at least.

http://www.bb-elec.com/bb-elec/literature/manuals/m232bob.pdf

  Humph, apparently not as popular as they used to be, Google is
being difficult.

Regards,

Steve N.

Roger

Hi Thomas,

I just tried my serial breakout card on my serial link and you would find the results disappointing.

It has 16 LEDs one each way on 8 lines, the 9th line is ground. Only 1 lid lit up with a barely visible flicker on two others.

Part of the problem is that there are only 2 really active lines -Tx and Rx, the other 6 are control lines which may or may not be used depending on the particular set up. Most systems now tend to do the handshaking in software and the lines are unused.

The other snag is that the data speed is high enough that the LEDs are to fast to be seen switch on and off. 

The parallel port will give you 8 output lines which are easier to control at low speed.

I have seen circuits and simple software (for DOS) on various sites on the internet.

Regards Roger

P1

You would done better with a parallel cable.  8 Lines of logic, latchable until the data changes.

Regards,  P1   :8)

thomas_remkus

the printer cable does sound interesting now that i have some feedback. a barely visible flicker is not very interesting. having feedback that I have a new email or that an operation is complete would be better. led should stay on or stay off and not just flash. if anyone has any additional pointer just let me know.

FORTRANS

Hi,

   Well the breakout box I had/have had stable and
visible LED's.  You could make the transmission
line flicker by transmitting some data at a low baud
rate.  The status lines would require a loop of some
sort to toggle.  The real problem is that the inputs
need a second serial port to drive.  And the nine pin
RS-232 ports lack some lines.

   As P1 says, the parallel port has eight data lines
and some status lines as well.

   But use what you have, it is fun to play with a
breakout box.

Cheers,

Steve

P.S.  There are the keyboard LED's to play with for
the observant.  I tend to ignore them.

Mark Jones

I would avoid using the serial port. There are only a few pins available, and their semantics are kinda complicated.

If you are gonna connect anything to the parallel port, do yourself a favor and buy a $10 PCI parallel port card and stick that in the computer and wire things up to THAT port. This way, if something goes poof, the computer's built-in port won't be fried (which cannot be repaired.)

LED's are really diodes, ("Light-emitting diode") and thus drop a little voltage like all diodes but otherwise act as a short when illuminated. What this means is that each LED needs a resistor connected to it to limit the current and keep it from otherwise burning up.

A parallel port is only used to send signals, and thus is not designed to provide enough power to light up LEDs. One LED typically consumes around 10 mA of current (0.010A) for a decent brightness, and most LPT ports can source or sink around 1 to 5mA per output pin. Thus, something needs to be added which can "drive" the LEDs to adequate brightness. Many chips can do this, but one of the simplest is the 7404 quad hex inverter. The 74* series of chips are compatible with the standard parallel port, and 6 inverters are present in one package. (Two chips will need to be used, one completely and two inverters from the second chip.)

i.e.,


                 +5v
                  O
               .--+--.
               |  |  |
               |  |  |
               V  V  V -> LED1-8
               -  -  - ->
               |  |  |
               |  |  |
              .-..-..-.
              | || || | R1-8
              | || || | 470 ohms
              '-''-''-'
LPT     |\     |  |  |
Out O---| >O---'  |  |
1       |/        |  |
                  |  |
        |\        |  |
2   O---| >O------'  |
        |/           |
                     |
        |\           |
3   O---| >O---------'
        |/

        4704 Quad Hex Inverter x2
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)


If you follow the logic here, when the parallel port's first output pin is set to 0 or low, the inverter connected to it is going to output a 1 or high state (+5v). Since this output is connected to the first resistor and diode, and this terminates at a +5v source, then no current flows because there is no difference in voltage. (+5v on one end, +5v on the other = same potential = zero current flow.) Thus, a logical LOW on that pin makes the LED be OFF.

Flip that bit to a 1, and the port pin goes high, and the inverter outputs a low or 0v reference. This then allows current to flow from the +5v, through the diode (illuminating it) and through the resistor. How much current is flowing through a lit LED? If the diode drops 0.7v, then 5.0v-0.7v = 4.3v is being dropped across the resistor. If we know the resistor is 470 ohms, then Ohm's Law tells us that I=E/R, or the current in that LED and resistor will be 4.3v/470 ohms = 0.00915 or 9.2mA. That should be plenty bright, but 330-ohm or even 270-ohm resistors could be used also.

For a design like this, you'll also need a small power source providing a regulated +5v @ 100mA or so. One last caveat: all unused digital input pins MUST be tied to ground. (This means, the four unused inputs in the second 7404 must be connected to 0v.)

Specific Example:   http://www.hardwaresecrets.com/article/233/1
Cheap components:   http://www.allelectronics.com/
Complete AS-equivalent in electronics:   http://www.ibiblio.org/kuphaldt/electricCircuits/
Interested in flashing more than 8? Google for LPT LED Matrix:   http://www.google.com/search?q=parallel+port+matrix+LED
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

dsouza123

Perhaps this product. $16

It connects to a 9 pin serial on the PC end, and uses mini USB for the device.
What level of control isn't specified but there is an application CD + manual.

9" Programmable Scrolling Red LED Sign

http://www.geeks.com/details.asp?invtid=RED-9IN-LEDSIGN&cat=GDT

Features/Specifications:
9-inch Programmable Scrolling Red LED Sign

---General Features:
Display your own message
Stores up to 4 messages (up to 120 characters, number of character types up to 60)
Adjustable scroll speed
Adjustable brightness
Onboard programming buttons: enter on/off, page up, page down
On/off switch
Mini USB port
Handle for handheld use 
Fold-out rack for tabletop use
Built-in rechargeable battery
Includes a USB to 9-pin serial cable for PC connection

---Unit Dimensions:
9 x 2.25 x 0.5-inches (L x W x H, approximate)

---Package Includes:
9-inch Programmable Scrolling Red LED Sign
AC power adapter (100 - 240V, 50/60Hz)
3-inch type Application CD
User Manual
USB to 9-pin serial cable

thomas_remkus

OK. I think I'm getting on the right track here. Mark, your comments and help are very appreciated and I think I'm going to start with one of the projects that is outlined on one of the links I explored to. I've always loved thinking about controlling my lights or fans or something with my computer and I think this is a good step in that direction. With the need for quiet in my house I eventually want to create something that will take the signal from the phone when it rings and turn on a string of Christmas lights.

For this I'm going to need to d/l some driver software and get some equipment. A "bread board" and other stuff. Thanks for the links to the electronics and fundamentals. Those references are going to come in handy! If you have any more tips or links you can send them over to me (private message if you'd like). I'm headed over to my local electronics store for some materials. I'm guessing $30 should cover all my costs. Some of this makes me ....  :dazzled: .... but I'm good with that. I might have to ask some questions of you Mark if I get really stuck.

BlackVortex

Hehe, this is interesting and geekawesome !  With all the knowledgeable ppl in this forum, maybe there would be enough content to justify a "Hardware Control" subsection, for programs/experiments/guides about controlling PC and other hardware.


Mark Jones

That's an interesting idea BV. There have been many posts over the years about "how do I control the parallel/serial port in Win NT/2k/XP?" These types of posts would definitely fall in that category.

I think that generally however, Hutch (and indeed the industry in general) has maintained a distinction between software programming and hardware. As soon as this line is crossed, it can no longer be seen as "programming."

What I really find exciting are flash-programmable chips like the PIC and AVR microcontrollers. They are basically tiny CPUs with small instruction sets (20 instructions or so), yet run up to a blistering 50 MIPS! These have program memory, RAM, interrupts, registers, etc. The design possibilities are almost endless, and of course working with these hybrid devices involves both Analog and Digital electronics disciplines. But this also involves a strong assembly-language discipline. Because of the amount of knowledge required however, microcontroller application engineering is a rather uncommon topic for discussion.

I would be open to such discussion, but there simply may not be enough traffic to warrant a sub-forum dedicated to it.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

FORTRANS

Hello,

QuoteThere have been many posts over the years about "how do I control the parallel/serial port in Win NT/2k/XP?" These types of posts would definitely fall in that category.

   Heck, you even have some in the 16-bit forum.

http://www.masm32.com/board/index.php?topic=9763.15

There seems to be a lot of interesting posts scattered all throughout
this forum.  Thanks again Hutch.  If you come across a few man-years
of time, you could index it.  <g>

Cheers,

Steve N.

Regards,

vanjast

Take note that a LEDs volt drop varies with the amount of current as well as the colour (varying from 1.8V to 3.2V for normal operation).

Also with driving a lot of LEDs from a single driver chip - consult the driver chip datasheet for the maximum allowable ground and supply currents - If this is exceded... pop goes the chip.
:8)

nuckfuts

And if you do run switches/amps after the port, you're not limited to LEDs.  My friend Leif did a christmas tree a few years ago with 10 strings of lights switched by parallel, and drive by an algorithm that detected 10 different aspects of the music, and blinked the strings on/off to them.

Unfortunately nobody thought to get any video of it, but it was mind blowingly awesome looking, and fully automatic.  Lol, the tree could barely stand the weight of the lights.