(''«= '%(«=
))B
'/D
('B
('';
",M;;:;`eglk
'M;;:;`eglk
Kf;i\[;C<;
=ifd;Zfdglk\i
Kf;Zfdglk\i
>ifle[
K\ek_j;f];Xe;`eZ_
))B
('B
'/D
('B
)';
Kf;^i\\e;C<;
=ifd;Zfdglk\i
Kf;Zfdglk\i
>ifle[
))B
('B
'/D
('B
)';
Kf;Ycl\;C<;
=ifd;Zfdglk\i
Kf;Zfdglk\i
>ifle[
('B
K\ek_j;f];Xe;`eZ_
I
resistors from the red LED (see Figure E).
If you don’t happen to have a giant salt crystal
lying around, you can put your LEDs behind a piece
of clear polycarbonate plastic, and sand it well to
create a translucent screen. Use a crinkled sheet of
foil to reflect the light before it reaches the screen,
and the patterns should be pleasing. Or add multiple LEDs, since each 555 timer can drive at least 7.
Twiddle the knobs on your potentiometers to set
the color that matches your state of mind each night.
Enhancements? For fun, substitute two 50K light-sensitive resistors, also known as photoresistors
or photocells, for each half of each potentiometer.
Mount them in a “keypad” under a little desk lamp,
some distance from the colored LEDs. The shadow
from your finger will change the photocell resistance, and will “magically” modify the colors.
Of course it would be more interesting for the
colors to vary automatically and randomly. Since
“randomly” is always a challenge for old-school
components, it’s time for some microcontrollers.
Nightlight on Full Auto
I’ll use PICAXE microcontrollers because they’re
cheap and easy. The little 08M, which is sufficient
for this project, costs about $3 each. See my book,
Make: Electronics, or my previous column for more
about the PICAXE, or visit
rev-ed.co.uk/picaxe.
J
Fig. I: Mounted on perforated board, the microcontroller circuit can measure less than 1"× 2",
good for a possible jewelry project. It can run
with 3 AAA batteries. Components are on the
front of the board, pale-colored conductors on the
back. Refer to the downloadable schematic from
makezine.com/25/electronics for more details.
Fig. J: Fabricated version of the layout in Figure I.
Sockets are used to receive power, to attach the
LEDs, and to reprogram each microcontroller.
You’ll need three 08Ms, because a single one
won’t process instructions fast enough to control
all the LEDs. You’ll find a schematic, a breadboard
layout, and a program listing available online at
makezine.com/25/electronics.
Copy and paste the program into the program
editor and download it into each PICAXE. It will
send pulses varying in length from about 1 to 10
milliseconds, allowing 10 levels of brightness, plus
zero brightness when the LED is off.
To make the LEDs fluctuate out of sync with each
other, edit the program to change the value for the
colorinc constant for each PICAXE. Comments in the
listing tell you how to do this.
You can squeeze the whole circuit onto a piece
of perforated board smaller than 1"× 2" (Figures I
and J). Run it from 3 AAA batteries wired in series,
enclose everything in a locket, and you have some
attention-getting electronic jewelry.
Lastly, for a mega mood light, you could use
three 28X1 PICAXEs, each driving 8 LEDs from its
8 output pins on a pseudo-random basis. This way,
the brightness of each color would be determined
by how many LEDs are switched on.
Charles Platt is the author of Make: Electronics, an introductory guide for all ages. A contributing editor to MAKE, he
designs and builds medical equipment prototypes in Arizona.
151 Make: