Computer Program Listing 1 (LEDctlr.c) is a C program suitable for execution on a microcontroller for implementing the invention.
Computer Program Listing 2 (ControllerDemonstration.py) is a Python program to run on an external computer to display patterns on the lights.
1. Field of the Invention
This invention relates to strings of lights used for the purpose of decoration, signage, or architectural accents, with lights that change color and brightness.
2. Prior Art
The following is a tabulation of some prior art that presently appears relevant:
Using LEDs (light emitting diodes) for lighting displays, such as holiday lighting, decorative displays, signage, or architectural accents, has become common. By combining primary colored LED lights of red, green and blue, most any common color is easily generated by these lights. Individually controlling the power to each light, as done in U.S. Pat. No. 7,257,551 Oskorep et al. (2007) requires a substantial amount of wiring, which becomes cumbersome with significant numbers of lights. U.S. Pat. Nos. 7,471,048 (2008) and 7,576,497 (2009) due to Peng, provide a method of synchronizing the lights, but no straightforward way to individually program them, thus limiting the types of displays available.
Other systems such as U.S. Pat. No. 7,550,935 (2009) by Lys et al. require specialized or custom controllers be present to maintain the pattern or animation. The system here uses standard, inexpensive microcontrollers to maintain the display.
The system introduced here reduces the overall system complexity by adding inexpensive microcontrollers to each light in the string. The protocol operates in a daisy chain fashion between the controllers, and requires only one additional wire between the lights in the string.
Color changes are stored locally on the lights, allowing animated patterns to be displayed by sending a single synchronization command. In addition, fading from one color to the next on each light is accomplished locally on the light. Thus the lights are capable of a wide variety of patterns and displays, and yet may be implemented with very small, inexpensive microcontrollers.
This system has several advantages over existing lighting systems:
In the drawings, closely related figures have the same number but different alphabetic suffixes.
A schematic drawing of a first embodiment of the invention is shown in
In addition to controlling the LED, each microcontroller also listens to a serial control line 104. The serial control lines of each of the lights are connected in a “daisy chain” fashion, where the output of a light's microcontroller is connected to the input of a subsequent light's microcontroller. An external controller 103, such as another microcontroller, personal computer, or network serial interface is connected to the serial input of the first microcontroller in the string. The external controller supplies commands to the string of lights. This transmits instructions and data to the first light's microcontroller using a serial protocol such as RS-232 or I2C to the first light in the string 102.
After receiving the commands, the first light's microcontroller broadcasts the command to the next light's microcontroller 108. Each subsequent microcontroller listens to the input and rebroadcasts as needed to an output line to the next microcontroller in the chain 110 according to a protocol discussed below.
When the lights are initialized, each light is assigned a unique sequential identification number (ID). Subsequent commands from the controller can send commands to a specific light in the string, instructing it to change color, or store a series of colors on a particular light for use in animations. In some embodiments of the invention, colors and animations may be stored on the microcontroller's electronically erasable programmable read only memory (EEPROM), allowing the lights to maintain their colors and/or animations without the controller 103 present.
To animate the lights, it is important that all of the lights switch at the same time. To accomplish this with the daisy chain structure, a special timing scheme, described below, synchronizes the lights so the first light and each subsequent light in the string delays changing until the last light in the string receives the command to change.
In the first embodiment of the invention shown in
To control the brightness of each component color LED, the first embodiment uses pulse-width modulation (PWM). Pulse-width modulation varies the amount of light by turning the LED on and off at a rate much faster than the eye can detect, for example 1,000 times per second.
The amount of electric current applied to a typical LED must typically be limited to about 20 or 30 milliamps to prevent the LED from being overdriven and damaged from excess heat build-up. One way of accomplishing this is to place a current limiting resister between the microcontroller (the current source) and the LED to limit the current flowing through the LED.
However, the same effect can be accomplished by using the PWM duty cycle to limit the overall amount of time the LED is on even at maximum brightness, thus preventing overheating. For example, if a typical PWM cycle tperiod is 512 clock ticks long, a typical LED may reach full brightness with being “on” for 360 of those cycles, a duty cycle of 70%. The use of PWM for even the brightest value eliminates the need for current-limiting resistors, saving a considerable number of parts in the design.
By varying the brightness of the red, green, and blue LEDs a variety of different colors are generated. In the first embodiment, each LED may be set to eight different brightness levels, ranging from 0 (off) to 7 (full brightness), allowing each light to display 8×8×8=512 different color and brightness combinations. Other embodiments may allow more (or fewer) different brightness levels for each LED.
The maximum brightness is determined by the PWM duty cycle allowing the maximum brightness allowed by the LED specifications. The eight brightness values specified by the protocol are used as indices into a table of PWM duty cycle values. The PWM values in the table specify the amount of “on” time for a given PWM cycle of length tperiod 502. For example, if the PWM cycle is 512 clock ticks long, a table entry of 256 specifies the light is on for 50% of the cycle (bright), and a table entry of 51 specifies the light is on for 10% of the cycle (dim).
The PWM table used in the first embodiment is shown in
To produce a uniform set of brightness levels from full brightness to “off”, each subsequent brightness level needs a duty cycle that is twice as much as the previous one. Thus the entries in each row of the table are found with the formula:
Where P is the maximum PWM value for the “7” brightness value (360 in the example above), and b is the brightness level ranging from 0 to 7. Thus b is used as an index into the table of PWM values. The PWM value for b=0 is zero. This produces an even distribution of apparent brightness values.
Color values are expressed as a nine-bit value, with three bits for red (allowing seven brightness levels and “off”), three for green, and three for blue. Since the serial protocol used to transmit values only holds eight bits, the ninth bit is encoded as part of the controller ID (see protocol description below).
It is possible to “fade” from one value to the next by incrementing or decrementing the PWM value after a one or more PWM cycles have occurred. This causes a pleasing gradual change of color or brightness.
To fade from one brightness level to another, the PWM duty cycles must change exponentially during the fade period as defined by the formula above. Since computing this during the PWM cycle is beyond the computational abilities of the small microcontrollers typically used for the lights, a special table shown in
To facilitate the fade process, the time period the fade transition occurs over is broken into eight sections, each consisting of eight units (64 units total). Each unit consists of a full PWM cycle (consisting of 512 iterations in the first embodiment).
For each section, the rate of change of the PWM values is controlled by two variables, referred to as skip and step. For every skip of the unit's PWM cycles, the PWM values are incremented by step.
As an example in the first embodiment, consider the case of the red LED transitioning from a brightness level of 4 (which has a PWM duty cycle of 20/512) to 6 (which has a duty cycle of 135/512). The table in
Note for transitions between low brightness values where the PWM duty cycle is very small, incrementing the PWM duty cycle is not desirable, because the brightness will increase too quickly. In this case, the skip value of the table is set to zero, and the step value is used as the actual PWM duty cycle value for that particular section. If the skip value is non-zero and the step value is zero, then the PWM duty cycle remains unchanged for that unit of transition. To fade from a brighter value to a dimmer one, the values in the table 704 are simply applied in reverse order.
This process increases the PWM values in a generally smooth exponential fashion, providing a perceptually smooth increase in brightness. However, the only operations required by the microcontroller to perform this transition are sequential table lookups and additions. This places minimal computational requirements on the microcontroller and allows the use of inexpensive parts for the preferred embodiment.
Since there are eight units, the skip value can be expressed in 3 bits, leaving five bits left in a byte to describe the step value (increment in the PWM value) as shown in
The main controller 103 communicates with the lights, and the lights communicate with each other, using a serial protocol. In the first embodiment, this is accomplished with the standard RS-232 protocol on the signal lines coming into 104 and out of 207 each light. The RS-232 protocol defines timing and signaling for transmitting eight bit bytes at pre-described bit rates, such as 9,600 bits per second. The voltage levels used for this signaling are those generated and received by the microcontroller 102 with no external interface components.
Other embodiments may use alternate serial protocols, although in the preferred embodiment a serial protocol not requiring an external clock line is preferable. Some microcontrollers have built-in hardware for processing serial data, such as a UART (universal asynchronous receiver/transmitter). Other embodiments may require the interpretation of the serial data to be performed in software.
In order to control the string of lights, a simple protocol is defined, shown in
Because the specification of color requires nine bits (three each for red, green and blue, respectively), the first eight bits are transmitted in the <color> byte. The remaining bit is transmitted as the 7th (high order) bit of the ID. Thus the total number of lights allowed in a string in the first embodiment is 127. Using the upper bit of the ID to transmit the color information helps minimize the amount of transmission time required to send color information to a particular light in the string.
The Init command is given as I<0> to the first light 102. This sets the ID of the first light to zero. This light then increments the ID to one, and sends that to the next light 108, giving that one an ID of one. The light after that 110 receives an ID of 2. Thus all the lights are all given unique IDs. For example the sixth light 116 in the chain shown in
Multiple color values may be stored in each controller for each LED. The protocol allows a particular frame at a particular LED controller ID to be set to a unique color value.
A simple “step” command steps all of the LED controllers between these values to cause an animated display of the lights. Since the commands are passed from light to light in a “daisy chain” style, the following mechanism is used to allow the lights to change values synchronously.
First, the total number of lights in the chain is transmitted to all of the lights' microcontrollers. As shown in
The program listing ControllerDemonstration.py shows an example of how to broadcast data to the lights. The program is written in the Python language, available from the Python Software Foundation for a wide variety of computer platforms. The program transmits commands with either a directly attached serial port, or a serial port attached via a network interface.
The interpretation of the protocol by the lights is done by the light's microcontroller when it receives serial data on its serial input line. When each byte of the message is ready, the microcontroller is interrupted from the PWM loop, and processes the data. If the data requires additional parameters, a state flag is set, instructing the microcontroller to interpret the next byte as a parameter when the next serial input interrupt occurs. For commands pertaining to a particular light ID in the string, the ID requested in the received command is compared to the ID set in the light when it was initialized. If the two match, the command (e.g., “set color”) is processed. Otherwise, the microcontroller transmits the command to the next light down in the string.
In some embodiments of the invention, the ID and the total number of lights in the string may be written into the microcontroller's EEPROM memory and permanently stored, either during manufacture or during initial use, so the initialization of these parameters is no longer necessary.
In the first embodiment of the invention, shown in
The C program LEDctlr.c is used to implement the light behavior. This program is compiled with BKND CC5X compiler, distributed by B Knudsen Data of Norway. The program may be adapted to other similar microcontrollers using similar C compilers.
The use of one microcontroller per LED is just one embodiment of an implementation of this invention. Larger microcontrollers can be used to control multiple LEDs, interpreting the protocol for each LED it controls in sequence. In such a system, when the microprocessor is initialized it assigns itself an ID for the first light it is connected to, then increments the ID number by the number of lights attached to it before sending the ID to the next light in the chain. When it receives commands pertaining to a particular light ID, it checks the ID against the range of lights connected to it before either processing it (and applying the change to the particular light connected to it) or passing it on to the next microcontroller in the chain.
In other embodiments of the invention shown in
This application claims the benefit of the U.S. Provisional Patent Application having Application No. 61/214,029 and filed on Apr. 17, 2009, the disclosure of which is incorporated by reference herein.
Number | Name | Date | Kind |
---|---|---|---|
6344716 | Gibboney, Jr. | Feb 2002 | B1 |
6608453 | Morgan et al. | Aug 2003 | B2 |
6653797 | Puleo, Sr. et al. | Nov 2003 | B2 |
6933680 | Oskorep et al. | Aug 2005 | B2 |
6967448 | Morgan et al. | Nov 2005 | B2 |
7161313 | Piepgras et al. | Jan 2007 | B2 |
7257551 | Oskorep et al. | Aug 2007 | B2 |
7258463 | Sloan et al. | Aug 2007 | B2 |
7471048 | Peng | Dec 2008 | B2 |
7550935 | Lys et al. | Jun 2009 | B2 |
7576497 | Peng | Aug 2009 | B2 |
7614767 | Zulim et al. | Nov 2009 | B2 |
20050116667 | Mueller et al. | Jun 2005 | A1 |
20050269580 | D'Angelo | Dec 2005 | A1 |
Number | Date | Country | |
---|---|---|---|
61214029 | Apr 2009 | US |