ELECTRONICS: FUN AND FUNDAMENTALS
By Charles Platt
A Trippy Crystal Nightlight
Create any color, using 3 LEDs and the trick of pulse-width modulation.
On a shelf above my bed stands something
highly unusual: a giant, translucent, crystalline
chunk of salt (Figure A), given to me by a friend
who imports gemstones from Pakistan.
The salt was drilled with a hole to accept a
15-watt light bulb, but I decided to convert it using
red, green, and blue LEDs that would create a
mysterious, ever-changing spectral glow (Figure B).
Hairy people wearing tie-dyed T-shirts might have
described this as “trippy!” rather a long time ago.
Mysteries of Color Mixing
Why use red, green, and blue? Because by varying
the intensities of these colors, we can create almost
all the other colors in the spectrum. This is known
as additive color mixing, and every color TV or
computer monitor depends on it.
Most of us are familiar with subtractive color
mixing, which is what happens when we blend
colored paints or inks on paper. White light falling
on the artwork penetrates the colors, which absorb
some of the frequencies before the light is reflected
back to the eye. The more colors you add, the more
light they subtract, and the darker the mix becomes.
When we deal with colored light sources, the
more sources we add, the brighter the combination
becomes. Mix red, green, and blue, and they can
create white. Mix just red and green, and you see
yellow. The setup in Figure C can be put together
quickly, with fascinating results. LEDs don’t have
exactly the right spectra and don’t project an even
spread of light, but you’ll still see the possibilities.
How can we vary the intensity of each LED to create a full range of mixed colors? Unfortunately LEDs
don’t respond linearly to changes in voltage, but we
can pulse them on and off. Long pulses with short
gaps between them will make an LED seem brighter.
Short pulses with long gaps will make it look dimmer.
Naturally, the pulses must be fast enough to exceed
the persistence of vision of the human eye.
148 Make: Volume
Components can be found at
except where noted.
Hookup wire, solid, 24 gauge
For the 555 timer version:
555 timer ICs, 1,000m W minimum ( 3) TLC555IP,
TS555IN, or similar
Switching diodes ( 3) 1N4148 or similar
LEDs, 5mm Lumex high-brightness ( 3)
SSL-LX5093XRC/4 red, SSL-LX5093UEGC green,
and SSL-LX5093USBC blue ( 1 each)
Lens caps ( 3) Keystone 8665, to diffuse light
Resistors, minimum ¼ watt: 1kΩ ( 6), 20Ω ( 2),
100Ω ( 1)
Capacitors, minimum 12V, electrolytic or ceramic:
47μF ( 3), 0.01μF ( 6), 100μF ( 1), 0.1μF ( 1)
Potentiometers, 100kΩ linear ( 3) Vishay
M63S104KB40 for board mount or Alpha
RV170F-24-20K-B15-3 for panel mount, or similar
5V DC power supply Use any AC adapter with a 5V
DC output, or use 3 AA or AAA batteries in series.
50kΩ photocells or photoresistors (optional)
Hard to find? Try eBay.
For the PICAXE version:
PICAXE 08M microcontroller SparkFun part
USB programming cable SparkFun #PGM-08312
3.5mm stereo audio jack SparkFun #PRT-08032
PICAXE Program Editor (Windows) or AXEpad
(Mac/Linux) software free from
Resistors: 10kΩ ( 6), 22kΩ ( 3), 20Ω ( 2), 100Ω ( 1)
Capacitors, minimum 12V: 100μF ( 1), 0.1μF ( 1)
LEDs same as 555 timer version
Perforated board (optional) Twin Industries 7100-45
or similar; you cut it to size.
Sockets (optional) Mill-Max 801-93-036-10-012000;
you snap to fit.
Optional: magnifier, multimeter, solder and soldering
iron for perf board version