Glowstick a Go-Go
Read this article in MAKE:
01: Make Premiere, Page 34.
To get MAKE, subscribe or purchase single volumes.
Bunnie Huang prototypes two kinetic glowsticks: instead of creating a single arc of light, glowsticking dancers can now create their own two-dimensional fantasias.
From the column Bunnie's Workbench
By Bunnie Huang
Bill of Materials
When I'm building these kind of prototypes, I almost never choose any part that I cannot find in stock at Digi-Key. There may be other better or cheaper inductors, but they were too hard to acquire for a project like this one.
| Qty | Digikey P/N | Description |
| 10 | 399-1100-1-ND | 0.1uF 0603 Capacitor |
| 2 | 311-1.0KGCT-ND | 1k 0603 resistor |
| 1 | X928CT-ND | 4 MHz ceramic resonator |
| 1 | 308-11771-1-ND | 22uH inductor, SMT |
| 3 | 311-47KGCT-ND | 47k 0603 resistor |
| 2 | 399-1556-1-ND | 47uF, 6.3V "C" tantalum capacitor |
| 1 | 311-80.6KHCT-ND | 82k 0603 resistor |
| 1 | 311-100KGCT-ND | 100k 0603 resistor |
| 1 | 311-200GCT-ND | 200 ohm 0603 resistor |
| 1 | 311-221KHCT-ND | 221k 0603 resistor |
| 2 | 311-240KHCT-ND | 240k 0603 resistor |
| 2 | 5230TRK-ND | Board-mount battery connector ends |
| 1 | H2131-ND | 6-pin programming header |
| 4 | 743C083181JCT-ND | 180 ohm resistor array (optional) |
| 16 | 160-1436-1-ND | Red LED, 0603 case |
| 8 | 67-1820-1-ND | RGB combo LED (optional) |
| 3 | MA3J70000LCT-ND | Schottky diode, SOT-23 package |
| 1 | MAX1676EUB-ND | Voltage regulator / MAX1676EUB |
| 4 | MM74HC595M-ND | 8-bit shift-register |
| 1 | PIC16LF876A-I/SS-ND | PIC microcontroller |
| 3 | P8045SCT-ND | Push-button switch |
Code Listings
Listing 1: code used to implement the FPGA on the first prototype
module top(hdc, led);
output hdc;
output [15:0] led;
reg [23:0] count;
wire clk, to_bufg;
wire [4:0] spriteCnt;
wire [3:0] frameCnt;
reg [15:0] ledinv;
OSC4 oscut (.F8M(), .F500K(), .F16K(to_bufg), .F490(), .F15() );
BUFG bufut (.I(to_bufg), .O(clk));
assign led[15] = !ledinv[15];
assign led[14] = !ledinv[14];
assign led[13] = !ledinv[13];
assign led[12] = !ledinv[12];
assign led[11] = !ledinv[11];
assign led[10] = !ledinv[10];
assign led[ 9] = !ledinv[ 9];
assign led[ 8] = !ledinv[ 8];
assign led[ 7] = !ledinv[ 7];
assign led[ 6] = !ledinv[ 6];
assign led[ 5] = !ledinv[ 5];
assign led[ 4] = !ledinv[ 4];
assign led[ 3] = !ledinv[ 3];
assign led[ 2] = !ledinv[ 2];
assign led[ 1] = !ledinv[ 1];
assign led[ 0] = !ledinv[ 0];
always @(posedge clk) begin
count <= count + 1;
end
assign spriteCnt[4:0] = count[9:5];
assign frameCnt[3:0] = count[19:16];
// 130 bpm = 2.167 bps = 0.4615 seconds per beat
// four bars = 34.67 seconds
// 19 64 about one minute
// 18 32 // 16 bars
// 17 16 // 8 bars
// 16 8 // about four bars <== set point at four bar points
// 15 4 // 2 bars
// 14 2 // about one bar
// 13 1 second
// 12 500 milliseconds
// 11 250
// 10 125
// 9 62.5
// 8 31.25 milliseconds
// 7 15
// 6 7.5 ms
always @(spriteCnt or frameCnt) begin
case( frameCnt )
4'b000: begin
casex( spriteCnt ) // smiley face
5'bx0000:
ledinv <= 16'b0000001111000000;
5'bx0001:
ledinv <= 16'b0000110000110000;
5'bx0010:
ledinv <= 16'b0001000000001000;
5'bx0011:
ledinv <= 16'b0011000000001100;
5'bx0100:
ledinv <= 16'b0110011001100110;
5'bx0101:
ledinv <= 16'b0100011001100010;
5'bx0110:
ledinv <= 16'b1100000000000011;
5'bx0111:
ledinv <= 16'b1000000000000001;
5'bx1000:
ledinv <= 16'b1000000000000001;
5'bx1001:
ledinv <= 16'b1100100000010011;
5'bx1010:
ledinv <= 16'b0100010000100010;
5'bx1011:
ledinv <= 16'b0110001111000110;
5'bx1100:
ledinv <= 16'b0011000000001100;
5'bx1101:
ledinv <= 16'b0001000000001000;
5'bx1110:
ledinv <= 16'b0000110000110000;
5'bx1111:
ledinv <= 16'b0000001111000000;
endcase // case( spriteCnt )
end // case: 4'b000
4'b001: begin
case( spriteCnt ) // rabbit
5'b00000:
5'b11111:
ledinv <= 16'b1100110000000011;
endcase // case( spriteCnt )
end
endcase // case( frameCnt )
end // always @ (spriteCnt or frameCnt)
assign hdc = 1'b1; // always high, so configuration status LED is off
endmodule
Listing 2: Snippet of C code of a PIC function call for displaying data using the second prototype's scheme.
#include <16F876A.h>
#device ICD=TRUE
#use delay(clock=4000000)
#fuses XT,NOWDT,NOPROTECT
#define SD_CLR_MSK 0x10
#define SD_CLK_MSK 0x08
#define SD_RCK_MSK 0x20
void display_green(unsigned long data) {
char i;
char db = 0;
port_c = SD_CLR_MSK;
// shift the bits in
for( i = 0; i < 16; i++ ) {
db = SD_CLR_MSK;
((data & 0x8000) == 0x8000) ? (db |= 1) : (db |= 0);
data <<= 1;
port_c = db;
db |= SD_CLK_MSK;
port_c = db;
db &= ~SD_CLK_MSK;
port_c = db;
}
// now make it show up
port_c = SD_RCK_MSK | SD_CLR_MSK;
port_c = SD_CLR_MSK;
}
MAKE: Noise — Discuss this article
You must be logged in to post a talkback.[ Display main threads only] [ Oldest First]
Showing messages 1 through 24 of 24.
- Readers may also be interested in...
Reply
http://usb.brando.com.hk/prod_detail.php?prod_id=00456Posted by enliteneer on March 18, 2008 at 11:49:02 Pacific Time
- New parts list
Reply
Here's what I think is a new up to date list of parts. I am not an engineer. The total is $60. That includes $20.64 for 8 rgb leds. Red leds are also included.
3 P8045SCT-ND $3.33
1 PIC16LF876A-I/SS-ND $8.23
10 399-1100-1-ND $0.20
10 311-1.0KGRCT-ND $0.70
11 X928CT-ND $7.26
1 308-1509-1-ND $1.42
10 311-47KGRCT-ND $0.70
2 399-3756-1-ND $0.86
10 311-80.6KHRCT-ND $0.77
10 311-100KGRCT-ND $0.70
10 311-200GRCT-ND $0.70
10 311-221KHRCT-ND $0.77
10 311-240KHRCT-ND $0.77
1 BC2AAAW-ND $0.67
1 HR2014-ND $0.87
10 743C083181JPCT-ND $1.61
16 160-1436-1-ND $1.78
8 67-1820-1-ND $20.64
3 MA3J70000LCT-ND $1.62
1 MAX1676EUB+-ND $5.43
4 MM74HC595M-ND $2.00Posted by markl81 on July 30, 2007 at 16:44:43 Pacific Time
- Current Mirror LED Driver
Reply
One of these two chips from TI might make the LED output easier to get consistent: TLC5922 or TLC5940. You can tweak the brightness of each LED independently via the serial interface.
Since the LEDs are controlled by a serial interface it might also be possible to use one of the 8 pin PIC parts so the overall design could be kept small.
I didn't look at the power budget implications but I doubt it would be much worse (and may be better) because you can remove a bunch of the LED voltage regulation parts.
Posted by mjm28 on July 27, 2005 at 13:28:44 Pacific Time
Reply
Is there any chance of a kit for this?
Or even ready made ones?
Without the schematic and circuit board, it's kinda hard to build.Posted by DavidMcC on July 26, 2005 at 06:05:41 Pacific Time
Reply
perhaps an addendum to the article can be posted to include information to help the less experienced but equally enthusiastic?Posted by juusan on July 17, 2005 at 13:44:27 Pacific Time
- bummer
Reply
as someone with electronics experience, I can honestly say that this article is essentially useless to all but seasoned electronics folks unless it includes a schematic and wiring diagram. a skill-level rating would be also be useful for projects at this level so that the poor newbies out there don't spend hours beating their heads into a brick wall and end up hating your magazine for making them feel stupid.
:)Posted by juusan on July 17, 2005 at 13:43:13 Pacific Time
- The parts list for this is all SMD
Reply
How is a hobbyist to build something like this when everything is surface mount? MAKE needs to have some better explainations on how to build SMD circuits, and not just give out a laundry list.Posted by dante_mw on June 01, 2005 at 10:45:42 Pacific Time
- The parts list for this is all SMD
Reply
Hiya -
Thanks for the feedback. The list that appears on this page is content that's in addition to the article which appears in the magazine. There's quite a lot more detail in the print article. Have you seen that?
-terrie
Posted by terrie on June 01, 2005 at 11:08:19 Pacific Time
- article learning curve
Reply
I agree that the article did not provide sufficient resources for most people to build the project presented. I recently had a use for handheld persistence of vision devices (in performance), and I thought it would be fun to build my own. I revisited the MAKE article, expecting to be able to cobble it together, but even between article and website (which at least has a parts list, something conspicuously lacking in the article), I would still need to spend a lot of time digging up information on how to build everything. Obviously some readers are more knowledgable in electronics than I, but some links for us newbies would be helpful!Posted by prophecy_boy on June 10, 2005 at 16:12:41 Pacific Time
- The parts list for this is all SMD
Reply
Yes, I have a subscription and I love it! However this article disapointed me. It made me want to build something similar, but it requires significant skills in electronics that the article does not guide the reader in learning. A few resources on how to build a project such as this in more detail with step by step instructions would be killer! Until then this is just a tease. Definately not something you could build unless you were a Electronics Engineer.Posted by dante_mw on June 01, 2005 at 12:30:26 Pacific Time
- Cool simple algorithm to control LED brightness
Reply
A while back, I read about very simple/efficient algorithm for controlling the brightness of LEDs called Bit Angle Modulation.
You can read more about it on page 8 of this PDF:
http://www.artisticlicence.com/app%20notes/appnote011.pdf
In short, It produces Less flicker, Very low CPU overhead compared with the common PWM method and it should save on battery life as well (fewer 74HC595 updates per second)
-Dan G.Posted by d.gendreau on May 16, 2005 at 13:19:14 Pacific Time
- Cool simple algorithm to control LED brightness
Reply
I read the app note about BAM from your link and thought it was interesting. Have you actually implemented it before? Do you know anyone who has? I'm not sure how to code it. Any help would be great.
Thanks,
Brian
Posted by baj38 on January 31, 2006 at 13:53:48 Pacific Time
- Cool simple algorithm to control LED brightness
Reply
Any info on the BAM algorithm of a PIC chip?Posted by bronx68 on October 10, 2007 at 11:09:42 Pacific Time
- Cool simple algorithm to control LED brightness
Reply
Do you have any info on how to code the BAM algorithm in a PIC chip?Posted by bronx68 on October 10, 2007 at 11:05:54 Pacific Time
- Voltage versus current as the control
Reply
I really like the power efficiency of this design which comes from chosing the LED Vf as the circuit voltage. However, since brightness is based on current and current is exponentially tied to voltage, I wonder about consistency between the LED's.
Specifically, if the Vf between a couple LED's differs by just a few tenths of volts, that will cause a change in the current of several mA. The eye sees brighness logarithmically, so perhaps the error is not so noticeable. Alternatively, I suppose judicious use of series resistors could balance things out a bit.
=Omni
Posted by omni on May 09, 2005 at 12:00:23 Pacific Time
- Why does bit 9 have 15 Hz toggle rate?
Reply
On page 37: "Going back to the frequency divider property of a binary counter, we see that bit 9 on a counter clocked at 16kHz will have a toggle rate roughly equal to 15 times a second."
By my calculation, if bit 0 has a toggle rate of 16kHz, then bit 9 will have a toggle rate of 16kHz / (2^9) = 31.25 Hz. What am I missing? Thanks.Posted by deisner on March 26, 2005 at 17:40:40 Pacific Time
- Why does bit 9 have 15 Hz toggle rate?
Reply
Bit #0 will toggle once every clock, so it will take TWO clocks to go from low-to-high-to-low which is one cycle of bit #0.
So bit #0 has a frequency of clock divided-by-two which is 8 MHz.
Is that clearer?
If you work all the way down, you get this equation:
Fout = Fin / 2^(bit_number+1)
where bit numbers count [0,1,2,3...]
So:
Fout = 16 MHz / 2^(9+1)
Fout = 16 MHz / 1024
Fout = 15,625 HzPosted by alankilian on March 28, 2005 at 19:08:10 Pacific Time
- Why does bit 9 have 15 Hz toggle rate?
Reply
Oh MAN, that didn't help clear things up did it?
I used 16 MHz as the clunter source instead of 16 KHz sorry.
The message kind of holds together is you replace MHz with KHz and make the final number 15 Hz
Sorry again for making things worse.Posted by alankilian on March 29, 2005 at 13:14:11 Pacific Time
- For those of us starting out...
Reply
While the parts list and the code is good to have I would really like to attempt this sort of project but don't seem to get enough from the article. What resources and skills will I need to take this on?Posted by Deek on February 26, 2005 at 23:23:10 Pacific Time
- Glowstick...
Reply
A parts list and some programming pieces are very helpful but how about wiring diagrams and layouts for those of us who do not yet have the background to "fill in the gaps" yet would like to build one of these??
I really was believing that this was a genuine "How to" magazine!!Posted by hstanley on April 12, 2005 at 16:29:19 Pacific Time
- Figure 3
Reply
Am I right in thinking that the graph in figure 3 has typos? The Bit 0 line seems incorrect. I could also be reading it wrong...Posted by chriscook8 on February 24, 2005 at 11:50:16 Pacific Time
- Figure 3
Reply
I thought the same thing....
it should read:
0000 0001 0010 0011 0100 0101 0110 0111 1000
binary 0-8
the graph is correct, just the numbers in the graph are wrong, so is the binary count above it. At least thats what i think.Posted by chupa0@gmail.com on March 02, 2005 at 10:26:28 Pacific Time
- Figure 3
Reply
If you look closely, the row for Bit 0 in Figure 3 is incorrect, too. It reads "0 1 0 0 1 0 0 1" when it should read "0 1 0 1 0 1 0 1."
Posted by deisner on March 26, 2005 at 17:34:57 Pacific Time
- Figure 3
Reply
Yeah, the graph/chart is pretty messed up.Posted by alankilian on March 28, 2005 at 19:10:14 Pacific Time
|
Showing messages 1 through 24 of 24. |
Join the conversation -- every MAKE article has an online page that includes a place for discussion. We've made these RSS and Atom feeds to help you watch the discussions: subscribe.

Why advertise on MAKE?
Read what folks are saying about us!
Click here to advertise on MAKE!
Explore More in Make Magazine
Search the pages of MAKE
Raves for MAKE!
“Now we've got geek DIY (do it yourself) porn. Just as would-be Emerils pore over lushly illustrated cookbooks with recipes involving hard-to-find morels and complicated instructions for roux, Tom Swift wanna-bes are devouring MAKE.”
— Steven Levy, Newsweek
“...O'Reilly Media recently launched what has already become the bible of this new movement, a magazine called MAKE.”
— Daniel Roth, FORTUNE
“If you're the type who views the warnings not to pry open your computer as more a challenge than admonition, MAKE is for you.”
— Rolling Stone
“One of the most innovative magazines I've seen in a long time.”
— Steve Riggio, CEO Barnes & Noble
“The kind of magazine that would impress MacGyver”
— Marcus Chan, San Francisco Chronicle
|
|

