Silicon ChipDigital LED Lighting Controller For Christmas Lights - October 2011 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: DAB+ radio broadcasting has a long way to go
  4. Project: Let’s Get Quizzical: A Quiz Game With A Difference by John Clarke
  5. Project: Digital LED Lighting Controller For Christmas Lights by Nicholas Vinen
  6. Project: Build A Loudspeaker Protector by Silicon Chip
  7. Project: Measuring Audio Gear Without Spending Big Dollars by Jim Rowe
  8. Project: The USB MIDI-Mate: A MIDI Interface For PCs by Jim Rowe
  9. Review: CadSoft EAGLE PCB Layout Software by Nicholas Vinen
  10. Project: High-Performance Stereo Headphone Amplifier, Pt.2 by Nicholas Vinen
  11. Book Store
  12. Vintage Radio: A look at the Radiola Model 573-MA Receiver by Maurie Findlay
  13. Market Centre
  14. Advertising Index
  15. Outer Back Cover

This is only a preview of the October 2011 issue of Silicon Chip.

You can view 28 of the 104 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "Let’s Get Quizzical: A Quiz Game With A Difference":
  • Quizzical Quiz Game PCB [08110111] (AUD $25.00)
  • PIC16F88-I/P programmed for the Quizzical [0811011A.HEX] (Programmed Microcontroller, AUD $15.00)
  • Firmware (ASM and HEX) files for the Quizzical! project [0811011A] (Software, Free)
  • Quizzical Quiz Game PCB pattern (PDF download) [08110112] (Free)
  • Quizzical! Quiz Game front panel artwork (PDF download) (Free)
Items relevant to "Digital LED Lighting Controller For Christmas Lights":
  • Digital Lighting Controller LED Slave PCB [16110111] (AUD $20.00)
  • Digital Lighting Controller LED Slave PCB pattern (PDF download) [16110111] (Free)
Items relevant to "Build A Loudspeaker Protector":
  • Speaker Protection and Muting Module PCB [01207071] (AUD $17.50)
  • Speaker Protector and Muting Module PCB pattern (PDF download) [01207071] (Free)
Items relevant to "The USB MIDI-Mate: A MIDI Interface For PCs":
  • USB MIDI-Mate PCB [23110111] (AUD $15.00)
  • PIC18F14K50-I/P programmed for USB MIDI-Mate [2311011C.HEX] (Programmed Microcontroller, AUD $15.00)
  • Firmware (HEX and C source code) files for the USB MIDI-Mate project [2311011C] (Software, Free)
  • USB MIDI-Mate PCB pattern (PDF download) [23110111] (Free)
  • USB MIDI-Mate panel artwork and drilling templates (PDF download) (Free)
Items relevant to "High-Performance Stereo Headphone Amplifier, Pt.2":
  • Hifi Stereo Headphone Amplifier PCB [01309111] (AUD $17.50)
  • Red & White PCB-mounting RCA sockets (Component, AUD $4.00)
  • Hifi Stereo Headphone Amplifier PCB pattern (PDF download) [01309111] (Free)
  • Hifi Stereo Headphone Amplifier front & rear panel artwork (PDF download) (Free)
Articles in this series:
  • High-Performance Stereo Headphone Amplifier, Pt.1 (September 2011)
  • High-Performance Stereo Headphone Amplifier, Pt.1 (September 2011)
  • High-Performance Stereo Headphone Amplifier, Pt.2 (October 2011)
  • High-Performance Stereo Headphone Amplifier, Pt.2 (October 2011)

Purchase a printed copy of this issue for $10.00.

