Silicon ChipEight Small LED Christmas Ornaments - November 2020 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Why is electronics male-dominated?
  4. Feature: MEMS (Micro-Electromechanical Systems) by Dr David Maddison
  5. Project: Eight Small LED Christmas Ornaments by Tim Blythman
  6. PartShop
  7. Project: Two Large LED Christmas Stars by Barry Cullen & Tim Blythman
  8. Project: Balanced Input Attenuator for the USB SuperCodec by Phil Prosser
  9. Serviceman's Log: One repair leads to another by Dave Thompson
  10. Vintage Radio: RCA BP-10 "miniature" valve portable radio by Ian Batty
  11. Feature: A Rundown on New 8-pin PIC Microcontrollers by Tim Blythman
  12. Feature: The Vintage Matrox ALT-512 Graphics Card by Hugo Holden
  13. Project: Flexible Digital Lighting Controller, part 2 by Tim Blythman
  14. Feature: Electronic ‘Wearables’ and the Jaycar Sparkle Stitch by Tim Blythman & Nicholas Vinen
  15. Market Centre
  16. Advertising Index
  17. Notes & Errata: USB SuperCodec, August-October 2020; History of the Australian GPO, September 2020; Shirt Pocket Oscillator, September 2020; Frequency Reference Signal Distributor, April 2020; 45V 8A Linear Bench Supply, October-December 2019
  18. Outer Back Cover

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

You can view 44 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 "Eight Small LED Christmas Ornaments":
  • Tiny LED Cap PCB [16111193] (AUD $3.00)
  • Tiny LED Stocking PCB [16111194] (AUD $3.00)
  • Tiny LED Reindeer PCB [16111195] (AUD $3.00)
  • Tiny LED Bauble PCB [16111196] (AUD $3.00)
  • Tiny LED Sleigh PCB [16111197] (AUD $3.00)
  • Tiny LED Star PCB [16111198] (AUD $3.00)
  • Tiny LED Candy Cane PCB [16111199] (AUD $3.00)
  • PIC12F1572-I/SN (or equivalent) programmed for the Tiny LED Christmas Ornaments (Programmed Microcontroller, AUD $10.00)
  • Tiny LED Christmas Ornament complete kit (Component, AUD $15.00)
  • Firmware for the LED Christmas Ornaments (Software, Free)
  • Eight Tiny LED Xmas Ornament PCB patterns (PDF download) [16111191-16111199] (Free)
Articles in this series:
  • Eight Small LED Christmas Ornaments (November 2020)
  • Eight Small LED Christmas Ornaments (November 2020)
  • Christmas LED Icicle Decoration (November 2022)
  • Christmas LED Icicle Decoration (November 2022)
Items relevant to "Two Large LED Christmas Stars":
  • Stackable LED Star PCB [16109201] (AUD $12.50)
  • RGB Stackable LED Star PCB [16109202] (AUD $15.00)
  • ATmega328P-AUR or ATmega88PB-AUR programmed for the RGB Stackable LED Star [1620920A.HEX or 1620920B.HEX] (Programmed Microcontroller, AUD $10.00)
  • Kit for the RGB Stackable LED Christmas Star (Component, AUD $40.00)
  • Firmware for the 30 RGB LED Xmas Star (Software, Free)
  • RGB Stackable LED Star PCB pattern (PDF download) [16209202] (Free)
  • Stackable LED Star PCB pattern (PDF download) [16109201] (Free)
Items relevant to "Balanced Input Attenuator for the USB SuperCodec":
  • USB SuperCodec PCB [01106201] (AUD $12.50)
  • USB SuperCodec Balanced Input Attenuator add-on PCB [01106202] (AUD $7.50)
  • Parts source grid for the USB SuperCodec (Software, Free)
  • USB SuperCodec PCB pattern (PDF download) [01106201] (Free)
  • USB SuperCodec Balanced Input Attenuator add-on PCB pattern (PDF download) [01106202] (Free)
  • USB SuperCodec front panel artwork (PDF download) (Free)
  • Drilling and cutting diagrams for the USB SuperCodec Balanced Input Attenuator (PDF download) (Panel Artwork, Free)
