The Little Glowing Friend (I named it after the ever-vigilant blue canary night light in a They Might Be Giants song) uses a single-chip microcontroller to drive 20 LEDs in a variety of patterns. The circuit is embedded in a clear resin casting, creating a lively, self-contained display. The light brick takes about 2 watts of power, and should last more than 10 years in continuous operation.

I gave away 24 of these in 2006; most have been on ever since, and there have been no reported failures. Electricity cost is about $1 a year, for 24×7 operation.

Project Steps

Assemble the circuit board.

First, locate the top and bottom of the PCB. The top has the silk-screen and component designators. The bottom has most of the wiring.

Solder the resistors first. Use 100Ω resistors for R1–R20, and 20K resistors for R21 and R22. Resistors are not polarized, so it’s not necessary to line up the color codes, but it does make for a neater job. Tape the resistors tightly to the top of the board using blue masking tape; they’ll trap air bubbles underneath them if they’re not down tight.

Flip the board over and solder. If any of the resistors shifted, heat them up and push them back down. Cut the leads down to the solder joints with wire cutters and remove the blue tape.

Place capacitors C1 and C2 on the board. The tantalum capacitor C1 is polarized and must be inserted as indicated on the board. The positive (+) side of the capacitor goes in the + hole, which is the square one. Tape, solder, and cut as before.

Carefully bend the leads of the PIC to fit the board’s chip hole spacing. Place the PIC with pin 1 (the indented end) pointing to R21 and R22. Carefully solder, without putting too much heat on any pin. Double-check that the polarity is correct before soldering.

Attach the DC power connector J1. Bend the blades out somewhat from the bottom to hold the connector in place. Then solder it in flush to the surface of the board, using plenty of solder to seal the holes.

Attach LEDs D1–D20. The patterns are programmed for the following layout of LEDs:

R B G Y R

Y R B G Y

G Y R B G

B G Y R B

Be sure to test your LEDs for function, and for color if it’s not obvious by the casings. Use an LED tester or just squeeze the leads onto a 3V lithium coin cell.

For proper casting, you want the tops of all the LEDs to be roughly level, and taller than the power connector. The holes in the PCB are sized so that a standard LED lead will stop about 1″ above the board. It’s a tight fit, but it works.

If for some reason your LEDs don’t have this stop, you’ll need to make spacers. Make 20 spacers by stripping 2″ of insulation from #14 solid wire. Insert the insulation between each LED’s leads, up by the LED case.

Place the LEDs in the board and test the heights against the power connector. Observe correct polarity when placing the LEDs. The long lead is the positive, or anode (A), and goes through the round hole. The short lead is the negative lead, or cathode (K), and goes through the square hole (mnemonic: “cats are negative”). If there’s a flat spot on the LED it will be on the cathode side.

Turn the board upside down on a hard, flat surface to ensure all LEDs are lined up. Solder, and clip the leads. Remove any spacers using hemostats or fine pliers. Notice that the common rail is connecting all the positive (+) pins of the LEDs. (In some other LED projects there is a common ground (–) for all the LEDs.)

Attach tilt switch SW1. The tilt switch is a rolling ball that runs on a track and closes (activates) when the ball rolls to the base where the wires stick out. It provides user input, acting like a button push or mouse click. The tilt switch is the only component that goes on the bottom of the board. It doesn’t have a polarity. If you want it to activate when you tip the brick back toward the power connector, the switch must angle downward from the rear of the board, as pictured.

If you want this orientation, mount the switch on the bottom of the board through the switch holes labeled SW1. Leave about ¼” of the switch leads exposed between the switch and the board. You’ll need enough room to bend the leads to angle the switch. Use the SW2 position if you’d rather the switch activate 90° from the SW1 position.

If you intend to program the PIC in-circuit, you’ll need to attach capacitors C3 and C4 and the programming header J2 at this point.

If you intend to program the PIC in-circuit, you’ll need to attach capacitors C3 and C4 and the programming header J2 at this point.