MUSIC-CONTROLLED DISPLAYS: DIGITAL XMAS LED LIGHTING CONTROLLER It’s that time of year again when all those Christmas lighting devotees start planning and building their displays for the festive season. They might have dozens – if not hundreds – of different light arrays and they will be thinking about buying even more. Is this you? Have you thought about controlling lots of your lights in time to music? Well now you can! O ur spectacular Digital Lighting Controller, which we presented last year (October-December 2010), could drive an impressive array of incandescent globes. But while it proved to be very popular, no sooner had we gone to press than many readers started reminding us that most Christmas Lights are now made of 12V LED strings. D’oh! So now we’ve made up a new Slave Controller. It suits the original master unit but can now drive up to eight strings of LEDs, each string with completely individual control. 24  Silicon Chip by St. Nicholas Vinen And you can have up to four slaves so that you can drive up to 32 channels. Woo-hoo! Furthermore, if you run the whole shebang from 24V DC instead of 12V DC, you can have twice the number of LED strings, by running LED strings in series. Wow! Think of the possibilities. You can control thousands of LEDs! Another – these days fairly significant – advantage of going LED is that controlling lots of incandescent lamps means that you are going to get a big siliconchip.com.au This rear-view inside shot shows the complete Digital Lighting Controller LED Slave – it uses the same master unit as published this time last year. By comparison with last year’s slave, the biggest difference is the size of the box – it’s much smaller – and the row of semiconductors down the middle – the Triacs are now replaced by Mosfets. electricity bill for the festive season. LEDs are a much cheaper proposition. Digital LED control Before we get down to the details of the Slave LED Controller, we need to review the main features of the Digital Lighting Controller presented last year. The whole system is controlled by the master unit which is housed in a small plastic box. This is controlled via a hand-held remote and takes an SD card (or MMC or SDHC card). This contains WAV music file(s) and sequencer file(s) (which you set up) CAT5 CABLE  dsPIC33FJ64 GP802 MICROCONTROLLER (IC1) INFRARED RECEIVER MASTER UNIT siliconchip.com.au SD/MMC CARD and it sends serial commands via a Cat5/6 cable to the slave lighting controllers. These can drive incandescent lights or as presented in this article, lots of LED strings. You can have up to four slave units and so you could have, for example, three slave units each driving LEDs and one slave driving incandescent lamps. Or any other combination involving up to four slaves. For the rest of this article we will concentrate on the slave LED controller. If you want all the information involving the incandescent control230V AC CAT5 CABLE 12V DC CAT5 CABLE ler and the master unit itself, you will need to refer back to the original articles (ie, October, November & December 2010). If you don’t have these issues, you can purchase them from SILICON CHIP or you can access them on our website (for a small fee). Going to the Master and slave LED controllers, Fig.1 shows the overall set-up with one master and up to four slaves. The slave units are daisy-chained via Cat5 ethernet cable, as each has RJ45 input and loop out jack sockets. 24V DC CAT5 CABLE 12V DC AC SLAVE UNIT (8 AC OUTPUTS) DC SLAVE UNIT (8 DC OUTPUTS) DC SLAVE UNIT (8 DC OUTPUTS) DC SLAVE UNIT (8 DC OUTPUTS) TO 8 x MAINS POWERED LIGHTS TO 8 x 12V DC LED LIGHT STRINGS TO 8 x 24V DC LED LIGHT STRINGS TO 8 x 12V DC LED LIGHT STRINGS Fig.1: the block diagram shows how four slaves can be connected to the master unit, for up to 32 individually controlled lighting channels. This is one example of a slave lineup; you can mix and match as needed. October 2011  25 10k CON10 CHAIN LENGTH SENSE IN FROM CONTROLLER 1 2 3 4 5 6 7 8 +3.3V SERIAL DATA +6V GND SCLK LATCH SER DATA RJ-45 13 MASTER CLEAR 14 12 100 10 11 IC2e IC2f IC2: 74HC04 SCLK 9 2 1 3 100 IC2d IC2a LATCH 100nF 8 IC2c 5 4 100 6 7 IC2b 100nF +12V 100 F 16V 100nF 47k 100 47k 47k 47k 47k 47k 47k 47k 1 14 IC3a 2 C B 10 11 14 12 13 4x 10k 16 Vdd MR B Q0 Q1 SRCK Q2 Q3 DS Q9 E 8 x 1M 15 1 Q10 E LCK Q6 Q7 Q7' OE 13 Q11 E B Q12 E B 9 5 6 9 8 11 IC3f 10 13 12 Q13 E SC IC4c 6 5 C Q14 E IC4b 3 4 C Q15 E IC4a 1 C Q16 B 2 7 E 7 2011 8 C B IC3e IC4d 9 B 8 IC3d 10 C Vss IC3c IC4e 11 6 7 14 IC4f 12 C 3 IC1 Q4 4 74HC595 5 Q5 4 C B 2 IC3b 3 DIGITAL LIGHTING CONTROLLER LED SLAVE MODULE Fig.2: the complete circuit for the LED slave unit. IC1 receives and decodes serial data from the master unit while IC2 buffers the serial output to the next slave unit. Q9-Q16 and IC3-4 level shift IC1’s outputs to drive Mosfets Q1-8. These then switch current through the LED strings connected to CON1-8 and the internal indicator LEDs1-8. The data from the master unit adjusts the LED string brightness using pulse width modulation (PWM). Power for the LED strings is supplied from CON9 via a 10A fuse while REG1 provides a nominally 12V rail for driving the Mosfets. In addition, to enable a large lighting display to be set up, the connecting cables can be up to 30 metres long. This means you can have the master unit safely inside your home and the slave units can be a long way distant, provided you can feed 12 or 24V DC to them to power the LED strings. 26  Silicon Chip While the incandescent light slave controller is housed in a relatively large plastic instrument case (as it has to accommodate eight Triac circuits and eight IEC power sockets), the LED slave controller comes in a compact plastic case about the same size as the master unit. Pulse width modulation The brightness of the LED strings is controlled using pulse width modulation (PWM), ie, DC power to the LEDs is switched on and off rapidly. The switching frequency is twice mains frequency, so 100Hz for Australia, New Zealand and the UK (or 60Hz/120Hz in siliconchip.com.au CON11 CHAIN LENGTH SENSE MASTER CLEAR 1 2 3 4 5 6 7 8 SCLK SERIAL DATA +6V LATCH GND OUT TO OTHER MODULES +3.3V RJ-45 D1 1N4004 REG1 7812 1k OUT A + POWER IN GND 100 F 16V  LED9 CON9 F1 10A A K IN – 12–35V 47 F 50V K CON1 1k 1 LED1  K A 2 LEDs 1 OUTPUT D Q1 100nF STP16 G 1k 22 CON2 S NE06 LED2  K A 1 2 LEDs 2 OUTPUT D Q2 STP16 G 22 1k CON3 S NE06 LED3  K A 1 2 LEDs 3 OUTPUT D Q3 22 STP16 G 1k 22 CON4 S NE06 LED4  K A 1 2 LEDs 4 OUTPUT D Q4 STP16 G 22 1k CON5 S NE06 LED5  K A 1 2 LEDs 5 OUTPUT D Q5 22 STP16 G 1k 22 CON6 S NE06 LED6  K A 1 2 LEDs 6 OUTPUT D Q6 STP16 G 22 1k CON7 S NE06 LED7  K A 1 2 LEDs 7 OUTPUT D Q7 STP16 G 1k CON8 S NE06 LED8  K A 1 2 LEDs 8 OUTPUT D Q8 G 1N4004 A LEDS K K A Q9–16: BC549 B E many other parts of the planet). The ratio of the on-time to the switching period (10ms) is known as the duty cycle and the higher the duty cycle, the brighter the LEDs appear. The original incandescent light slave unit switches the 230VAC to the lights using a slightly different method siliconchip.com.au Q1–8: STP16NE06 G C STP16 S NE06 REG1: 7812 D D GND IN S GND OUT known as phase control. For phase control, the switch-off always occurs at the mains zero crossing as the Triac switching devices remain in their conducting state whileever the current through them is above a threshold. There are two zero crossings per mains cycle, hence the 100Hz frequency (or 120Hz for a 60Hz mains supply). To determine when the Triacs should be switched on, the mains voltage waveform is monitored and they are triggered at a particular phase angle, hence the term “phase control”. The power delivered to the load is proportional to the RMS voltage across it, which is related to the area under the partial sinewave. Since PWM and phase control are quite similar, the master unit software only needs minor changes to suit both. The changes are (1) holding the outputs on for the entire on-period rather than just an initial pulse to trigger the Triac and (2) calculating the on-period based on a square wave rather than a sinewave. Anticipating a DC slave, these options were built into the original master unit software. The “triac turnoff <slave> = delayed” (where <slave> is a number from 1 to 4) option forces the outputs to stay on for the entire on-time. For AC slaves, this option increases power consumption but the DC slave has no optocouplers so in this case it won’t. The previously undocumented “slave type <slave> = DC” option tells the master unit to compute on-times for a square wave (PWM) rather than a sine wave (phase control). Without this option, the DC slave will still operate but with less linear brightness control. Connectors We decided to use pluggable terminal blocks for the DC power into the slave unit and the LED strings. These are readily available, have a sufficient current rating (12A) and are easy to make connections to. The right-angle PCB mounting types allow the connectors to protrude through the front and rear panels of the case, so connections can be made without removing the lid. Since the eight output connectors are identical, it’s also easy to swap These pluggable right-angle screw connectors make setting up (and modifying) your masterpiece real easy! October 2011  27 47k CONTROL INPUT 1k 1k 1k 22 1k Q3 CON8 1k 22 47 F 50V 1k Q1 LED6 CON6 K A 100 100 F REG1 7812 LED5 CON5 K A CS 1102 – + LED4 CON4 K A – + LED3 CON3 K A – + LED2 CON2 K A – + LED1 D1 – + K A 100 100 – + + 100 F – + CON1 – + + CONTROL OUTPUT Q2 100nF 10k 10k 8 Q9 100nF 10k (RJ45 TYPE II) Q4 Q10 1M 10k 1 Q11 + 8 47k Q5 Q12 IC2 74HC04 1 (RJ45 TYPE II) CON11 1M Q6 1k 1M 100nF Q13 1M 47k K A IC4 CD4069 IC3 CD4069 47k 100nF CON10 Q14 47k 1M Q7 1k 1M LED8 K A LED7 CON7 22 LED9 8 x STP16NE06 Q8 22 47k Q15 22 1M 1k K A SC 22 47k 22 POWER 1M © 2011 8x BC549 Q16 22 12–35V POWER IN – 47k IC1 74HC595 Refer to the circuit diagram, Fig.2. The serial interface is virtually identical to that of the AC slave published previously. This consists of IC1 and IC2, 8P8C (RJ-45) connectors CON10 & CON11 and some associated passive components. A Cat5 type cable runs from the master unit to CON10. The eight conductors carry low voltage DC power (3.3V and 6V), serial data from the master and a “chain length sense” line which allows the master to detect the number of slaves connected. The 3.3V rail powers the slave’s digital logic ICs while the 6V provides power for optocoupler LEDs, used only by AC (mains) slaves. The 3.3V rail has a 100F bulk bypass capacitor and 100nF high frequency bypass capacitors for each connected IC. The serial lines are: bit clock (SCLK, pin 4), data (SERIAL DATA, pin 5), master clear (pin 2, active low) and latch (pin 7). Each slave receives eight bits of data on this bus and when the latch line goes low, the output state is updated to reflect the latest data received. The master clear line is used to turn all outputs off at power-up. Because the cable between units may be up to 30m long, the four serial lines are terminated to ground with 10k resistors. This forces some current to flow when the lines + CON9 10k Circuit description DIGITAL LIGHTING CONTROLLER LED SLAVE 16110111 1 1 1 0 1 1 6 1 F1 10A 100 LEDs around (or even between slaves) as necessary. For the communication ports, we are using the same “Type II” 8P8C (RJ-45) connectors as in the original (AC) slave unit. 4004 C Fig.3: all components mount on one PCB, as shown here and in the photo at right. The control inputs and outputs (CON10 and CON11), the DC power input (CON9) and the power indicator (LED9) go on the rear panel while the eight output connectors (CON1-8) and indicator LEDs (LED1-8) are fitted to the front panel. are driven high, reducing switching glitches due to the transmission line nature of the cabling. Each slave connects pin 1 to 3.3V via a 10k resistor. These are therefore in parallel. A resistor in the master unit from this pin to ground forms a voltage divider with them and by sensing the voltage at the junction, it can tell how many slaves are connected. When fewer slaves are connected, less data needs to be transmitted to update the The finished project mounted in its case, complete with push-on screw terminals. The green LED at left shows that power is connected but in the final version, it is on the rear panel, not the front. 28  Silicon Chip siliconchip.com.au output latches, appearing at QA-QH (pins 15 and 1-7). Level shifting There is a difference between this prototype photo and the diagram at left: the green power LED (LED9) has been moved to the rear panel to give more space to the front panel connectors. Otherwise it’s identical. output state. CON11 is the daisy-chain output and may be connected to another slave unit, allowing up to four to be controlled by a single master, as already noted. This avoids the need for multiple outputs on the master unit and simplifies the wiring. The three power lines and the chain length sense line pass through directly from CON10 to CON11 but the four serial lines are buffered. The bit clock, clear and latch signals each pass through two 74HC04 inverter gates (IC2a-f). By inverting each signal twice the polarity is preserved. Since the lines are buffered by each slave, the master output only needs to drive one length of wire. 100 series resistors form RC filters with the cable capacitance, filtering out switching glitches. The serial data from the master unit (or from the daisy chain Cat5 cable) passes through IC1, the 74HC595 serial-to-parallel latch IC, delaying it by eight clocks. As a result, each slave siliconchip.com.au receives a different portion of the data, which is stored in IC1’s eight internal latches. When the latch (LCK) line goes low, this data is transferred to its These outputs then control eight Mosfets which switch power to the LEDs. When a latch output is high, that LED string is turned on and when the output is low, it is off. Since IC1 runs from the 3.3V rail, its outputs swing between 0V and 3.3V. While this is sufficient to turn on some Mosfets, the types specified for this project require at least 8V to turn on fully. Even “logic level” Mosfets typically require at least 4.5V for full conduction. So we must “level shift” the 0-3.3V output signal of the 74HC595 to 0-12V (or so) to drive the Mosfets. This is achieved with eight NPN transistors (Q9-Q16), two hex CMOS inverter ICs (IC3 and IC4) and some resistors. Each of IC1’s outputs drives the base of an NPN transistor via a 1Mresistor. When an output is high, the corresponding transistor is driven with about (3.3V – 0.6V) ÷ 1M = 2.7A. The minimum hFE for a BC549 transistor at low currents is 110, so we can expect its collector to sink at least 2.7A x 110 = ~300A. Each collectors has a 47k pull-up resistor to the 12V rail, so to be driven into saturation, the transistors must sink around 12V / 47k = 255A. Therefore the collector voltage swing will be close to 12V. This level shifter configuration is inverting, ie, when IC1’s output goes This time shown from the front (and without the connectors in situ) the PCB mounted inside the case. The eight panel LEDs mimic the controlled LEDs. October 2011  29 Fig.4: the Mosfet gate waveform (yellow) and drain voltage (green) as the Mosfet is being switched on. The Mosfet gate voltage rises at a rate determined by the current capability of the driver and its input capacitance, until it reaches the threshold voltage. At this point the Mosfet starts to turn on and its drain voltage drops but the gate voltage rise is temporarily halted due to the Miller effect. Once the Mosfet is fully on, the gate voltage continues to rise to the full drive voltage, reducing the channel on-state resistance to its minimum. high, the corresponding transistor collector goes low and vice versa. So we invert the signal again with CD4069 CMOS inverter ICs. Output drivers Each 4069 inverter drives a Mosfet gate via a 22 resistor. This resistor forms an RC filter with the Mosfet’s input capacitance, eliminating gate voltage spikes that could be caused by stray inductance in PCB tracks and component leads. For efficiency, it’s best to switch Mosfets gates rapidly, since during each switching transition the Mosfet is in a state of partial conduction and this increases the average dissipation. To achieve rapid switching, high current drive is needed to quickly charge and discharge the Mosfet’s gate capacitance. The output current of the 4069 inverter is typically about 8mA, much lower than a purpose-designed Mosfet driver. But this is mitigated by the low switching frequency (100Hz) and the relative low gate capacitance of the Mosfets we have specified of around 760pF (compared to 1960pF for an IRF540N or 5480pF for an IRF1405). Fig.3 shows a scope grab of the Mosfet gate and drain voltages during switching. The yellow trace is the gate voltage and the green trace the drain. The rise in gate voltage briefly halts as it reaches the on-threshold due to gate-drain (“Miller”) capacitance. Before and after the actual transition, the gate voltage slew rate is limited by gate-source capacitance; the sources are connected to ground. By adding up the positive and negative transition times (the latter is slightly longer than the former) we can see that the Mosfets spend around 2s switching every 10ms, ie, 0.02% of the time. This increases the Mosfet dissipation by a negligible amount compared to that due to their on-state 30  Silicon Chip resistance while carrying the load current. Note that Fig.3 shows the transition time for a light load; it is longer for higher currents since the Mosfet must be turned on harder. But even if this doubles the switching time, it’s still very short. The specified Mosfets have an on-resistance is around 0.1 and this is what ultimately limits LED string RMS current. At the rated 2.5A, dissipation for each Mosfet is around 0.1 x 2.5A2 = 625mW; much more than this and the TO-220 packages will get hot, since they do not have heatsinks. Since the full supply voltage is applied across the LED string when the associated Mosfet is on, each LED string needs to incorporate a current-limiting resistor or active current limiter. This limiter is usually incorporated in the string. As well as driving the outputs, the Mosfets also pull current through red indicator LEDs (LEDs1-8). These are powered from the 12V rail via 1k current limiting resistors. They are useful for checking and monitoring the operation of the device. Depending on the DC supply voltage, they are driven with 8-12mA each. Power supply DC power for the LED strings and driver circuitry is connected to CON9, another pluggable terminal block. A 10A inline fuse protects against a board fault, shorted output or current overload. The DC input can be 12V or 24V. Just remember that for a 24V supply, your 12V LED strings must be connected as series pairs. The power supply used need not be rated for the full 10A if your LED strings, when combined, will not draw that much. An easy and cheap way to get a high current (10A+) 12V DC supply is to use a spare computer power supply; see our article in the January 2011 issue of SILICON CHIP on how to modify one for standalone use. The 12V rail is derived from the DC supply by REG1, a standard 3-terminal 12V linear regulator with associated input bypass and output filter capacitors. It is protected from reversed supply polarity by diode D1. This does not protect outputs CON1-CON8 but since the connected LED strings act as diodes, they won’t conduct unless the supply polarity is correct anyway. If the DC supply is 12V, REG1 will be in dropout and so the nominally 12V rail will actually be a lower, unregulated voltage (around 10V). The Mosfets and their drivers operate normally under this condition. Regulation is only necessary to protect ICs3-4 and Q1-8 from damage in case the supply voltage is above 15V or 20V respectively. A green power LED across the 12V supply (again with a 1k current limiting resistor) indicates when supply voltage is present. On our prototype, it is on the front panel but it has been moved to the rear panel of the final version, to allow the output connectors to be spaced further apart. While this circuit has two power supplies (3.3V from the master unit and 12-35V for the LEDs), it does not matter in which order they are applied. If the master unit is powered up first, IC1 can switch transistors Q9-16 on but they will have no collector voltage and so the inputs of IC3 and IC4 will remain at 0V. Alternatively, if power is applied to CON9 before the master unit is switched on, LED9 will light but the inputs to IC3 and IC4 will remain high, as there will be no current from IC1 to turn on Q9-16. There will therefore be no gate siliconchip.com.au drive voltage for Mosfets Q1-8 and so they will remain off. Normal operation begins only when both the master and slave units are powered up. Construction All parts mount on a single 103 x 118mm PCB, coded 16110111. Referring to the overlay diagram (Fig.2), begin by installing the eight wire links using 0.7mm diameter tinned copper wire. If you have a double-sided board, like our prototype, these may be omitted. Next, install the resistors, checking the value of each with a DMM set to Ohms mode (since the colour codes can be hard to read). A standard lead bending jig can be used except for the eight 1k resistors adjacent to Mosfets Q1-Q8 which have a closer pad spacing. Follow with diode D1, orientating it as shown on the overlay diagram. Fit the four ICs next, paying careful attention to their orientation (IC2 faces the opposite direction to IC1 and IC3). If using the optional IC sockets, solder them in instead. The eight Mosfets and the regulator go in next (don’t get them mixed up!) First bend the TO-220 package’s leads down 90° about 6mm from the tab and then mount it with a 10mm M3 machine screw passing up from the underside of the board, with a shakeproof washers under the head and under the nut. This is vital since the output current passes through the mounting screws. Make sure they are fully tightened before soldering the leads or else you could damage the board. That done, install the eight BC549 transistors, cranking the leads out with small pliers to suit the pad spacing. The four MKT capacitors can go in next, followed by the three electrolytic capacitors, with their longer leads through the holes nearest the “+” signs on the overlay diagram. Don’t get the two different types mixed up. Then solder the fuse clips, taking care that they are pushed right down on the PCB and that the locating tabs go towards the outside. Follow with the nine right-angle terminal block sockets, ensuring that they are all flush against the board and perpendicular to its edges. If you installed the IC sockets earlier, plug in the ICs now, careful with their orientation. Fit the 10A fuse, then solder the two 8P8C (RJ-45) connectors in place, making sure they are flush with the PCB. The red LEDs go in next. Install them with the maximum lead length possible, with just enough through the bottom of board to solder to. In each case, the longer lead goes through the hole towards the bottom of the PCB. For the green LED, first bend its leads by 90° 5mm from the lens. Check its correct orientation before doing so (its longer lead also goes towards the bottom). Solder it so that the horizontal portion of the leads is 4mm above the surface of the PCB. Parts list – LED Slave for Digital Lighting Controller 1 PCB coded 16110111, 103 x 118 mm 1 ABS plastic enclosure, 140 x 110 x 35mm (Jaycar HB5970, Altronics H0472) 1 front panel label 1 rear panel label 2 low profile PCB-mount RJ-45 sockets (Altronics P1448 or similar) 9 PCB-mount 2-way horizontal pluggable terminal blocks, 5.08mm pitch (Jaycar HM3102, Altronics P2592) 9 2-way pluggable terminal block sockets, 5.08mm pitch (Jaycar HM3122, Altronics P2512) 2 M205 fuse clips 1 M205 10A fuse 9 M3 x 10mm machine screws and nuts 18 M3 shakeproof washers 4 No.4 x 9mm self-tapping screws 1 200mm length 0.7mm diameter tinned copper wire 1 16-pin DIL socket (optional) 3 14-pin DIL sockets (optional) Semiconductors 1 74HC595 octal serial-to-parallel latch IC (IC1) 1 74HC04 hex inverter IC (IC2) 2 CD4069 hex inverter ICs (IC3, IC4) 1 7812 12V 1A linear regulator (REG1) 8 STP16NE06 or MTP3055E Mosfets (Q1-8) 8 BC549 NPN transistors (Q9-16) 1 1N4004 1A diode (D1) 8 3mm red LEDs (LEDs1-8) 1 3mm green LED (LED9) Capacitors 2 100F 16V electrolytic 1 47F 50V electrolytic 4 100nF MKT Resistors 8 1M 8 47k 9 1k 4 100 5 10k 8 22 Assembly The next step is to make the cut-outs and holes for the front and rear panel, using Fig.5 as a guide. The easiest way is to photocopy or download and print the diagrams, then cut them out (including the holes, using a sharp hobby knife or a leather punch) and glue or tape them to the panels. Use a 3mm drill to make the nine LED holes. For the Resistor Colour Codes o o o o o o siliconchip.com.au No. 8 8 5 9 4 8 Value 1MΩ 47kΩ 10kΩ 1kΩ 100Ω 22Ω 4-Band Code (1%) brown black green brown yellow purple orange brown brown black orange brown brown black red brown brown black brown brown red red black brown 5-Band Code (1%) brown black black yellow brown yellow purple black red brown brown black black red brown brown black black brown brown brown black black black brown red red black gold brown October 2011  31 B B 4.5 4.5 4 4 5 5 23.5 23.5 + + A A ON ON – – 48 48 10 10 12 12 23.5 23.5 12 12 CONTROL IN CONTROL OUT CONTROL IN CONTROL OUT POWER IN POWER IN 12 12 15.5 15.5 132 132 12 12 12 12 A A 12 12 12 12 12 12 29 29 5 5 3.5 3.5 Fig.5: the drilling template and panel labels for the front panel (top) and 2 2 rear of the case (bottom). These can be photocopied or downloaded as a PDF from the SILICON CHIP website and printed out. Print them onto transparency film or print onto paper and laminate them to make durable labels. (FRONT PANEL) (FRONT PANEL) 16 16 15.5 15.5 12 12 23.5 23.5 5.5 5.5 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 8 8 C C + + – – + + – – + + – – + + – – + + – – (REAR PANEL) + + – – + + – – + + – – 29 2 29 2 8.5 8.5 5 5 (REAR PANEL) ALL CIRCULAR HOLES ARE 3.0mm IN DIAMETER NOTCHED RECTANGULAR HOLE 'B' IS 8.5 x 12.0mm + 2 x 2 mm NOTCH ALL CIRCULAR HOLES ARE 3.0mm IN DIAMETER NOTCHED RECTANGULAR HOLE 'B' IS 8.5 x 12.0mm + 2 x 2 mm NOTCH RECTANGULAR HOLES 'A' ARE 15.5 x 12mm NOTCHED RECTANGULAR HOLE 'C' IS 8.5 x 96mm + 8 x 2 x 2mm NOTCHES NOTCHED RECTANGULAR HOLE 'C' IS 8.5 x 96mm + 8 x 2 x 2mm NOTCHES RECTANGULAR HOLES 'A' ARE 15.5 x 12mm ALL DIMENSIONS ARE IN MILLIMETRES ALL DIMENSIONS ARE IN MILLIMETRES rectangular cut-outs, drill a series of small holes around the outside of each (but within the outline), knock the remainder out and then file the edges smooth. For the largest cut-out, use a large flat file to start with and then needle files to finish the corners. The smaller cut-outs can be shaped entirely with needle files. Go slowly since it’s easy to make holes too big in the soft plastic. Check that the PCB connectors fit through the holes and then test fit the pluggable terminal blocks. If one doesn’t fit, the notch may need to be enlarged. Then remove the drilling templates and prepare panel labels. These can be laminated paper or labels printed onto transparency film. Cut out the holes using a sharp knife and then glue the labels in place. The bottom of the case has eight moulded plastic posts. The PCB attaches to the four outer ones but the inner posts would interfere with solder joints so remove them using side-cutters or a file. Then fit the panels at both ends of the PCB and lower the assembly it into the case, fixing in place with four self-tapping screws. Plug in the nine terminal blocks and attach the lid and the unit is complete. outputs, supply the appropriate voltage and check that everything is working as expected. Testing RGB LEDs Apply 12V or so to the supply connector, observing the marked polarity. The green LED should light. Check that the current draw is around 15mA. If it is significantly more then switch off and check the board for faults. Connect the slave’s control input to the master unit and play the test sequence (see the Digital Lighting Controller articles, October-December 2010). With the slave powered up, the red LEDs should show the expected patterns. Ensure that they all light and that their brightness varies correctly. Don’t forget to set up the DC slave in the configuration file. Assuming this is the first/only slave attached, it should contain these lines: As well as single-colour LEDs. the LED slave can be used with common anode RGB LED strips (eg, Jaycar ZD-0478). Connect the three cathodes (red, green and blue) to the negative output terminals of separate channels (ideally, consecutive channels). Connect the common anode to any of the three corresponding positive outputs. The sequence then determines the colour of the LEDs; by turning two or three outputs on at once, with varying brightness, a wide range of colours can be produced. The PC software can be configured to display the channels as red, green and blue as appropriate (see the December 2010 issue for more information on how to use this software). Since each RGB LED strip takes up three channels, you can drive up to two strips with a single slave (leaving two spare channels), five strips from two slaves (with one spare channel), eight strips from three slaves and ten strips from four slaves (with two spare channels). SC triac turnoff 1 = delayed slave type 1 = DC You can then remove power, attach LED strings to the 32  Silicon Chip Using it For reliable operation, ensure that the current ratings are not exceeded. These are specified as RMS figures since the light output will be constantly changing. The peak current can briefly exceed these limits. While each channel can deliver 2.5A RMS, the incoming supply current is limited to 10A RMS and so you can’t drive all eight channels at this current simultaneously (8 x 2.5A = 20A). If the total driven LED current can exceed 10A, be careful that it only does so briefly if at all. The fuse limits the peak supply current. While a 10A fuse will not blow immediately at say 15A, repetitive excursions far above its rated current can weaken the fuse wire and eventually lead to failure. A slow-blow fuse provides more leeway. Even so, it’s best to keep the peak current to a reasonable value (say, about 15A for one second) to avoid overheating and damaging the PCB tracks. siliconchip.com.au