Silicon ChipDigital Lighting Controller For Christmas Light Shows, Pt.2 - November 2010 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: The NBN is looking more like a white elephant
  4. Feature: Broadband Radar: A Quantum Leap Forward by Kevin Poulter
  5. Project: Build A Hearing Loop Level Meter by John Clarke
  6. Project: Digital Lighting Controller For Christmas Light Shows, Pt.2 by Nicholas Vinen and Jim Rowe
  7. Project: An RFID Security System by Jeff Monegal
  8. Project: A High-Quality DAB+/FM Tuner, Pt.2 by Mauro Grassi
  9. Project: Ultrasonic Anti-Fouling Unit For Boats, Pt.2 by Leo Simpson
  10. Review: Altium Designer & the Nanoboard 3000 by Mauro Grassi
  11. Vintage Radio: Traeger’s first pedal radio & other replicas by Rodney Champness
  12. Book Store
  13. Advertising Index
  14. Outer Back Cover

This is only a preview of the November 2010 issue of Silicon Chip.

You can view 37 of the 112 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 "Build A Hearing Loop Level Meter":
  • Hearing Loop Level Meter PCB pattern (PDF download) [01111101] (Free)
  • Hearing Loop Level Meter panel artwork (PDF download) (Free)
  • Hearing Loop Tester/Level Meter PCB [01111101] (AUD $10.00)
Articles in this series:
  • Build A Hearing Loop Level Meter (November 2010)
  • Build A Hearing Loop Level Meter (November 2010)
  • Build A Hearing Loop Level Meter, Pt.2 (December 2010)
  • Build A Hearing Loop Level Meter, Pt.2 (December 2010)
Items relevant to "Digital Lighting Controller For Christmas Light Shows, Pt.2":
  • Digital Lighting Controller LED Slave PCB [16110111] (AUD $20.00)
  • Digital Lighting Controller Slave Unit PCB [16110102] (AUD $25.00)
  • dsPIC33FJ64GP802-I/SP programmed for the Digital Lighting Sequencer/Controller [1611010A.HEX] (Programmed Microcontroller, AUD $25.00)
  • Firmware and PC software for the Digital Lighting Controller [1611010A.HEX] (Free)
  • Digital Lighting Controller LED Slave PCB pattern (PDF download) [16110111] (Free)
  • Digital Lighting Controller Master PCB pattern (PDF download) [16110101] (Free)
  • Digital Lighting Controller Slave PCB pattern (PDF download) [16110102] (Free)
  • Digital Lighting Controller master unit front panel design (PDF download) (Panel Artwork, Free)
  • Digital Lighting Controller mains slave unit front panel design (PDF download) (Panel Artwork, Free)
Articles in this series:
  • Digital Controller For Christmas Light Shows (October 2010)
  • Digital Controller For Christmas Light Shows (October 2010)
  • Digital Lighting Controller For Christmas Light Shows, Pt.2 (November 2010)
  • Digital Lighting Controller For Christmas Light Shows, Pt.2 (November 2010)
  • Digital Lighting Controller For Christmas Light Shows, Pt.3 (December 2010)
  • Digital Lighting Controller For Christmas Light Shows, Pt.3 (December 2010)
Items relevant to "A High-Quality DAB+/FM Tuner, Pt.2":
  • Software for the DAB+ Tuner (Free)
Articles in this series:
  • A High-Quality DAB+/FM Tuner, Pt.1 (October 2010)
  • A High-Quality DAB+/FM Tuner, Pt.1 (October 2010)
  • A High-Quality DAB+/FM Tuner, Pt.2 (November 2010)
  • A High-Quality DAB+/FM Tuner, Pt.2 (November 2010)
  • A High-Quality DAB+/FM Tuner, Pt.3 (December 2010)
  • A High-Quality DAB+/FM Tuner, Pt.3 (December 2010)
Items relevant to "Ultrasonic Anti-Fouling Unit For Boats, Pt.2":
  • ETD29 transformer components (AUD $15.00)
  • Ultrasonic Anti-Fouling Unit front panel design (PDF download) (Panel Artwork, Free)
Articles in this series:
  • Ultrasonic Anti-Fouling Unit For Boats, Pt.1 (September 2010)
  • Ultrasonic Anti-Fouling Unit For Boats, Pt.1 (September 2010)
  • Ultrasonic Anti-Fouling Unit For Boats, Pt.2 (November 2010)
  • Ultrasonic Anti-Fouling Unit For Boats, Pt.2 (November 2010)

Purchase a printed copy of this issue for $10.00.

