The Microchip PIC16F627 used here is a low cost
microprocessor. It has its own built-in clock, and is capable
of sinking and sourcing 25 mA, and runs from 2 to 5. 5
volts. A three volt lithium battery was use in this circuit for
power. The clock is set to run at 4.0 MHz. Port B provides
anode current via 100 ohm resistors. The cathodes are
pulled to ground using two NPN transistors with a base
resistor of 10K.
To turn on the transistors, a positive voltage is applied
to the base. Two columns of eight LEDs are used, with
each column having a common cathode. There is a
possibility of 512 different light combinations ( 29 = 512),
but I am only going to use a few (my fingers get tired of
typing code, as well as my brain). The lights are
multiplexed to save power and give the effect of being on
all the time (Figure 6).
To give a simple example of the code, you can turn
on all the anodes on one side of the earring with a binary
setting of 11111111, or a hexadecimal of 0xFF, or a
decimal of 255 on port B. All the anodes will be on.
Placing a binary setting of 00000001 or 0x01 in
hexadecimal, or just 1 in decimal on port A will turn on
column 1. If you just want to turn on one LED — for
example, the first one — writing a 1 to port B and a 1 to
port A will turn it on. If you want to turn on LED 9 (the
other column, first LED), writing a 1 to port B and a 2 to
port A would turn it on.
Since the microprocessor is running so fast, time
delays have to be added to slow down the on and off
times. The schematic is shown in Figure 6.
Okay, say you need some bling in a pinch. Push the
four resistors through the top of the board and solder.
Push four 3 mm LEDs through the top of the board,
putting the long leads into the square pads (Figure 7).
Turn the board over and solder the battery holder. You
just surface-mounted (Figure 8)!
Put a battery in and the earring should light.
This circuit takes advantage of color-changing RGB
LEDs. Unlike conventional LEDs that require external
intelligence to make them blink or fade, these RGB LEDs
have a microscopic microcontroller encapsulated witthin
them. Subsequently, you only need to add as little as two
volts of power to
have a colorful
show (Figure 9).
Have a Merry
42 December 2014
■ FIGURE 7. ■ FIGURE 8.
■ FIGURE 9.