# LED driver type application: want to control Christmas lights

O

#### [email protected]

Jan 1, 1970
0
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.

H

#### HKJ

Jan 1, 1970
0
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.

A computer might be capable of that, but it might be cheaper to use many
microcontrollers, each with a few (10-50 depending on design) lamps and
then link them together on a bus (RS485) that is controlled from a PC.

Then the PC can send commands to each controller or to groups of
controllers. Storing preprogrammet patterens in the controllers it is
possible to make coordinatet effects on 1000's of lamps.

H

#### Homer J Simpson

Jan 1, 1970
0
But I want it to control hundreds or thousands of light bulbs,
individually.

Holy crap! That's a hell of a wiring job. Why?

O

#### [email protected]

Jan 1, 1970
0
Homer J Simpson wrote:
..
Holy crap! That's a hell of a wiring job. Why?

I know; I have to wire each lightbulb with its own circuit. But I want
to do it to create marvelous effects!

O

#### [email protected]

Jan 1, 1970
0
HKJ said:
A computer might be capable of that, but it might be cheaper to use many
microcontrollers, each with a few (10-50 depending on design) lamps and
then link them together on a bus (RS485) that is controlled from a PC.

Then the PC can send commands to each controller or to groups of
controllers. Storing preprogrammet patterens in the controllers it is
possible to make coordinatet effects on 1000's of lamps.

Thanks for your response. I see I might have to build a stack or
hierarchy of controllers. But first I'm going to have to learn what
controllers I can use and how to link them to my PC. I have a minimal
knowledge of electricity/electronics; however many times I have to
review the basics (components, E=IR, voltage drop across one component
is the determiner of what's happening in the rest of the circuit,
etc.), which I have to do every time I start thinking seriously about
an electronics project, I still need to do it each time. I think I'll
look into tutorials on microcontrollers and any similar devices.

Right now, I'm guessing that each bulb has to be controlled by a
transistor and its supporting components (one or more resistors, etc.)
I guess this transistor has to handle 2.5 volts, as to the circuit it
turns on and off, and be operable on whatever voltage/amperage matches
some kind of connection into some kind of pin on a microcontroller or
other chip-based device. So I might have to build a little circuit for
each bulb, plus hook each bulb-circuit into a controller. Is that a
good theory, so far? Yes, I have to do more research/ask more questions!

H

#### Homer J Simpson

Jan 1, 1970
0
I know; I have to wire each lightbulb with its own circuit. But I want
to do it to create marvelous effects!

Design back from the array and find a way to address the leds with minimum
circuitry. In a square array of 10,000 say, you only need 100 * 100 wires if
you switch both anodes and cathodes.

H

#### HKJ

Jan 1, 1970
0
Right now, I'm guessing that each bulb has to be controlled by a
transistor and its supporting components (one or more resistors, etc.)

If your are using LED's and a microcontroller like Atmel ATmega48, your
can have maybe 15 LED's connected with only a resitor for each. The
microcontroller will also need a RS485 interface and a xtal. This is a
very simple schematic.

Here is a schematic for one I did som years ago:
http://hjem.get2net.dk/hkj/Flasher.png
And some photos:
http://hjem.get2net.dk/hkj/FlasherComponent.png
http://hjem.get2net.dk/hkj/FlasherLed.png
The microcontroller I used is obsolente today and the interface is not

Remark: If your want to place all the lamps very close together, some
sort of matrix is a better way to do it.

For helping with ohms law and other electronic calculations, your might
try this program:
http://www.miscel.dk/MiscEl/miscel.html

E

#### ehsjr

Jan 1, 1970
0
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.

requirements will get real ugly, in a hurry. What is the
current required to light one of these bulbs? Multiply that
by the number of bulbs you intend to control. Ignoring
inrush current (when the filament is cold the bulb will
draw many times the current it draws when hot), your supply
will need to be capable of delivering at least that much
current.

Ed

J

#### John Fields

Jan 1, 1970
0
Design back from the array and find a way to address the leds with minimum
circuitry. In a square array of 10,000 say, you only need 100 * 100 wires if
you switch both anodes and cathodes.

---
The problem with that method is that while any single pixel is
addressable (with the inconvenience of 10,000:1 multiplexing)
multiple pixels are not, without interference, depending on the
pattern.

Consider, for instance, a simple 4X4 array with rows A,B,C,D and
columns 1,2,3,4.