Articles in this series:
  • USB SuperCodec (August 2020)
  • USB SuperCodec (August 2020)
  • USB SuperCodec – part two (September 2020)
  • USB SuperCodec – part two (September 2020)
  • USB SuperCodec – part three (October 2020)
  • USB SuperCodec – part three (October 2020)
  • Balanced Input Attenuator for the USB SuperCodec (November 2020)
  • Balanced Input Attenuator for the USB SuperCodec (November 2020)
  • Balanced Input Attenuator for the USB SuperCodec, Part 2 (December 2020)
  • Balanced Input Attenuator for the USB SuperCodec, Part 2 (December 2020)
Articles in this series:
  • The Matrox ALT-256 Graphics Card (October 2020)
  • The Matrox ALT-256 Graphics Card (October 2020)
  • The Vintage Matrox ALT-512 Graphics Card (November 2020)
  • The Vintage Matrox ALT-512 Graphics Card (November 2020)
Items relevant to "Flexible Digital Lighting Controller, part 2":
  • Flexible Digital Lighting Controller main PCB [16110202] (AUD $20.00)
  • Flexible Digital Lighting Controller Micromite Master PCB [16110201] (AUD $5.00)
  • Flexible Digital Lighting Controller CP2102 Adaptor PCB [16110204] (AUD $2.50)
  • Flexible Digital Lighting Controller LED slave PCB [16110205] (AUD $5.00)
  • PIC16F1705-I/P programmed for the Flexible Digital Lighting Controller [1611020A.HEX] (Programmed Microcontroller, AUD $10.00)
  • PIC32MX170F256B-50I/SP programmed for the Flexible Digital Lighting Controller Micromite master [1611020B.hex] (Programmed Microcontroller, AUD $15.00)
  • PIC16F1455-I/P programmed for the Flexible Digital Lighting Controller WS2812 Slave [16110205.HEX] (Programmed Microcontroller, AUD $10.00)
  • Si8751AB 2.5kV isolated Mosfet driver with integral power supply (Component, AUD $10.00)
  • Micromite LCD BackPack V3 complete kit (Component, AUD $75.00)
  • Hard-to-get parts for the Flexible Digital Lighting Controller (Component, AUD $100.00)
  • Flexible Digital Lighting Controller front panel PCB [16110203] (AUD $20.00)
  • Firmware and software for the Fiexible Digital Lighting Controller (Free)
  • Firmware and PC software for the Digital Lighting Controller [1611010A.HEX] (Free)
  • Flexible Digital Lighting Controller mains slave PCB patterns (PDF download) [16110202-3] (Free)
  • Flexible Digital Lighting Controller Master PCB patterns (PDF download) [16110201, 16110204] (Free)
  • Flexible Digital Lighting Controller LED slave PCB pattern (PDF download) [16110205] (Free)
  • Drilling and cutting diagrams for the Flexible Digital Lighting Controller Micromite master (PDF download) (Panel Artwork, Free)
  • Cutting diagram for the Flexible Digital Lighting Controller mains slave rear panel (PDF download) (Panel Artwork, Free)
  • Cutting diagrams and front panel artwork for the Flexible Digital Lighting Controller LED slave (PDF download) (Free)
  • Matte/Gloss Black UB3 Lid for Micromite LCD BackPack V3 or Pico BackPack using 3.5in screen (PCB, AUD $5.00)
Articles in this series:
  • Flexible Digital Lighting Controller, part 1 (October 2020)
  • Flexible Digital Lighting Controller, part 1 (October 2020)
  • Flexible Digital Lighting Controller, part 2 (November 2020)
  • Flexible Digital Lighting Controller, part 2 (November 2020)
  • Flexible Digital Lighting Controller, part 3 (December 2020)
  • Flexible Digital Lighting Controller, part 3 (December 2020)
  • Digital Lighting Controller Translator (December 2021)
  • Digital Lighting Controller Translator (December 2021)

Purchase a printed copy of this issue for $10.00.

