ELM711 Christmas LEDs Driver Description Features • • • • • • • The ELM711 is a sequencing circuit that is typically used to control strings of LEDs for use on Christmas trees, or to attract attention on signs. Sixteen different patterns are pre-programmed into the circuit, and can easily be selected with the push of a button (and that same pushbutton also controls circuit on and off). No other external logic components are needed for the IC to operate, as all timing and control functions are performed internally. Each high current output is capable of directly driving an LED, but in order to drive a string of LEDs, a higher voltage supply and an interface circuit (often a transistor and two resistors) are required. See the Example Applications section for a short discussion on how you might typically use the ELM711 in a circuit. Note that this integrated circuit uses rapid PWM switching techniques to perform the LED dimming used by some of the patterns, which is not suitable for use with slow interface devices such as electromechanical relays. One button controls both power and patterns Circuit remembers settings with power off 16 different patterns Debounced control switch input Wide supply range – 1.8 to 5.5 volts High current drive outputs Low power CMOS design Connection Diagram PDIP and SOIC (top view) Applications VDD 1 8 VSS LED4 2 7 LED3 LED5 3 6 LED2 PB 4 5 LED1 • Christmas LED lighting control • Marquee lighting • Display attention grabbers Block Diagram power control EEPROM memory pattern generator VDD PB ELM711DSB 4 switch debounce pattern selector Elm Electronics – Circuits for the Hobbyist < http://www.elmelectronics.com/ > 3 LED5 2 LED4 7 LED3 6 LED2 5 LED1 1 of 9 ELM711 Pin Descriptions VDD (pin 1) This pin is the positive supply pin, and should always be the most positive point on the integrated circuit. Internal circuitry connected to this pin is used to provide power-on reset of the logic, so an external reset signal is not required. Refer to the Electrical Characteristics section for more information. LED1, LED2, LED3, and LED4 (pins 5, 6, 7, and 2) These outputs are used to control four different groups of LEDs. Each pin outputs a high level (VDD) when ‘active’ or ‘on’. Typically strings of different colours or in different positions might be controlled by these pins. The on and off times of each output vary with the pattern that is selected. The transition from on to off, or from off to on may be abrupt, or may (appear to) fade in and out between those two states. To obtain the appearance varying LED intensities, the ELM711 uses pulse width modulation (PWM) techniques which employ very short duration pulses (some as short as 1 msec). For this reason, the ELM711 should not be used with mechanical relay circuits. LED5 (pin 3) This output is identical to the others except that in several sequences, it is held continuously on. The intention was that this would control a special group of LEDs, perhaps on the top of the tree (for a star or other ornament). PB (pin 4) This pin is for the connection of a momentary action pushbutton switch. Each press of the switch should connect this input to circuit common (VSS). If the outputs are on, a momentary pressing of the switch will change the LED pattern to the next available one (there are sixteen in total). If the button is pressed and held for more than 2 seconds, the circuit will turn off all of the outputs, and go into a low power ‘sleep’ mode. If the circuit is off (‘sleeping’) when the switch is pressed, the circuit will turn itself on with the pattern set to the one that was in effect when the circuit was turned off. This input is internally ‘debounced’ and has an internal pullup resistor to simplify the direct connection to mechanical switches. Should you prefer to use a logic signal rather than a switch, this can be easily done, as the input will accept standard TTL or CMOS logic levels. VSS (pin 8) Circuit common is connected to this pin. This should be the most negative point in the circuit. Unused Pins The ELM711 does not require that you use all of the output pins. If your application does not need all of them, simply do not connect anything to the unused ones. All rights reserved. Copyright 2009 and 2015 by Elm Electronics Inc. Every effort is made to verify the accuracy of information provided in this document, but no representation or warranty can be given and no liability assumed by Elm Electronics with respect to the accuracy and/or use of any products or information described in this document. Elm Electronics will not be responsible for any patent infringements arising from the use of these products or information, and does not authorize or warrant the use of any Elm Electronics product in life support devices and/or systems. Elm Electronics reserves the right to make changes to the device(s) described in this document in order to improve reliability, function, or design. ELM711DSB Elm Electronics – Circuits for the Hobbyist < http://www.elmelectronics.com/ > 2 of 9 ELM711 Absolute Maximum Ratings Storage Temperature....................... -65°C to +150°C Ambient Temperature with Power Applied....................................-40°C to +85°C Voltage on VDD with respect to VSS............ 0 to +6.5V Voltage on any other pin with respect to VSS........................... -0.3V to (VDD + 0.3V) Note: Stresses beyond those listed here may result in undesirable operation, and may damage the device. These values are given as a design guideline only, and the ability to operate to these levels is neither inferred nor recommended. Electrical Characteristics All values are for operation at 25°C and a 5V supply, unless otherwise noted. For further information, refer to note 1 below. Characteristic Minimum Typical Supply voltage, VDD 1.8 5.0 VDD rate of rise 0.05 Maximum Units 5.5 Conditions V V/ms see note 2 Average operating current, IDD 0.6 1.5 mA see note 3 Average sleep current, IDD 0.02 0.05 mA see note 3 Output low current VDD = 5.0V 8.0 mA VO = 0.6V VDD = 3.3V 6.0 mA VO = 0.6V VDD = 5.0V 3.5 mA VO = 4.3V VDD = 3.3V 3.0 mA VO = 2.6V 64 msec PB input pullup resistance 40 KΩ EEPROM (settings) retention 40 years Output high current PB input debounce time 60 see note 4 Notes: 1. This integrated circuit is produced using one of the Microchip Technology Inc.’s PIC12F1822 products as the core embedded microcontroller. For further device specifications, and possibly clarification of those given, please refer to the appropriate Microchip documentation. 2. This spec must be met in order to ensure that a correct power on reset occurs. It is quite easily achieved using most common types of supplies, but may be violated if one uses a slowly varying supply voltage, as may be obtained through direct connection to solar cells, or some charge pump circuits. 3. Device internal current only. Does not include any current supplied to external circuits. 4. This is typical – the value varies with temperature and voltage. ELM711DSB Elm Electronics – Circuits for the Hobbyist < http://www.elmelectronics.com/ > 3 of 9 ELM711 ELM711 Operation The ELM711 is a very simple sequencing circuit that uses one of sixteen preset patterns to control five output pins. When power is first applied, the circuit will reset itself, and will display pattern 1 (all LEDs will be on continuously). Each time that you press the pushbutton (ie bring the pin 4 PB input low), the ELM711 will change the pattern, switching in order from 1 to 16. When the button is pressed while at pattern 16, the pattern will switch back to pattern 1. Table 1 provides a summary description of all 16 patterns. The ELM711 continually monitors the pushbutton (PB) input for commands from the user. If it sees a Pattern short pulse on this pin, it will switch to the next stored pattern, but if it sees a very long press (greater than two seconds), it will interpret that as a command to shut down. Shutting down involves setting all five outputs to a low level, and placing the internal circuitry in a special low power ‘sleep’ mode. The circuit stores the current pattern in EEPROM memory so that it can be restored when the circuit wakes, and the wake circuitry is enabled, so that a short press of the pushbutton can wake the circuit, and restore normal operation. All patterns are fixed (ie. not user programmable). Description 1 All LEDs are on continuously 2 Long LED on times, medium off times, short fade, relative times vary 3 Long LED on times, medium off times, no fade, relative times vary slightly, LED5 always on 4 Short LED on times, long off times, short fade, overlapping single outputs 5 Short LED on times, long off times, no fade, relative times vary slightly, LED5 always on 6 Short LED on times, medium off times, very long fade time, LED5 always on 7 Medium LED on times, medium off times, medium fade time 8 Long LED on times, shorter off times, faster fade time 9 Long LED on times, short off times, fast fade time, one off at a time 10 Medium LED on and off times, all build up then down, no fade 11 Medium LED on and off times, all build up then go off, no fade 12 Fast on times, long off times, very short fade times, LED5 is mostly on 13 Chaser pattern with each output on for 1 second, no fade 14 Faster chaser pattern, with medium fade 15 Very fast LED on times, shorter off times, no fade 16 Very fast LED on times, very fast off times, very short fade Table 1. ELM711 LED Patterns ELM711DSB Elm Electronics – Circuits for the Hobbyist < http://www.elmelectronics.com/ > 4 of 9 ELM711 Changing the Power On Mode There are two ways in which the ELM711 might start when voltage is initially applied. It might begin activating outputs to display a pattern, or it might remain quite, waiting for you to press the pushbutton to start the output sequence. You may choose which way you want the IC to operate by holding the pushbutton down as power is applied. If the circuit was in the ‘power up and begin displaying’ mode, it will switch to the ‘power up and be quiet’ mode. Conversely, if the circuit was in the ‘power up and be quiet’ mode, it will switch to the ‘power up and begin displaying’ mode. You need only do this once, as your choice is stored in non-volatile memory (EEPROM). When you hold the pushbutton on during powerup, all LED outputs will go active, and stay that way for two seconds (at which time they all go off). When you see the LEDs go off, release the pushbutton - your new setting has been saved. These two modes are provided to allow connecting your ELM711 to different types of circuits. Perhaps you have a few ELM711 circuits connected to a powerbar, and want all of them to begin operating as soon as the power bar is turned on. If that is the case, the factory default setting (‘power up and begin displaying’ ) is what you want. Alternatively, your ELM711 circuit(s) might be continually powered, but you wish to control the on and off with the pushbutton. In this case, you do not want a short power failure or brownout to cause the ELM711 to turn on. For that application, you should switch to the ‘power up and be quiet’ mode. How LED Fading Works Several of the ELM711 patterns vary the intensity of the LEDs gradually rather than abruptly turning them on and off. Actually, they appear to do so, but are actually turning the LEDs on and off at a rate that your eyes can not see. What your eyes see is an average light level that varies with the ‘duty cycle’ of the waveform. Figure 1 shows how the ELM711 actually provides various light levels. The basic waveform repeats at a rate of about 120 Hz (most people are not able to see the flicker at that high a frequency). The width of the output pulses are changed depending on the desired intensity, but the frequency remains constant. This type of control is called pulse width modulation (PWM). In this example, the pulses are 3 msec wide, so the duty cycle is (3 msec ÷ 8 msec) x 100% = 37.5%. The fastest pulse that the ELM711 uses is 1 msec wide, so the minimum duty cycle is about 12%. Note that a 1 msec pulse is too fast for use with most electromechanical devices (relays), and we do not advise that you try. Also, the waveform is in no way synchronized to the line frequency, so using triac circuits, etc. should be avoided as well. Transistor outputs whether direct or through solid state relays is advised. 3 msec on LED drive off 8 msec Figure 1. ELM711 LED Fading Waveform ELM711DSB Elm Electronics – Circuits for the Hobbyist < http://www.elmelectronics.com/ > 5 of 9 ELM711 Example Applications This section discusses how the ELM711 might typically be used. Basically, all that needs to be done is apply power to the IC and it will create a sequence of outputs for you. There are some concerns over the external connections that should be discussed first, however. Whenever interfacing to CMOS circuitry, you need to protect against a problem called ‘latchup’. This may occur when excessive current is allowed to flow into one of the IC’s pins, typically an input. This can happen at almost any time, but generally occurs if there are very long wires connected directly to the IC, with no form of current limiting. Latchup will cause large currents to flow, which can damage circuit components (including the ELM711). Figure 2 shows how a pushbutton will typically be connected to the input of the ELM711. This works well if the wires to the switch are short (less than about 12 inches long). 1 8 2 7 3 6 4 5 4.7KΩ pullup resistor connected to the pushbutton. This resistor is not essential, but it helps to pass some of the induced currents around the ELM711 input, and also provides a lower impedance input so that the voltages caused by the induced currents are reduced, and less likely to provide false inputs. (The ELM711 input pin also uses a relatively long debounce time, so that it is less susceptible to noise.) The ELM711 may be used to control other devices, but it was designed with LEDs in mind. When on, LEDs require a forward voltage of about 2 to 3 volts as shown in Table 2. These voltages will remain fairly constant over a wide range of currents, and can be used in calculations as if they are constant. Colour Typical Vf Red 1.8 Yellow 1.9 Green 2.0 Blue 3.0 White 2.9 Table 2. Typical LED Forward Voltage Drops Figure 2. Typical Pushbutton Connection If the wires are longer than that, currents can more easily be induced into the wires, and into the ELM711 pin. Since there is no current limiting, the currents can possibly be large enough to exceed the latchup threshold, and the IC may be damaged. 4.7KΩ 1 8 2 7 3 6 4 5 2.2KΩ Figure 3. Added protection for long PB leads Simply adding a series resistor such as the 2.2KΩ one shown in Figure 3 is all that is generally needed to prevent latchup. Note that we also show an optional ELM711DSB If the ELM711 is to use a 3 to 5 volt power supply, it is clear that it can only be directly connected to a series string of one or possibly two LEDs on each output. There would not be enough voltage available to power a longer string of LEDs. This might result in a sparse Christmas tree unless something can be done. This is not to say that driving only one or two LEDs is not possible. In fact, a small USB powered ‘Christmas Tree’ is easily made with only a few components, as we show in Figure 4 on the top of the next page. The circuit of Figure 4 uses the 5 volts available on a USB connector for power. Simply use a USB cable and only connect the 5V (+5) and common (SG) wires. A filter capacitor is recommended, and is shown across the supply. We show five LEDs, one connected to each control pin with resistors connected in series. The resistor values should be chosen based on desired brightness (current), and the colour of LED used, but will typically be about 1 kΩ. Elm Electronics – Circuits for the Hobbyist < http://www.elmelectronics.com/ > 6 of 9 ELM711 Example Applications (continued) USB Interface 1 (+5) 0.01µF control pushbutton 2 (D-) 1 8 3 (D+) 2 7 4 (SG) 3 6 4 5 Figure 4. A Small USB Christmas Tree Since 12V supplies are very common, we will use that. Then, you need to choose R, which requires a knowledge of the LED current. To obtain fairly bright LEDs, a good starting point is to use 9 or 10 mA for red, yellow and green leds, and a smaller current (4 or 5 mA) for the blue and white LEDs. As this calculation is for four green LEDs, we will use a current of 9 mA (or 0.009 A). R is then given by: R = (12 - 4 x 2.0) ÷ 0.009 R = 444Ω While 444Ω is not a standard value, you could select either 430Ω or 470Ω for the resistor and the current would still be close to the desired 9 mA. Continue in a similar fashion for the other colours. You may need to try a few resistor values for each colour in order to make all the LEDs appear to be of the same brightness, as your eye is more sensitive to different wavelengths, and some LEDs are simply more efficient than others. In this way, all of the component values can be chosen and a circuit such as the one in Figure 6 can be designed. That design highlights the fact that you do not have to use bipolar (NPN) transistors, but can also uses MOSFETs such as the 2N7000’s shown. Often, the ELM711 will be used to drive more than one LED per output, however. The circuit of Figure 5 shows the IC connected to a transistor driving several LEDs from a power supply of Vpos volts. As long as the sum of the LED voltages is less than Vpos, the resistor (R) will have a significant voltage across it, and the total current in the string will be determined by the voltage across the resistor R, and the value of the resistance. Choosing a resistance value may require a little experimentation, but to get you started, if you plan to use N LEDs in the string, each with a forward voltage drop of Vf, then choose Vpos such that: Vpos ≥ (N+1) x Vf Then, given the LED current (I), determine the value of R from: R = (Vpos - N x Vf) ÷ I For example, if you wish to have 4 green LEDs in a string, then you need to choose: Vpos ≥ (4+1) x 2.0 Vpos ≥ 10.0 volts ELM711DSB Vpos N LEDs R 4.7KΩ 2N3904 Figure 5. Driving LED Strings Elm Electronics – Circuits for the Hobbyist < http://www.elmelectronics.com/ > 7 of 9 ELM711 Example Applications (continued) We show specific colours for the LEDs of Figure 6, but that is our choice - you may use different colours. Note that the circuit does not show a transistor driving the white LED from pin 3, as the ELM711 is capable of driving the single device at a reasonable current. We will leave the wiring details to you, but to get you started, we have found that the wires for a small (2 to 3 foot high) tree should be about 5 feet long. Space the LEDs about 12 inches apart, beginning at the end, and install them by cutting a 2 inch piece from one of the two conductors in the wire. When you bring the two ends of the cutout together to solder them to the LED, the other conductor is forced to form a loop, which allows it to hang from a tree branch. Enjoy the light show! 12V 12V (+) 470Ω 78L05 2N7000 12V external source 4 Green LEDs 12V (-) 5V 470Ω 0.01µF 2N7000 1 8 2 7 3 6 4 5 4 Yellow LEDs 12V 470Ω 2N7000 4 Red LEDs 470Ω 1 White LED Pushbutton Operation: If on, each push changes the pattern. Hold for 2 seconds to turn all LEDs off. If off, press momentarily to turn back on. 12V 1KΩ Figure 6. LEDs for a Christmas Tree ELM711DSB 2N7000 Elm Electronics – Circuits for the Hobbyist < http://www.elmelectronics.com/ > 3 Blue LEDs 8 of 9 ELM711 Outline Diagrams The diagrams at the right show the two package styles that the ELM711 is available in. The first shows our ELM711P product in what is commonly known as a 300 mil Plastic DIP (or PDIP) package. It is used for through hole applications. The ELM711SM package shown at right is our surface mount option. It is 3.90 mm wide (or 150 mils) and is known as a narrow Small Outline IC (or SOIC) package. We have chosen to simply refer to it as an SM (surface mount) package. The drawings shown here provide the basic dimensions for these ICs only. Please refer to the following Microchip Technology Inc. documentation for more detailed information: • The Microchip Packaging Specification, document name 00000049BZ.pdf (57.1 MB). At the home page (www.microchip.com), select Design Support and Documentation then Packaging Specifications, or go to www.microchip.com/packaging • The PIC12(L)F1822/PIC16(L)F1823 Data Sheet, file name 400041413E.pdf (4.2 MB). At the Microchip home page, use the Search Data Sheets box to look for 12F1822. ELM711P 6.35 2.54 max 10.92 ELM711SM 3.90 1.27 6.00 Note: all dimensions shown are in mm. Ordering Information These integrated circuits are 8 pin devices, available in either a 300 mil wide plastic DIP format, or in a 150 mil (3.90 mm body) SOIC surface mount type of package. We do not currently offer any other package options for this device. The ELM711 part numbers are as follows: 300 mil 8 pin Plastic DIP................................ELM711P ELM711DSB 150 mil 8 pin SOIC......................................ELM711SM Elm Electronics – Circuits for the Hobbyist < http://www.elmelectronics.com/ > 9 of 9