How do I? I want to use a personal computer to switch 2.5 V Christmas
bulbs on and off, individually. First, let me state: I have a very
crudimentary knowledge of electronics and an in-depth knowledge of
computer programming (of some kinds).
I understand there are "microcontrollers" and probably other kinds of
devices which are programmable. I know a computer must be capable of
turning on and off hundreds or thousands of switches. I'd prefer not to
break into my computer but to use an external i/o such as a USB port.
But I want it to control hundreds or thousands of light bulbs,
individually.
First, did you realize some numbers: A thousend LEDs using 20mA each (a
common current for LEDs) require 20A of current and at 2.5V they will
produce 50W of heat? You can of course lower the current or use some kind of
matrix control (multiplexing) but at the cost of the amount of light. Most
LEDs function well enough with less then 20mA. As an alternative you may
look at low power LEDs.
To address 1024 LEDs you require 128 pieces of 8 bits registers. One
approach is using shiftregisters. The MC74HC595 for instance can do the job.
As it can provide enough current, you need only one resistor/LED. So you
will have 128 registers in series, shift in the 1024 bits and active the
latchclock pins to store the bits. You can use for pins of the parallel
output port to control data-in, shiftclock, latchclock and reset. You will
have to buffer the clocks and the reset as one output will not easily drive
128 inputs. Drawback: To change one LED you have to reload all the others as
well. You also may consider to make two strings of 64 shiftregisters and
control them simultaneously with the 8 bits output pins of the parallel
port.
To address the LEDS immediately you can use 128 pieces of 74HCT374. Also
able to provide enough current to the LEDs. But you will need an address
register and a 1 out of 128 address decoder (plus some gating) to access
them.
To avoid the huge amount of hardware, you can go multiplexing. This requires
microcontrollers otherwise the amount of standard logic required will become
enormous. As an example, a PIC16F628 can control up to 40 LEDs and can be
controlled by a serial interface using the on board UART. Drawbacks: You
will need some buffering for the rows (or columns) that have to sink the
current of eight LEDS and you loose brightness due to the relative short
time the LEDs are powered. A great deal of the software can be left to the
micro but you'll have to write it. You can build - let's say - 32 LEDs units
around the micro and make a protocol to controll them. Each unit will need
it's own address which can be stored in EEPROM.
petrus bitbyter