HO HO HO . . .                      More Yuletide Magic from Tim Blythman Our Tiny LED Christmas Tree from last year was so popular we decided to follow it up in spectacular style with not one, not two, but seven more festive decorations that you can build! They’re small, cheap and easy to put together, so you could easily build all eight for Christmas this year; or even several of each. M any hundreds of our Tiny the same circuit into different shapes so that Santa and his reindeer can be part of the fun, too. LED Christmas Tree from and colours for extra variety. And that’s precisely what we’ve November 2019 (siliconchip. com.au/Article/12086) were built. done. These assorted Christmas orna- The circuit The circuit diagram for our new OrSome people bought ten or more kits! ments are all very tiny, but perfect for We even made some for our own trees decorating your tree. We’ve come up naments, shown in Fig.1, is essentially with unique patterns to suit each Or- the same as last year’s Tree. at home. If you want some more detail about It’s no wonder that they remain so nament, and we’ve also added a twist, the specific design choicpopular, as they are an easy es we made, we recomway to completely deck out mend that you look at the your tree with some great previous article. looking animated decoraIn particular, see the tions. panel about LED CharBut we were struck by lieplexing (on p48 of the a letter from Anthony and November 2019 issue) to Annabel, which we pubfind how we control so lished in our February 2020 many LEDs from an 8-pin Mailbag section. Here we microcontroller. learned that kids as young The circuit is based as nine were successfularound IC1, a PIC12F1572 ly building the Tiny LED 8-bit micro, powered diXmas Tree. Just in case you missed rectly from a 3V CR2032 Now there’s no excuse it, here’s the Tiny button cell. The cell is not to embrace SMD conChristmas Tree project simply wired across the struction! from November 2019 which inspired these micro’s supply pins, pin Not only that, but An1 (VDD or positive supply) thony and Annabel also new designs. Still a perfectly viable and up-to-date project in its own right. it can be used on its own or in conjunction with any and pin 8 (VSS or negative offered up the excellent of the new ornaments. (siliconchip.com.au/Article/12086) supply). idea that we should make 24 Silicon Chip Australia’s electronics magazine siliconchip.com.au Eight LED            Christmas          DECORATIONS We’re using a PIC12F1572 for reasons explained in the “New PIC” article on page 83 but we’ve created firmware images that suit the PIC12F675 too, so you can use either IC for this project. IC1 comes in a small 8-pin SOIC (small outine integrated circuit) package. It’s compact but easy enough to work with. Four of IC1’s GPIO (general purpose input/output) pins (pins 2, 3, 5 and 6) are connected to 100Ω resistors and in turn to the matrix of 12 LEDs. Between each pair of pins are two LEDs, one facing one direction and the other, the reverse direction. Six combinations of pin pairs multiplied by two LEDs per combinations makes 12 LEDs. We can program the microcontroller to connect the GPIO pins to either the battery positive (“high”) or negative (“low”) or neither (“high-impedance”). Through different combinations, we can light up each one of the LEDs in turn. Note that the LED numbers shown here do not necessarily correspond to the sequence in which they are driven. The numbers in brackets indicate the way they are ordered in the software. We’ve done it this way as we expect that people changing the software pattern will find the software (cyan) numbers more logical than the designators used to lay out the PCBs. These ‘software’ numbers also correspond to the order in which the LEDs were laid out on the original Tree. We’ve tried to keep this order in place for the other Ornaments. The Here’s a selection of the Christmas decorations we’ve made with plenty of time before the big day. Apart from Santa himself (which of course must be red!) the others are available in a variety of colours, courtesy of some clever PCB manufacturers (see parts list). siliconchip.com.au Australia’s electronics magazine November 2020  25                  SC  TINY led XMAS ORNAMENTS Fig.1: the circuit for our Tiny Christmas Ornaments is essentially the same as that for the Tiny LED Christmas Tree published in November last year, albeit with a newer PIC micro. It is very simple and allows one LED to be lit at a time. The software can light these LEDs in any sequence, and different versions have been created to suit the physical LED layout of each Ornament. upshot of this is that you can use the same software to get different patterns for each design. Software To generate patterns with the LEDs, we program the microcontroller to set its GPIO pins in a particular state, then go to ‘sleep’ for a short while (around 16ms). It then ‘wakes up’, turns the LEDs off and then sleeps again for around 64ms.   This cycle repeats, with the program deciding which LEDs are lit so that an interesting pattern is displayed. By keeping the micro in sleep mode most of the time, power consumption is minimised. As the microcontroller is sleeping practically all the time, the power is mostly used to drive the LEDs. And because the LEDs are only on around 20% of the time, the battery lasts for a long time. We stated last year, based on calculations, that a typical battery should last around three months. Our prototype (using 1kΩ LED current-limiting resistors) actually lasted for five months before beginning to dim and fade. As a result, we are recommending that constructors use 100Ω resistors instead, giving around two to three months of life; more than enough to last through Christmas and into the New Year. We’ve created different LED sequence patterns to best suit each Ornament, plus a semi-random pattern which can be used on any of the Ornaments. Since the circuit is effectively the same, you can try the different programs on the various Ornaments to see if they give displays that you like. The Ornaments There are seven new Christmasthemed Ornaments. Five are intended to be used individually, while two can be hung separately or combined to cre-    SC  Fig.2: as we think the Bauble will be popular, we are offering it in red, yellow, green and blue. That way, you can build a mix and also vary the LED colours. Its pattern (16111196.HEX) cycles the LEDs around the Bauble, or you can use 16111190.HEX to get a random, flickering pattern. 26 Silicon Chip Australia’s electronics magazine Fig.3: our prototype Cane (overleaf) is green only because there were delays getting red PCBs due to COVID-19. But this overlay diagram shows the PCB in red! The Candy Cane is designed to be hung with the ‘hook’ at the top via a small hole. The firmware (16111199.HEX) scans the LEDs from one end to the other. siliconchip.com.au SC  ate a centrepiece for your (full-sized) tree. Of course, you can also still build the Tiny Trees published last year, for a total of eight different Ornaments. The five new individual Ornaments are a Stocking, Christmas Cap, Candy Cane, Star and Bauble. Since we figure that any tree looks great covered in baubles, we’re making that design available in four different solder mask colours. You could get an assortment of coloured baubles and deck out your tree in spectacular fashion! Like last year’s Tree, the Stocking PCB also comes in different colours. The two special Ornaments are the Reindeer and Santa’s Sleigh. These can be hung individually, but we’ve also added extra pads to these PCBs so that they can be wired up together, with the wires acting as the harness (whoa there, Rudolph!). With these, you can even rig up a larger battery pack, so that you can harness up a full complement of a dozen Reindeer, just like Santa does, but not worry about running out of power on Christmas Eve. Just like last year’s Tiny Tree, the choice of LEDs is entirely up to you as well. We built our prototypes with a random mix of red, green and white LEDs, but you could also add yellow, amber, pink, cyan or blue to the mix. Our kits come with the ‘standard’ colours, but you can also order extra sets With a 1.27mm pin spacing, it’s easy enough to solder individual pins on the PIC12F1572’s SOIC-8 package. If you do make a solder bridge between the pins, flux paste and solder braid can be used to fix it. The blobs of solder shown here are much larger than is needed, but it works; a bit too much solder is better than not enough! of LEDs in those other colours via our Online Shop at the same time (see the parts list for details). For example, you might like to build a blue Bauble and deck it out with blue LEDs. But as long as Rudolph has a red nose, it doesn’t matter! Construction We know you’re excited, so we’ll jump right into the construction. For the most part, all seven of the new Ornaments are very similar. Refer to the PCB overlay diagrams, Figs.2-8, which show where the components go on both sides of each Ornament. The instructions here apply to all the Ornaments, but if you’re building the Reindeer or Santa Sleigh, we’ll follow up with extra information about SC how these can be wrangled together. As each Ornament has a unique pattern, if building multiple types, you should avoid getting the pre-programmed micros mixed up. If you have pre-programmed PIC microcontrollers, then you won’t need to fit CON1, the programming header. In that case, you should remove the small snap-off tab for CON1, as it will be easier to do this now than later. The exceptions are the Bauble, the Reindeer and the Santa Sleigh. The Bauble has a removable tab, but that is also the best way to hang it, so it should be left on. The Reindeer and Santa Sleigh don’t have removable tabs as these are used for wiring in the ‘harness’. Depending on what your plans are,    C         siliconchip.com.au Fig.4: the Star Ornament with a white PCB silkscreen is one of the more striking variants and will look great against a green Christmas tree. It is also one of the more compact PCBs. This means that some traces are close to where the CON1 section snaps off. Its pattern (16111198.HEX) has the LEDs radiating out from the centre of the PCB to each tip in turn. Australia’s electronics magazine November 2020  27 Fig.5 (above): although some of the LEDs on the Cap are at slightly different angles, the cathodes are still towards the left-hand side. The tab for CON1 is very close to some LEDs at lower right, so remove this tab with care. The 16111193.HEX pattern cycles up from each LED in the bottom row in turn, similar to the original Tree Ornament. Fig.6 (right): don’t expect to get any big presents in these Stockings; they’re very small! You can still hang them from the fireplace if you don’t have room on your tree. The green PCBs will look striking, while red is more traditional. The pattern (16111194.HEX) involves the LEDs cycling down each side in turn, similar to that used for the Candy Cane. you may not need to fit the cell holder to the Reindeer or Santa Sleigh, as the harness can be used to power these Ornaments. For the other Ornaments (the Star, the Stocking, the Cap and Candy Cane), if you do not need to program the micros in-circuit, carefully score along the line of small holes with a hobby knife. This ensures that the copper traces don’t tear off the PCB. Then carefully flex the tab; flat-nosed pliers are suitable for this. It should snap fairly cleanly, but you can tidy this up with a file. Do all of this outside while wearing a mask if possible, as the PCB dust can be an irritant. Soldering This is probably the most critical part. For soldering small surfaceThe LEDs on the front of the PCB are 3216 (1206 imperial) sized and at 3.2 x 1.6mm, are easy enough to manage with most standard soldering iron tips. Note the small green triangle at the upper left of each LED, aligned with the little white cathode mark seen underneath the part. 28 Silicon Chip Australia’s electronics magazine mounted parts, we recommend having a fine-pointed soldering iron, tweezers, flux paste, solder braid (solder wick) and a magnifier. A ball of adhesive putty like Blu-tack can be used to hold the PCB during soldering. The solder flux creates smoke when heated, so a solder fume extractor is handy to have too, or alternatively, work next to an open window. It’s best to have a clean work area with plenty of space and light. The small SMD parts have been known to jump out of the tweezers’ grip. If your work area isn’t tidy, you will have no hope of finding a dropped part! A good technique for working with the SMD parts is to solder one lead to roughly place (tack) the part. If necessary, remelt this join and adjust the part with tweezers until the component is flat against the PCB and all pins are square within their pads. Then carefully apply solder to the remaining pads, then go back and refresh the first pad by applying a bit more fresh solder. It’s also a good idea to apply flux paste to the pads and pins before solsiliconchip.com.au Fig.7: unfortunately, most manufacturers don’t offer brown PCBs! The spots along the Reindeer’s back are holes in the top solder mask, which allows the natural PCB colour to show through. The LED on the nose should be red for the first Reindeer in the harness (Rudolph), and a different colour for the rest. The pattern (16111195.HEX) makes the LEDs course down from the antlers along the Reindeer’s body in two passes, giving the impression of great speed! CAUTION – watch those button cells with small children about! As with any project that uses button cells, care should be taken to ensure there is no chance that it can get into the hands of a small child. Many will immediately put it in their mouth and if swallowed, it can do serious harm. If you have small children (under about five years), either cover the Ornaments in clear heatshrink tubing or glue the battery in place (eg, using neutral-cure clear silicone sealant) so that it cannot be easily removed. dering them. This helps to draw the solder from the iron onto the pads and pins. Use a magnifier to inspect the solder joints. There should be a good fillet between the pad and pin, but not so much solder that it bridges to a nearby pin. See our photo for a closeup view of a good solder joint. The solder should look smooth and glossy. You should also pay close attention to the overlay diagrams to check your progress as you assemble each Ornament. If you’re building multiple ornaments (and why wouldn’t you?) you can either make them one at a time, or do them all in parallel – it’s up to you. Just make sure that if you do them in parallel, you don’t get parts for different Ornaments mixed up. Before going any further, figure out which colour LEDs you want to place where on each Ornament. Because the LEDs can look identical when out of the pack, it’s best to either fit all of each LED colour in one go, or else only take out the number that you need at any given time. If you do lose track of the LED colsiliconchip.com.au ours, most DMMs set on diode test mode will illuminate an SMD LED if you touch the probes to either end; but be careful not to press too hard, or you might flick the part away! If it doesn’t light up, try swapping the probes. Usually, it will light with the black probe to the pad marked with a green dot (the cathode). The remainder of the instructions describe how to assemble any single Ornament. Start by fitting IC1 on the back of the PCB. Check the IC’s orientation by looking for a small dot in one corner and a bevel along one edge. These two features must line up with the line marked on the silkscreen and shown in the associated PCB overlay diagram. The dot should also be closest to the notch shown in the IC outline. Also, the PCB pad for pin 1 is rectangular, while the others are rounded. Use the technique mentioned above to tack the IC in place by a single pin. Don’t be concerned if you make a solder bridge; focus on ensuring the IC is correctly located, with all eight leads Australia’s electronics magazine aligned within their respective pads. Remelt the solder and adjust if necessary, then solder the remaining pins. If you have a solder bridge between two or more pins, apply flux paste and rest some solder braid on the bridge. Press the soldering iron onto the braid and once the solder has melted, carefully draw the braid away. If there is a lot of solder, you may need to repeat this process. The rest of the components have a much coarser pin pitch and are easier to solder, as well as much less likely to bridge. Place the 10kΩ resistor next. It will be marked ‘103’ or perhaps ‘1002’ (although you may need a magnifier to read it). It and the other resistors are not polarised, so they can be installed either way around. Refer to the PCB overlay diagram and board silkscreen to see where it goes. With that in place, fit the four 100Ω resistors. They are marked ‘101’ or perhaps ‘1000’, and fit on the pads marked 100. Now flip the PCB over to install the November 2020  29      SC  Fig.8: as for the Reindeer, a mahogany PCB solder mask would have been great for Santa’s Sleigh, but red it is. The LEDs (using 16111197.HEX) follow a similar pattern to the Reindeer, strobing along the length of the Sleigh in multiple passes. While sticklers would use green LEDs along the Sleigh’s starboard side and red for the port side, any combination of colours is sure to light up the sky. LEDs. These are polarised and need to have their cathode fitted closest to the pad marked with a line. Typically the LED cathode is marked with a green dot or arrow, but we have seen some that have their anode marked this way. So it’s best to check with a DMM (as described above). When it lights up, the black probe is on the cathode side. We’ve orientated the LEDs all the same way on each board as much as possible. The cathodes should all point to the left and/or down with the boards orientated as shown in Figs.2-8. The cathode side of the LEDs is indicated on the PCB overlay diagrams with a box around that LED pad. But note that on the actual PCBs, some of the decorative silkscreen patterns are printed over the component footprints, so they are not always visible. As long as you remember the left/ down rule and make sure the boards are orientated as we show them, all the LEDs should work. Use the same technique as before; solder one lead, ensure it is square and flat, then solder then second lead and refresh the first. This is doubly important for the LEDs, as this is the side of the PCB that will be seen. With this done, clean up the flux 30 Silicon Chip residue on the smaller components using a solvent like isopropyl alcohol, methylated spirits or acetone. While not necessary with most fluxes, it helps to make the front of the PCB look neater for when it is placed on your Christmas tree (or wherever you plan to display it). For most Ornaments, the last step is to mount the coin cell holder. Check the notes for the Reindeer and Santa Sleigh combination below if you plan to wire up a harness. In that case, you don’t need the cell holder (although you could still fit it). Its orientation is important to ensure that you can get the cell in and out. Both pads connect to the positive side of the battery, with the negative terminal being the large circular pad on the PCB. For the Candy Cane, Cap and Stocking, you can fit it either way around. For the others, check that the little tabs on the battery holder are facing towards the middle of the PCB. This way, the holder’s opening will face towards the nearest edge of the board. As the cell holder is larger than the other components, and made entirely of metal, you should turn up the temperature on your soldering iron before soldering it (if possible). As for the other components, sol- Simply resting a five-way pin header into CON1 makes enough contact to program the PIC. Apply gentle force to ensure that the pins bite in slightly during the programming process. We’re using a PICkit 4, but a PICkit 3 will also work. Australia’s electronics magazine siliconchip.com.au der one lead and adjust it so that the other lead lines up with its pad. Then solder the second lead and go back to refresh the first. If you have a programmed PIC, then all you need to do is fit the cell (positive side up, as per the marking on the battery holder) and the Ornament should flash away. If it doesn’t flash at all, remove the battery and check for short circuits on the battery holder or PIC. If only some of the LEDs work, check the LED orientation, and the LED, resistor and PIC soldering. If you have fitted a blank PIC, it won’t do anything until you program it. In-circuit programming While CON1 is designed for a row of pin headers, you do not need to fit it, even if you need to program the PIC on the board. Unless you plan to program the PIC multiple times, merely holding the header in place to make contact with the pads is usually sufficient and gives a neater final result. Our diagreams and photos show a right-angled header attached, as it allowed us to lay the programmer and PCB flat to prototype our software, although a vertical pin header would work too. You might like to use a rightangle header if you are looking to program your own patterns. Another reason to fit CON1 is that pins 2 & 3 on CON1 can be used to supply power to the board, in place of the onboard cell. If you prefer to use a USB power supply, the Ornaments will happily run from 5V (and will be much brighter). Feed 5V into pin 2 of the connector and connect the ground to pin 3. That’s how we powered our Santa with Reindeer, although it works for the other ornaments too. To fit CON1, rest the header pins in the pads, with the exposed ends facing back, so that the pins are less visible from the front. Solder one pin and check the connector is straight, then solder the remaining pins. You could snap the CON1 section off the PCB once programming is complete. It’s a bit more awkward to do once CON1 has been fitted, but it can be done with care. You’ll need a PICkit 3 or PICkit 4 (or another programmer than can work with PIC12F1572s). We use the MPLAB X IPE software siliconchip.com.au Parts list – Tiny LED Xmas Ornaments 1 surface-mount coin cell holder [Digi-key BAT-HLD-001-ND, Mouser 712-BAT-HLD-001 or similar] 1 10kW 3216/1206 size SMD resistor [eg, Altronics R8188] 4 100W 3216/1206 size SMD resistors [eg, Altronics R8044] 12 3216/1206 size SMD LEDs, any combination of colours [eg, Altronics Y1041, Y1056, Y1073, Y1079, Y1085] 1 CR2032 lithium coin cell (CR2025 is also suitable but with reduced lifespan) 1 5-way right-angle or vertical header strip (CON1) (optional; for programming IC1) Plus one of the following: * Tree: green, red or white PCB coded 16111191, 54 x 41mm, plus PIC12F1572-I/SN programmed with 16111191.HEX * Cap: red PCB coded 16111193, 54 x 56mm, plus PIC12F1572-I/SN programmed with 16111193.HEX 16111191R 16111191W 16111191G 16111193 16111194G * Stocking: red or green PCB coded 16111194, 41 x 81mm, plus PIC12F1572-I/SN programmed with 16111194.HEX 16111194R * Reindeer: red PCB coded 16111195, 91 x 97mm, plus PIC12F1572-I/SN programmed with 16111195.HEX 16111195 16111196R * Bauble: red, yellow, green or blue PCB coded 16111196, 53 x 46mm, plus PIC12F1572-I/SN programmed with 16111196.HEX 16111196G 16111196Y * Santa’s Sleigh: red PCB coded 16111197, 79 x 91mm, plus PIC12F1572-I/SN programmed with 16111197.HEX 16111196B 16111197 * Tiny Star: white PCB coded 16111198, 56 x 54mm, plus PIC12F1572-I/SN programmed with 16111198.HEX 16111198 * Candy Cane: red PCB coded 16111199, 84 x 60mm, plus PIC12F1572-I/SN programmed with 16111199.HEX 16111199 Extra parts for Reindeer harness (one set for each Reindeer) [not included in kits] 1 2-pin 2.54mm-pitch socket header AND 2 male-female jumper wires OR 2 lengths of 0.63mm diameter enamelled copper wire Extra parts to power Reindeer Harness from AA cells [not included in kits] 1 2-pin 2.54mm-pitch socket header 1 2xAA or 3xAA battery holder, ideally with switch (eg, Jaycar PH9280) Kits Each kit comes with all the parts required to build one Ornament (except the coin cell) and includes 12 red, 12 green and 12 white LEDs so you can mix and match them as you see fit. Other LED colours are available; they are listed below. All kits are $14 each (10% discount for active subscribers) plus postage, which is $10 per order within Australia. (If you order 50 kits, the postage is still $10). All kits have the same catalog code (SC5579) with options for the Ornament type and PCB colour (for those Ornaments available in more than one colour). For example: for a red bauble kit, you would order SC5579/bauble/R. For the sleigh, order SC5579/sleigh (because there is only one colour) You can still order the original Tiny LED Xmas Tree kit via the earlier catalog code, SC5180. Extra LEDs * 10 amber amber: Cat SC3394, $0.70 * 10 yellow yellow: Cat SC3405, $0.70 * one pink pink: Cat SC3406, $0.20 * 10 blue blue: Cat SC3396, $0.70 * 10 cyan cyan: Cat SC5199, $1.00 Australia’s electronics magazine November 2020  31 Fig.9: we powered Santa’s Sleigh and two Reindeer from a pair of AAs in a Jaycar PH9280 switched battery enclosure. The red wires are for +3V and the grey wires 0V; you could use different colours, just don’t cross them over! With each Ornament drawing less than 1mA, many more could be powered this way. IC1 operates from 2V to 5.5V, so it is well-suited to running from two or three AA cells or USB power. As shown in the photo on page 24, we rigged it up with plugs and sockets for flexibility. But you could solder wires straight to the pads. Ideally, each Ornament should be tested separately before wiring them together. (integrated programming environment), which can be downloaded for free as part of the MPLAB X IDE (integrated development environment). There are downloads for Windows, Mac and Linux at www.microchip. com/mplab/mplab-x-ide The latest version (5.40) only works with 64-bit processors, so you may need an older version if you have a 32-bit processor; older versions can be found at www.microchip.com/development-tools/pic-and-dspic-downloads-archive When installing this software, ensure that you enable support for 8-bit processors (which includes the PIC12F1572). Before connecting a programmer, make sure there is no cell fitted to the Ornament. The PICkit programmers can supply 5V, and it is not a good idea to apply 5V to a 3V cell (the programmer is probably smart enough to avoid doing this, but better safe than sorry…). The following process assumes you are using a PICkit and the MPLAB X IPE, although other programmers will work similarly. Start by browsing to open the HEX file (found in the software zip download from the SILICON CHIP website). There is a HEX file for each PCB design; find the number which matches the PCB you are programming. Alternatively, 16111190.HEX is simply a 32 Silicon Chip semi-random pattern which will work with any of the Ornaments. Connect the programmer to the computer and then connect the programmer to the Ornament. The pin marked with an arrow on the PICkit programmers is pin 1, and this connects to pin 1 of CON1. If you have not soldered CON1, then place a row of pin headers into the PICkit header and rest this in the pads on the PCB instead of plugging it into the header. Apply a gentle force to ensure contact is made. Set your programmer to provide power to the target. The MPLAB X IPE has buttons for ‘Apply’ and ‘Connect’. You’ll need to click these before clicking ‘Program’. If all is well, the LEDs should start flickering when programming is complete. Since one of the LED pins is also used for programming, some LEDs may light out of sequence. Detach the programmer and fit the cell to check its full operation. There’s not much more to it than that. Mounting The Ornaments have several mounting options. Most of them have a plated-through hole at the top to which a loop of tinned or enamelled copper wire can be soldered, so that the Ornament can be hung on a tree branch. The Bauble lacks these pads, but it can be hung from a wire soldered to the Australia’s electronics magazine pads of CON1 (the centre pad is best). The Tiny LED Xmas Tree can be made to stand up on a flat surface by soldering two or more tinned copper wires to the pads for CON1 (eg, pins 1 & 5) and bending them to contact the surface. You can twist the wire onto the branches of your tree to secure it, although, with a traditional pine tree (real or fake), the needles typically do a good job of keeping the Ornament on the tree. Most ornaments also have a larger pad on the rear of the PCB. This can be used to solder a safety pin or similar to the Ornament, so that it can be worn on clothing or otherwise secured to a tree. Fig.9 and the photo on page 24 shows how you can wire up the Reindeer and Santa Sleigh PCBs and use this to create a stunning centrepiece to your decorations. You don’t need to stop at two Reindeer; add as many as you like (eight is the traditional number, but that leaves out poor Rudolph with his glowing red nose!). We used jumper wires, but you could use enamelled copper wire with a diameter of around 0.63mm, and that will hold the whole assembly together as a single semi-rigid unit. Once they’re powered up, they should run for months on their coin cells, providing plenty of blinkenlights for your Christmas tree! SC siliconchip.com.au