The upper right hand corner will contain LEDs A3,A4,B3, and B4, and
if you try to turn on A3 and B4 simultaneously, you'll also wind up
turning on A4 and B3.

H

#### Homer J Simpson

Jan 1, 1970
0
The problem with that method is that while any single pixel is
addressable (with the inconvenience of 10,000:1 multiplexing)
multiple pixels are not, without interference, depending on the
pattern.

Consider, for instance, a simple 4X4 array with rows A,B,C,D and
columns 1,2,3,4.

The upper right hand corner will contain LEDs A3,A4,B3, and B4, and
if you try to turn on A3 and B4 simultaneously, you'll also wind up
turning on A4 and B3.

That's where the fun comes in! Obviously you'll need to do some strobing
anyway. However any project that requires that much wiring is going to be a
PITA unless you carefully think it through.

J

#### James Thompson

Jan 1, 1970
0
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.
I think what you are wanting to do is treat the bulbs as a big memory
matrix, and in that you may look into a static memory controller. The bulbs
will be the bits in the array. Each bulb will need a set/reset flip flop to
light it or turn it off. Then you will just need to send the pattern from
you pc to the crude latch board to set what lights are on and then send the
next pattern to load it. Research into older static memory controllers. You
may have a big project on you hands. my 2c worth. JTT

P

#### petrus bitbyter

Jan 1, 1970
0
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

S

#### Si Ballenger

Jan 1, 1970
0
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.

The below link is for a DIY setup to control 320 strings of
christmas lights from the parallel port.

O

#### [email protected]

Jan 1, 1970
0
Si said:

Actually, I wanted to post this response at the top level for this
topic, not as an indented reply, here. I can't see how to do that using
Google groups, yet. Each reply seems to have to be indented below
someone else's. ANYWAY:

I am only beginning to digest the respones, so far. I certainly
appreciate all the input! I have to allocate my time carefully and at
the moment am only managing this reply, which is very general...

As to concerns about all the current drawn and the heat...well, normal
strings of Christmas lights, with hundreds of bulbs, work fine on
household current and produce an acceptable level of heat. But
modifying all the wiring for what I want to do could raise new concerns
about amperage and heat, I suppose.

I appreciate all the input about various controllers, flip-flops, etc.,
including suggestions that some older devices may be most suitable. And
I appreciate links to educational sites and sites with existing
cicuitry that is similar. Especially, Si Ballenger 's link to the
"Computer Christmas" site with the system using parallel ports looks
awfully close to what I'm trying to do.

Thanks, all, and I have lots of digesting to do!

H

#### Homer J Simpson

Jan 1, 1970
0
As to concerns about all the current drawn and the heat...well, normal
strings of Christmas lights, with hundreds of bulbs, work fine on
household current and produce an acceptable level of heat. But
modifying all the wiring for what I want to do could raise new concerns
about amperage and heat, I suppose.

Didn't the guy who did that display last year post info on how to do it?
Looks like it's gone now.

http://www.wonderlandchristmas.com/wizardsofwinter.php

http://www.snopes.com/photos/arts/xmaslights.asp

E

#### ehsjr

Jan 1, 1970
0
Actually, I wanted to post this response at the top level for this
topic, not as an indented reply, here. I can't see how to do that using
Google groups, yet. Each reply seems to have to be indented below
someone else's. ANYWAY:

I am only beginning to digest the respones, so far. I certainly
appreciate all the input! I have to allocate my time carefully and at
the moment am only managing this reply, which is very general...

As to concerns about all the current drawn and the heat...well, normal
strings of Christmas lights, with hundreds of bulbs, work fine on
household current and produce an acceptable level of heat. But
modifying all the wiring for what I want to do could raise new concerns
about amperage and heat, I suppose.

Don't suppose. It is a *painful* fact. If you insist on
using thousands of individually controlled Christmas light
*bulbs*, you may find that you need 100 or 200 mA per bulb,
and your supply will need to be 200 to 400 amps *mimimum*,
to operate 2000 bulbs.
A string of bulbs in series needs a whole bunch less current
than the same number of bulbs, individually controlled.
For example, 50 bulbs in series in a Christmas bulb string
will need the same amount of current as one of those bulbs,
individually. If you intend to control 50 of them individually,
you will need a power supply that provides 50 times the current
that the whole string uses.

Ed

B

#### Bill Bowden