Don’t plug the board in just yet. Visually inspect the PIC and the rest of the board for solder bridges (i.e., short circuits in your soldering). Remove any bridges with solder wick .

Next, test the board for a short circuit. Use a continuity tester or ohmmeter to test the power connector’s + and – terminals (located on the bottom of the board).

Finally, test that you have a good power supply. The center pin on the power supply connector should be a stable +5V, and the sleeve is ground. Be sure not to short out these contacts during this test! The board will actually work between about 4V–6V. The PIC doesn’t like voltages above 6V and may blow out if overvoltage is applied.

If the board passes these tests, then plug it in! If the board doesn’t work properly, consult the Troubleshooting section. Don’t cast the brick until the circuit is working reliably.

Make the mold and cast the block.

Since we’ve covered moldmaking and casting in a previous issue (see MAKE, Volume 08, page 160), we won’t detail the process here. The easiest way to get a mold is to buy a pre-made one like the MC-7 (see materials list). It’s 3″×5″×15″, a reasonable fit.

I prefer my own mold, for a better fit and a more interesting finished piece. The circuit board is designed to fit nicely into a volume 3″×4¼”×1″–2½” deep, but you can make the master mold any size and shape that will accommodate your board. Remember that the power connector needs to be flush against one side of the finished casting.

You can also house the Little Glowing Friend circuit board in any container you desire, but I like the permanence and uniqueness of the cast brick.

Finish up.

Don’t get impatient and demold the piece too early, as this can ruin it. Follow the manufacturer’s recommended demold times, and then some. It’s best to leave it overnight or even longer.

Remove the brick when it is truly cured. It should be fully cooled and hard. Resin hardens from the inside out, so the surface is the last part to harden. This can take well over a day depending on the mix and conditions. Don’t judge by time; demold only when the surface is hard and no longer tacky. Test hardness using a stick, not your finger.

You can speed the surface cure by warming the brick under some lights, but be careful not to overheat the casting or the mold. Don’t leave the lights on overnight or unattended

Remove the tape from the power connector using hemostats. You may also need a knife if it’s gotten coated over.

Even though the brick is hard at this point, the finish is still fragile. It will pick up fingerprints and will pit with dust. It’s best to handle it only by the edges. You may want to “tent” it under wax paper and continue the cure. Don’t let the wax paper touch the surface, or it will leave marks. Optionally, you can spray on a surface coat of resin at this point to protect the finish, but be aware that this may cloud the surface. Use sparingly.

Apply the bumper feet to the bottom and you’re done.

Fire up your little glowing friend.

Plug it in and watch it go! Activating the tilt switch will cycle the device between power off and 4 different lighting programs — Waves, Colors, Calm, and Frenetic.

Troubleshooting

If, for some reason, the board doesn’t light when you test it (before casting the brick, of course), check the following:

Ensure that all leads go through the holes, and check that none of the PIC leads have folded up under the chip body. They should all be visible from the bottom of the board.

Inspect the bottom of the board to ensure that all connections are soldered.

Check the polarization and orientation of components C1, U1, and D1–D20.

Check that there are no solder bridges (two points connected that shouldn’t be).

Check that the power supply is plugged in and outputting between 4 and 6 volts. Use a volt/ohm meter (VOM) or multimeter.

Check that the power supply is plugged in and outputting between 4 and 6 volts. Use a volt/ohm meter (VOM) or multimeter.

Check that the power supply is plugged in and outputting between 4 and 6 volts. Use a volt/ohm meter (VOM) or multimeter.

Check that the board is not short-circuited by testing the + and – terminals on the bottom of the board.

If some LEDs are working but not others, try doing the following:

Test the LED individually. Apply voltage from a coin cell across the LED terminals.

Next, test with a VOM that there is 100 ohms of resistance between the LED’s negative terminal (the square hole) and the PIC pin. Trace the circuit visually or use the schematic diagram.

Conclusion

This project first appeared in MAKE Volume 18, page 102.