Putting it together . . . DIGITAL LIGHTING CONTROLLER Part 2 – by Nicholas Vinen and Jim Rowe Everyone who has seen this has been pretty impressed . . . and no wonder! While we originally intended it to make your Christmas Lights display the best in your suburb, with up to 32 channels and total power limited only by your power outlets, it’s capable of controlling just about any lighting sequencing task you want to throw at it. Now we get on with the good stuff: putting it all together! W e introduced this new Digital Lighting Sequencer last month and already it’s created quite a stir. So how many budding Chevy Chase wannabes are there out there, anyway? This month we’ll go through the relatively simple construction of both master and slave units, testing them and then how to use them. We’ll start with the smaller of the two “boxes”, the Master Unit which has all the “smarts”. Master board construction Before assembly, check the copper side of the PC board for defects and that the holes are drilled correctly. Test the connectors for fit. If your board is not provided with the corners cut out to suit the case, you will need to file it to shape. First install the SD/MMC card socket, which goes on the copper side. Remove the dummy plastic “memory” card, then place the socket over the pads. Check that they all line up, then apply some solder to the two larger mounting pads. Ensure it is aligned and that it is sitting flat on the board – if required, re-melt the solder joints and adjust its position. Once it is in place, apply solder to the 13 remaining pads, ensuring that the solder flows properly onto both the Above is the master unit with a 128MB SD card in its reader. This is connected via a suitable length Cat5 cable . . . 26  Silicon Chip siliconchip.com.au pins and the pads. In the case of the Altronics socket, one of the mounting pads has two pins (one is ground) so make sure that the solder covers both. After that, install the wire links using either tinned copper wire or 0Ω resistors. Follow with the resistors as shown on the overlay, checking each value with a multimeter before installation. Then fit the four diodes, taking care with their polarity. Next is the 28 pin socket for IC1 with the notch orientated as shown on the overlay. Solder two diagonally opposite pins and then check that the socket is sitting flat on the PC board before soldering the rest. Then straighten the pins of the TL072 IC and solder it in place, oriented as shown. Using small pliers, bend the legs of the LM3940 regulator down at right angles 6mm from the tab. Attach it to the board using a 6mm M3 machine screw, shakeproof washer and nut. Once it is firmly mounted, solder the leads and then trim them. After that, mount the 3.5mm stereo socket. Ensure its pins are straight before inserting it and check that it sits flat before soldering them. Fit the MKT and ceramic capacitors next. Polarity does not matter but the values do, so check the overlay diagram as you go. Follow with the single tantalum capacitor. The positive lead is normally marked with an inked “+” on the plastic body, which lines up with the “+” on the overlay. Now install all the electrolytic capacitors except the largest (2200F). The 4.7F non-polarised capacitor can go in either way but the rest must have their longer leads (+) through the hole marked “+” on the overlay. Install the 7806 regulator next, using the same procedure as for the LM3940 but before you insert the M3 machine screw, slip the small heatsink between the regulator and the PC board. Thermal grease is not required. Make sure it stays straight as you tighten the bolt, otherwise it may touch the large capacitor which will be adjacent to it. Unless the 2200F capacitor lies flat it is too tall to fit in the box. Bend its leads down about 2.5mm from its base, keeping in mind its final orientation (as shown by the + symbol on the overlay). Push it flat against the board, solder it in, then run a thin bead of neutral-cure silicone sealant or hotmelt glue along the side closest to the board edge to hold it in place. Now fit the crystal adjacent to IC1. Its orientation does not matter but avoid heating its leads too much. Next install the DC socket, ensuring that it is flush against the PC board and is at right angles with the board edge in both planes. Follow with the RJ-45 socket – push its plastic posts into their holes, then carefully solder the eight pins without bridging them. If you do manage to create a solder bridge, it can be cleaned up with solder wick. The green LED is installed at rightangles to the PC board and in line with the edge. Bend its leads 6mm from the body, using the overlay as a guide as to the final orientation – the flat side should be lined up as shown. Solder it so it sits 7mm above the board surface. The infrared receiver needs its leads bent twice. With the dome of the lens at the front, bend the leads 90° backwards 1mm from the component body, then back in the opposite direction 7mm from the first bend, forming a “Z”-shape. Push the remaining leads all the way through the PC board before soldering them so that the 7mm section rests on the top. Testing the master board Before installing IC1, check that the power supply is working. Temporarily connect a 9V AC plugpack to the power socket and measure the output (rightmost pin) of both regulators relative to the tabs – they should be close to 6V and 3.3V. Assuming they are OK, remove the power supply and wait a few seconds, then install the microcontroller (IC1), being careful to line up its notch with that on the socket. Re-apply power and the green LED should flash twice then continually ramp its brightness up and down. This tells you that the microcontroller and its zero crossing detection circuitry are working. If the LED does not flash, check that IC1 has been programmed correctly and the crystal is correctly installed. If it does not pulsate, check the passive components in the zero crossing detection circuit. Assuming all is OK, place a WAV file (in the standard PCM format, eg, from a CD) on an otherwise blank . . . to the slave unit, which contains the drive circuitry for the lights. Up to four slave units can be connected in series, giving a total of 32 channels. For a full explanation, see last month’s intro. siliconchip.com.au November 2010  27 Digital gnithgiLighting L latigiD rSequencer ecneuqeS 012010 02 © © 10101161 16110101 10k 10F CON1 LED1 9V AC IN (RJ45 TYPE II) TO SLAVE MODULE(S) memory card and plug it in. The green LED should go out (it may flash twice first) and after a few seconds it should turn on fully. If so, connect the audio output socket to an amplifier (eg, using a 3.5mm to RCA cable) with the volume turned down then slowly turn the volume up. If you hear the audio being played then the card, socket and audio output are all operating correctly. If the LED is on but there is no sound, check the audio output circuitry. If the LED does not turn on as described then there may be a problem with the soldering on the card socket. 28  Silicon Chip (UNDER) 15nF IRD1 CON4 SD/MMC SOCKET If LED flashes repetitively in a pattern, this indicates that the software has encountered an error – see the table of error codes towards the end of the article. Completing the master module Snap the front panel off the box and cut and drill it as shown in Fig.5. A photocopy or print-out of this template can be temporarily glued onto the panel as a drilling aid. For the round holes, drill a small pilot hole in the centre and then expand it using a series of larger drill bits, then de-burr it using a larger drill bit. This 10k 13k 10k R T CON2 S AUDIO OUT 150pF 15nF 10k 100 100 100 CON3 13k 10k 150pF NP 4.7F 3.0k 220 10k 10k 10k D1 D2 4004 27k + 10F 10F 4004 100nF 100nF 100 + 4004 10k IC2 TL072 + D3 100 10k 10F 10F 100nF 100 D4 10k 13k 47k 100nF 4004 10k X1 33pF 24.576MHz 13k 33pF 10k 100 + + 470F 100F IC1 dsPIC33FJ64GP802 + 470F 100F + 1nF + 2200F (LAID OVER) + REG1 7805 CS SC 100nF REG2 LM3940 -3.3 Fig.4: here’s the component overlay for the master unit, with a matching photo underneath. Two points to note: (a) the SD card socket is mounted on the underside of the PC board, and (b) the 2200F capacitor is mounted lying down on the PC board, with some hot melt glue or silicone sealant to hold it in place (after soldering!). We strongly suggest you use a socket for the microcontroller at least – it makes testing and trouble-shooting a whole lot easier. Note that there are some minor differences between the early prototype PC board at left and the component overlay above. ensures that the holes remain round and clean. For the larger rectangular hole, mark the outline using a sharp knife and then drill a series of closely spaced 3mm holes around the inside of the outline, then cut the remaining plastic to knock out the centre section. Use a needle file to clean up the edges and slowly expand the opening until the connector fits neatly. The card slot can be made using a similar technique but the holes must be small (eg, 1.5-2mm) to avoid going outside the outline. Once the slot has been filed to a rectangular shape you siliconchip.com.au Fig.5: samesize diagram showing the holes and cut-outs for the master unit. The photo below shows the same thing, this time assembled. 20 19 A 13.5 26 5.75 15.5 3.5 11.25 17 B C B 15.5 15.75 ALL DIMENSIONS IN MILLIMETRES may need to slightly elongate it in one direction or the other after the case is assembled to suit the alignment of the card socket. Now mount the PC board in the case. It is attached to the lid’s integral plastic stand-offs with nylon washers between them, so that the memory card can clear the lip on the lid. Place the Nylon washers atop the standoffs then lower the PC board on top without knocking them off. Attach the board using the specified self-tapping screws. If you can’t get the board on with the washers staying in place, you can glue them to the underside of the board with a dab of hot-melt glue or other adhesive. They must be slightly offset from the centre of the holes so they do not extend out past the board’s corner cut-outs. With the board installed, one further cut-out must be made to the base lip. The specified RJ45 socket is quite tall and requires a notch, as shown in the close-up photo. Gently trim away the plastic using side-cutters and clean it up using a file. Care must be taken to avoid cracking the case or scratching the panel – the lip itself is hidden by the front panel when it is installed. At this point, with the lid in place, the front and rear panels can be snapped on and the master module is complete. Note that when attaching the front panel you will need to lever it in place – clip on the edge with the RJ45 cut-out first. In doing so be careful that the LED fits through the hole, otherwise its leads will be bent. Also check that the infrared receiver sits properly behind siliconchip.com.au 13.25 10 20 14.5 HOLE A: 6.0mm DIA. HOLES B: 5.0mm DIA. HOLE C: 5.5mm DIA. its hole with the front panel is in place. Once you have confirmed that all the cut-outs are correct and the front panel fits properly you can stick the label in place. If it is not adhesive (eg, if you have printed and laminated it) it can be attached with a thin smear of silicone sealant. Slave board construction Again, check the copper side of the board, then install the wire links. There are ten in the low voltage (bottom) section and these can be made from tinned copper wire or 0 resistors. The eight links near the Triacs are at mains potential, so they must be insulated. Cut eight 11mm lengths of the 2.5mm or 3mm fibreglass sleeving and slip each over a 20mm length of tinned copper wire. Bend the ends of the wire to form 11.5mm wire jumpers and then solder them in place. When that is finished, install all the resistors. Use the colour code table provided and/or check each with a multimeter before installation to be sure that they are the correct value. Next fit the three ICs and eight optocouplers. The ICs all have different pin counts so it is hard to mix them up but be careful with their orientation (see the overlay diagram). Straighten the leads and press each IC down as far as it will go before soldering it. The orientation of the optocouplers is critical so be sure to install them with the notch towards the left side of the board, as shown on the overlay. Now solder the two low-voltage MKT capacitors (at the bottom left) and the two electrolytic capacitors. The longer lead of each electro goes into one of the two holes near the “+” symbol. After that you can install the terminal blocks, with the openings facing towards the nearest edge of the board. Follow with the X2 capacitors, then the two RJ45 connectors. They are installed in the same manner as with the master board. Ensure they are pressed down fully before soldering them. The eight red LEDs are next but first their leads must be bent at right angles 7mm from the lens. The anode (the longer lead) must go towards the right edge of the board, so bend them in the correct direction to achieve this. The horizontal portion of the leads go 16mm above the board surface. A 16mm-wide strip of cardboard can be cut to assist in positioning them. Fit the Triacs to the heatsinks in pairs – one on either side. Insert a 10mm x M3 screw through one tab, then the heat sink, then the other tab and secured with a shakeproof washer and M3 nut. Do them up tightly. As before thermal grease is not necessary This notch needs to be cut in the case to accommodate the RJ-45 socket. Cut it as neatly as you can but don’t worry too much if your skills aren’t up to scratch: it’s hidden by the front panel. November 2010  29 The assembled slave unit, ready to be wired (as shown later) and fitted to its case. Never be tempted to work on the PC board with power applied – always have the lid on the case. At right is Fig.6, the component overlay for the slave unit. but may be used if desired. Note that the tabs on these devices are insulated – do not substitute other Triacs! Once each Triac/heatsink assembly is complete, push the leads through the holes in the PC board until the heatsinks are right against the board, then flip it over and solder the two thick posts to hold the assembly in place. Because the heatsinks are quite large you will need to use a large tip and/or high temperature for this job. When the heatsinks are in place you can then solder and trim the Triac leads. Now fit the toroidal inductors. Push each pair of leads through the board as far as they will go then solder and trim them. Finally, install the earth lug. If you spade terminal is double-ended, cut one end off first with a pair of sturdy side-cutters. Place a shakeproof washer over an M3 x 10mm machine screw and insert it through the earth mounting hole from the copper side. 30  Silicon Chip Place the lug over the shaft, then an M3 nut. Tighten it, with the lug orientated so that the cable won’t interfere with any components. Add a second nut on top (to act as a locknut) and do it up firmly too. Testing the slave module Test the low voltage section of the slave module before installing it in the case. Download the test data from the SILICON CHIP website (1611010T.zip) and extract it into the root directory of a blank memory card. With the master module power disconnected, connect the slave board to it using a short Cat5 cable. Make sure the slave board is resting on a nonconductive surface and check that you have plugged the cable into the correct (control input) connector. Plug the card into the master module and apply power – do not connect the slave module to mains! After a brief delay, you should see the LEDs on the slave module light up in turn for two seconds each. This repeats, then after a ten second delay, it goes into a loop where each LED fades in and out in turn. If some of the LEDs do not light, check the corresponding LED, optocoupler and current limiting resistor for errors. If none of the LEDs light then there is a problem around one of the digital logic ICs or one of the RJ45 connectors. Slave module assembly Now prepare the front panel, using Fig.9 as a guide. As with the master module, the round holes can be drilled while the others can be made by drilling a series of holes within the outline, knocking the centre out and filing them to shape. Be careful to make the IEC connector cut-out accurately as a tight fit will ensure that it can’t come loose. After that, attach the front panel label. For maximum protection from grubby fingers, we suggest it be lamisiliconchip.com.au 100nF 10k 10k 470 360 47nF 275VAC 100nF 275VAC 39 + IC2 TRIAC8 BTA41 74HC04 IN 47 Aout8 Aout7 OPTO7 MOC3021 TRIAC7 BTA41 10k (RJ45 TYPE II) CON2 100 360 47 100 47nF 275VAC 470 100 OUT 100 100nF LED1 A IC1 74HC595 470 360 47nF 275VAC 10nF 275VAC 100nF 275VAC 100nF 275VAC 39 LED2 A Aout6 Aout5 OPTO5 MOC3021 LED4 A 47nF 275VAC 470 LED5 A 470 360 47nF 275VAC 39 10nF 275VAC 10nF 275VAC 39 100nF 275VAC 100nF 275VAC LED6 A L4 100 H 5A OPTO4 MOC3021 L5 100 H 5A LED3 A TRIAC5 BTA41 360 47 TRIAC4 BTA41 47 LED7 A Aout4 Aout3 OPTO3 MOC3021 360 10nF 275VAC 100nF 275VAC 470 10nF 275VAC 100nF 275VAC 47nF 275VAC TRIAC2 47 39 470 39 L2 100 H 5A 20101161 0102 © L ORT N O C G NIT H GIL DRA O B H CTI WS OPTO2 MOC3021 47nF 275VAC L3 100 H 5A LED8 A TRIAC3 BTA41 360 47 BTA41 NOTE: ALL TRACKS AND COMPONENTS IN THE PINK SHADED AREA OPERATE AT MAINS POTENTIAL. CONTACT COULD BE FATAL! Aout2 Aout1 TRIAC1 EARTH 360 BTA41 47nF 275VAC 470 L1 100 H 5A OPTO1 MOC3021 47 10nF 275VAC TRIAC6 BTA41 47 ULN2803 39 L6 100 H 5A OPTO6 MOC3021 10k L7 100 H 5A 10k IC3 10nF 275VAC L8 100 H 5A 100 F 100 F CON1 (RJ45 TYPE II) + OPTO8 MOC3021 39 10nF 275VAC 100nF 275VAC ACTIVE INPUT nated and glued on using a thin layer of silicone sealant – or it can be printed on adhesive-backed paper. With the label in place, the IEC connector can be snapped in. Make sure it is the correct type, designed for mounting on a 1.5mm panel, or else siliconchip.com.au it will not be secure. If is it all sloppy in the cutout, we suggest a couple of dobs of suitable glue around the edges (inside) to keep it tight. Then push the LEDs and RJ45 connectors on the main board through the front panel and lower the whole assembly into the plastic case, with the front panel in its recess. If your case has a vent in the bottom, orient the board so that this vent is towards the front (low voltage) end. Screw the board onto the plastic risers using self-tapping screws. November 2010  31 55mm 55mm LINK BETWEEN N TAG ON IEC MALE CONNECTOR & SWITCH TAG S1 45mm 45mm LINK BETWEEN FUSE TAG F2 ON IEC MALE CONNECTOR & SWITCH TAG S2 90mm 90mm 90mm 120mm 90mm 90mm 90mm 200mm BLUE SPADE CONNECTORS ARE LARGER TYPES TO ALLOW TWO WIRES TO BE INSERTED 150mm WIRE BETWEEN SWITCH TAG S4 ON IEC MALE CONNECTOR & 'ACTIVE INPUT' TERMINAL BLOCK ON PC BOARD 90mm 90mm 90mm 120mm 90mm 90mm 90mm 80mm 80mm 170mm E ON IEC OUTPUT 1 E ON IEC OUTPUT 3 E ON IEC E ON IEC OUTPUT OUTPUT 5 7 E ON IEC OUTPUT 8 E ON IEC OUTPUT 6 E ON IEC E ON IEC EARTH LUG OUTPUT OUTPUT FOR REAR 2 PANEL 4 E TAG ON IEC MALE (MATES WITH SPADE LUG ON PC BOARD) 80mm TO Aout7, Aout5, Aout3 & Aout1 TERM BLOCKS ON PC BOARD FOUR OF THESE LEADS, TO CONNECT TO 'A' LUG OF IEC OUTPUT 7, IEC OUTPUT 5, IEC OUTPUT 3 AND IEC OUTPUT 1 FOUR OF THESE LEADS, TO CONNECT TO 'A' LUG OF IEC OUTPUT 8, IEC OUTPUT 6, IEC OUTPUT 4 AND IEC OUTPUT 2 45mm TO Aout8, Aout6,Aout4 & Aout2 TERM BLOCKS ON PC BOARD NOTE: ALL FEMALE SPADE CONNECTORS HAVE INSULATION SLEEVES Fig.7: you’ll need to make up a set of cables with spade connectors, as shown, to complete wiring the slave unit. Both the cables and spade connector sleeves should be the same colours as shown here to ensure there are no mixups between active, neutral and earth wires. (The blue sleeves allow for two wires). Now prepare the rear panel. If you are building the module from a kit, the rear panel may be supplied pre-cut. Otherwise, cut a piece of 2mm thick aluminium (or 1mm steel) to shape as shown in Fig.9. The eight cut-outs are best made using a nibbling tool. To accurately nibble the cut-outs, print or photocopy the template, glue it to the panel (spray glue is ideal) and nibble out the holes to the lines on the template. Use a file to clean up the holes and remove any burrs. At the same time, drill the seventeen holes and de-burr them with a larger drill. Once everything fits, peel off the temporary label and clean with solvent (metho) if necessary. Then install the eight connectors using 10mm M3 machine screws, shakeproof washers and nuts. You may have noticed that we used snap-in female IEC connectors in our prototype but specified screw-mount types in the part list. This is because the snap-in connectors can easily fall out when used on a panel this thick (necessary due to the amount of metal removed for the connectors). Screw-mounted IEC connectors are much safer in this application. Now cut 250VAC-rated wire to length and attach crimp connectors as shown in Fig.7. To ensure the wires can not come loose, you must use a ratchet-type crimping tool. Be sure to use the connectors with the correct colour, as shown, since they are designed for different thicknesses of wire (the blue connectors are designed for thicker wire so are suitable for joining two smaller diameter wires). Complete the slave module wiring using Fig.8 as a guide. You may need to bend some of the spade terminals on the IEC connectors upwards to get the wires past the inductors. If so, bend them carefully using pliers, to the minimum extent possible, so that the insulated connectors still cover the exposed metal. Be sure to plug the connectors in all the way so they can’t come loose. The rear panel earth lug is attached using a 10mm M3 screw. Pass it through from the rear then place a shakeproof washer on the shaft, then the eyelet lug, another shakeproof washer and two nuts which are tightened very firmly. If there is any coating on the rear panel, it must be scraped away around Notes and Errata from Part 1: We have produced an alternative PC board for the master module to suit the Jaycar PS0024 surface mount memory card socket, coded 16110103. It can be downloaded from the SILICON CHIP web site. Also, the parts list published last month omitted the following parts: 1 1 2 2 2 28-pin DIP socket mini TO-220 heatsink (Jaycar HH8502, Altronics H0630) 6mm M3 machine screws M3 shakeproof washers M3 nuts 32  Silicon Chip It is a good idea to use a socket for the microcontroller in case it needs to be removed for re-programming. Regarding the RJ45 sockets specified, there are several sockets with similar pin configurations that should theoretically work but we have not tested them. While the ones we specified are “Type II” (ie, the pins are at the top), “Type I” (with the pins at the bottom) should also work as long as you use the same type on all the modules. We have only tested the connectors specified in the parts list so if in doubt, stick with those. siliconchip.com.au REAR PANEL OUTPUT 5 OUTPUT 3 E E E A A N A N IEC FEMALE CONNECTORS OUTPUT 1 E A N N OUTPUT 8 OUTPUT 6 OUTPUT 4 OUTPUT 2 E E E E A N + WARNING! This is a mains-operated device. Construction should not be attempted unless you have knowledge of and experience in building mains-powered projects. The slave unit has areas of the PC board where components and tracks are at mains potential. Contact with live wiring could prove fatal. Aout1 N Aout2 Aout6 Aout7 Aout8 A N Aout3 A N Aout4 A Aout5 CABLE TIES ACTIVE INPUT OUTPUT 7 + EARTH CON1 LED1 (RJ45 TYPE II) INPUT FROM CONTROLLER 20101161 0102 © L ORS4 T NO C G IL S3NIT H GF2 DRA O B H CTI WS CON2 LED2 LED3 LED4 LED5 LED6 LED7 LED8 (RJ45 TYPE II) S2 THROUGH TO OTHER SWITCH BOXES S1 N E IEC MALE CONNECTOR WITH FUSE & DPST SWITCH Fig.8: using the cables made up to suit (see Fig.7) here’s how to wire the slave unit. It’s easy if you make the cables the right lengths and terminate them with spade lugs, as shown. the earth lug hole to ensure a good electrical contact. Use cable ties to secure the wires so that they are held away from the components on the board and to prevent any wires from moving around and working their way loose. The lid can then be installed using the supplied machine screws. Finally, insert the two 10A fuses into the mains input connector (15A siliconchip.com.au for 115V mains). One is a spare. Final test First, a warning. Never plug the slave module into the mains without the lid in place. If you ever need to remove the lid, unplug the module first and before re-installing it, check that the mains wiring is secure and safe. The whole project can now be test- ed. Use the same files on the memory card and the same set-up as previously but this time connect some lights. ­For testing (which involves phase control), use 230V incandescent lamps only, not LEDs with a switch-mode supply. While it is unlikely that a switch-mode supply would be damaged by a brief period of phase control, it certainly won’t like it! Later, in use, LEDs with switchNovember 2010  33 Error flash codes    Remote control The default remote control codes for the master unit are set up initially for a Jaycar AR1726 (TV code 102) or Altronics A1012 (TV code 156) universal remote. We explain later how to customise the codes for other remotes. These are the available functions: Button    Command Description Play play Starts or resumes playback. Stop stop Stops playback. Pressing it twice will go back to the first file. Pause pause Pauses or resumes playback. Channel + next Goes to the next sequence/WAV file. Channel prev Goes to the previous sequence/ WAV file. Volume + volup Increase audio volume. Volume voldn Decrease audio volume. Fast forward forward Skip ahead 10 seconds. Rewind back Skip backwards 10 seconds. 1-9, 0 1, 2,…10 Jumps to the first, second, third etc sequence/WAV file on the card and starts it immediately. Playback will stop when it finishes. Power reset Stops playback and goes back to the first file. Record order Changes the playback order in this sequence: sorted, shuffle, directory, sorted. . . See “Configuration” for more details. mode supplies may be switched on and off using this sequencer but should never be dimmed or faded. Join the master and slave modules together, plug the slave module into mains and switch it on. Then apply power to the master module and check that the lights operate as expected. Using the controller While the photo last month shows the master module sitting on top of the slave module, in practice it is a good idea to separate them by at least 50cm and if possible, run them from separate mains outlets. The reason is that the 100Hz/120Hz Triac switching generates a fairly significant amount of EMI (electromagnetic interference). The LC filter at each output reduces but does not eliminate the radiation. Most of the emissions are from the cabling between the controller and the lights. As a result, if the master module 34  Silicon Chip If something goes wrong, the master module flashes its LED in a pattern. This pattern involves a specific number of slow and fast flashes which repeat after a delay. To determine what has gone wrong, count the flashes and then look them up in the following tables: No of      When error occurred Slow flashes 1 2 3 No of Fast flashes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 While re-programming the main program While re-programming the bootloader During operation (in the main program)         Meaning Failed to initialise memory card after 3 attempts FAT file system not recognised Could not find root directory Re-programming completed but verify failed HEX file read error HEX file format invalid Failed to detect valid mains frequency Unexpected error while re-flashing bootloader Memory card indicates wrong supply voltage Memory card command time out Configuration file contains invalid line(s) No sequences found on memory card Invalid WAV file on memory card Unsupported WAV file format detected Memory card file read error is too close to a slave module then a buzzing sound can be coupled into the audio output. By keeping the modules physically separated and also separating the mains wiring this effect is minimised. Creating sequences In order to create a truly spectacular light show you need to make a sequence for each piece of music. We have supplied a sample sequence along with a public domain Christmas song which you can download from the SILICON CHIP website. To create your own sequence you will need to download and install our Windows sequencing software. The first step in creating a sequence is to open a WAV file. Select the File->New command and you will be prompted to select the WAV file. At this point blank sequence is created. From top to bottom, the application window is separated into the following sections: menu, toolbar, audio display, sequence display and light status bar. The menus give you access to all functions while the toolbar provides more convenient access to the most commonly used function. Move the mouse over a toolbar button and leave it there to display a “tooltip” which explains what that button does. Buttons which can not be used are “greyed out” and in this case the tooltip will explain why. The tooltips also indicate the shortcut key combination (if available) to activate that function. Below the toolbar is a representation of the WAV audio data, shown as it would be on an oscilloscope. If you place the mouse cursor over that section, the scroll wheel (or menu/ toolbar functions) can zoom in and out. Right-clicking or right-dragging the mouse will scroll the display, as will moving the scrollbar at the bottom of the window. You can get a feel for how the audio display works by pressing the “play siliconchip.com.au siliconchip.com.au B B FRONT PANEL REAR PANEL 38 10 B 12 12 24 24 18 18 6 6 B B 10 15.5 10.5 16 17.5 HOLES B: 3.0mm DIAMETER 32 40 32 40 28 45 12 12 24 24 32 40 32 40 18 18 15.5 A 10 A 6 6 A 10 45 HOLES A: 5.0mm DIAMETER B B Fig.9: same-size diagrams show the cutouts and holes required for the rear panel (left) – all IEC connectors, and the front panel (right) with cutouts for the RJ45 plugs, the IEC mains connector/ fuseholder/ switch and holes for eight LEDs. November 2010  35 10 A B 14 B 5 CL A 5 A 10 B 14 B A 10 12 12 24 24 A 10 61 32 40 32 40 18 18 25.5 6 6 B B 24.5 45 10 B 12 12 24 24 32 40 32 18 18 27 46 6 6 ALL DIMENSIONS IN MILLIMETRES 28 B 40 6 6 6 B B Configuration The master module’s default behaviour should be adequate for most users. You just need to load your music and sequence files onto the memory card, plug it in and switch it on. However, some users may want to alter the master unit’s behaviour. To do so, place a text file in the root directory of the memory card and rename it to “Light Controller.cfg”. In Windows, it can be edited by opening Notepad and dragging this file into the main window. In this file, each option is written on a separate line, with the option name on the left, then an equals sign (“=”), then the value for that option. The possible options are as follows, with the default shown in bold italics: start playback automatically = yes, no If yes, the first file on the card is played immediately. Otherwise playback must be started via the remote control. start file = “filename” If set, the file of the name specified will be the first played. Otherwise the first file found is used. default file order = sorted, shuffle, directory If set to sorted, files will be played in alphabetical order. If set to shuffle, files will be played in a randomised order. Otherwise, files will be played in the order that they are stored. default volume = 100% Allows you to reduce the initial volume. It is better to use an external volume control if possible. default repeat all = yes, no If set to yes, when the last file finishes playback will start again at the first. Otherwise playback will stop. filament preheat amount = 20 The fraction of full power to use for the filament preheat. It is a number between 0 and 255, where 255 means full power. The default should suit most incandescent lamps. filament preheat <slave> = yes, no Controls filament preheating on a per-slave basis. <slave> is replaced with the slave number between 1 and 4. Slave 1 is the slave closest to the master module. filament preheat <slave>:<channel> = yes, no Controls filament preheating on a per-light basis. <channel> is replaced with the channel number between 1 and 8. triac turnoff <slave> = immediate, delayed If set to delayed, the trigger pulses for the specified slave will be held until the end of each mains half cycle. Read the section on delayed turnoff before using this option. triac turnoff <slave>:<channel> = immediate, delayed As above but allows control on a per-channel basis. remote code <command> = RC5(0x????) or NEC(0x????) Allows the unit to be configured for different remote controls. See “remote control configuration” for more information. infrared logging = off, on If set to on, the unit will log all infrared activity to a file. This assists with reconfiguring the codes. Here is an example configuration file: default file order = shuffle filament preheat 1:7 = off filament preheat 1:8 = off triac turnoff 1:3 = delayed triac turnoff 1:4 = delayed file” button with speakers or headphones connected to the computer. Below the audio data display are the sequencer light states, which scroll together with it. The brightness of each horizontal strip represents the brightness of the light as time passes. By clicking on a portion of the audio data, you can see state of the lights at that point in the sequence on the light status bar, at the bottom of the window. This bar is also active during 36  Silicon Chip playback to provide a preview of the sequence. Manipulating the sequence Click and drag the mouse within the sequence area to select a portion, which will turn blue. You can move the start and end of the selection by dragging them. It is also possible to select from the audio display. Which lights are selected can be changed by clicking on the light names at the left of the window. Control-click and shift-click allow you to select multiple lights. Once a selection has been made, you can manipulate that portion of the sequence using the functions towards the right-hand side of the toolbar (or from the Lights menu). These include turning the light(s) on or off for that period, setting them to an intermediate brightness, ramping the brightness up or down or performing a “cascade” where the lights are turned on in sequence. siliconchip.com.au Inside the completed slave unit – this shows push-fit IEC connectors on the rear panel but with 20:20 hindsight, we now recommend captive types (with screws and nuts). For safety, follow our wiring diagrams and photos exactly! The best way to understand how these functions work is to experiment with them. After changing the sequence, you can play it (or a section of it) to get an idea of what it will look like. The easiest way to do this is to select the section of the file you are working on and press the “set play region” button on the toolbar. You can then use the “Play region” function to play this section at any time as you are working on it. If you make a change that you are not happy with, simply use the “undo” function to revert it. Auto sequencing For automated sequence creation there is the “beat detection” function which pulses one or more lights in time with the beat, the “spectrum analysis” function which behaves like a “Musicolour” and even an “automatic sequencing” function which can generate a complete sequence with just a few mouse clicks. The GUI (Graphical User Interface) is designed to be easy to learn so with a little experimentation you should be siliconchip.com.au able to figure out most of its functions. We don’t have enough room for a more detailed explanation this month but we will provide more information next month. Delayed turnoff The delayed turnoff option should only be used in two situations – either during testing, to allow the slave indicator LEDs to vary their brightness or else for channels with lights that have insufficient current to properly latch the Triacs (<25W or so). If the brightness of your lights is not being properly controlled, you may need to use this option. In the latter case, only enable delayed turnoff for the affected channels. It is not a good idea to have more than a few such channels as this results in higher current drain on the 6V line. This can cause excessive heat generation in the 7806 regulator and higher voltage drops across long Cat5 cables, possibly resulting in incorrect operation. Ideally, use lights with a high enough power to allow the Triacs to latch. Remote control configuration Up to three remote control codes can be assigned to each command. These can be Philips RC5 12-bit codes or NEC 16-bit codes (used by some Digitech remote controls). Either way, the code is specified as a 4-digit hexadecimal number. Do not worry about what this means as the infrared logging feature can tell you what codes your remote control uses. Simply enable the feature, turn the unit on and press the buttons you are interested in. All you then need to do then is open the log file on your computer, copy the codes into the configuration file as appropriate, and disable the logging feature. The format for an RC5 code is “RC5(0x1234)” and for an NEC code it is “NEC(0x1234)”. For example, to configure the master module so that RC5 code 0x0020 triggers the “next” command (which is the default), add the following line to the configuration file: remote code next = RC5(0x0020) To add two to four possible remote codes for a given command, separate SC them with commas. November 2010  37