Jan 1, 1970
0
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.

Well, you may have a problem with thousands of Xmas lights since each
on requires about 150mA of current, so you need about 150 amps for 1000
lights all on at the same time.

I have a scaled down version I use at Christmas that controls 32 lights
from the serial port, but you can expand it by adding additional
74HC164 shift registers. The drawings showing the basic hookup for 16
lights is at:

http://ourworld.compuserve.com/homepages/Bill_Bowden/page3.htm#spr

-Bill

J

#### jasen

Jan 1, 1970
0
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.

microcontrollers are probably the simplest solution

if the string is 10W for the string that'd be about 90mA (assuming 110V) to
light the lamps, so you'd need transistors (or something more expensive) in
there to switch the lamps as regular logic chips won't do it.

one way to handle the large number would be to drive them may be to matrix
them using diodes and drive power them from a 12V supply
(the bulbs will see actually closer to 10.5V after the diode and transistors
drops are included) at that voltage they'll burn 17.6 times as energy
so you drive them for 1/17.6 the duration...

meaning you can do 17 columns and n (for 17 times n lamps)
rows and control them all with 17+n wires which could make the wiring
simpler.

the current will be in the ballpark of 1A so 1N4000 diodes would suit.

a microcontroller with n+6 pins and a couple of other cheap chips (shift
registers or johnson counters) to scan the columns and a bunch of transistors
17 big ones for columns and n smaller ones for the rows

and as many 1N4000 diodes as lamps (should cost less than $5us for 100 retail) (you can use 1N4001 1N4002 etc instead - anything rated for atleast 12V 1A) Bye. Jasen J #### jasen Jan 1, 1970 0 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. with incandescent lamps a short power duration isn't a problem, just up the voltage until they see the correct RMS. I reckon I can address 1024 2.5V 1/4W lamps with a microcontroller (with 36 io pins) and more tha 1024 bits of ram) three 12-way serial-in parallel out shift registers, a bunch of transistors (probably fewer than 100) a 300W 24V power supply and a big bag of rectifier diodes (1024). I'd push a single high bit across the shift registers to select a column and then drive the apropriate rows with 32 other directly connected IO pins. (they'd all need buffering for the lamps, especially the columns) a ULN2003 would be strong enough to drive the rows and to drive the base of the PNP power transistors to drive the columns, 9 uln2003s gets you 63 outputs so the last output may be best done using discretes. Bye. Jasen O #### [email protected] Jan 1, 1970 0 jasen said: microcontrollers are probably the simplest solution if the string is 10W for the string that'd be about 90mA (assuming 110V) to light the lamps, so you'd need transistors (or something more expensive) in there to switch the lamps as regular logic chips won't do it. one way to handle the large number would be to drive them may be to matrix them using diodes and drive power them from a 12V supply (the bulbs will see actually closer to 10.5V after the diode and transistors drops are included) at that voltage they'll burn 17.6 times as energy so you drive them for 1/17.6 the duration... meaning you can do 17 columns and n (for 17 times n lamps) rows and control them all with 17+n wires which could make the wiring simpler. the current will be in the ballpark of 1A so 1N4000 diodes would suit. a microcontroller with n+6 pins and a couple of other cheap chips (shift registers or johnson counters) to scan the columns and a bunch of transistors 17 big ones for columns and n smaller ones for the rows and as many 1N4000 diodes as lamps (should cost less than$5us for 100 retail)
(you can use 1N4001 1N4002 etc instead - anything rated for atleast 12V 1A)

Bye.
Jasen

I am still in the early stages of digesting all this info, in all of
these replies.
light the lamps, so you'd need transistors (or something more expensive)

Something more "expensive" than transistors? Such as?

Microcontrollers appear to be very useful. I did go over the tutorial
on the PIC on Bill Bowden's site. I am familiar with assembly language
programming (mainly on IBM mainframes), so I get the idea. But here's a
more general question, since my electronics, in general, is
rudimentary, at best:

Does anyone know of EDUCATIONAL KITS that teach BASIC electronics,
while, as quickly as possible, leading up to circuits with
microcontrollers, and including the programming of the
microcontrollers? That could get me some hands on experience in this,
and maybe I would even end up using networks of the SAME
microcontroller that's in the kit.

Replies
1
Views
1K
Replies
3
Views
318
Replies
6
Views
797
Replies
2
Views
2K
Replies
6
Views
874