A number of people have asked me for the code for the Flickering LED for my Steampunk Tesla Cane.
It’s a modified version of the standard “Fade” Arduino example code. The original code I borrowed appears to have disappeared, but this instructable (not mine) has some “flickering” sample code: that is very similar:
Roughly, you make an array of values (the flicker below) and cycle through them. Some versions are far more complex, and generate a pseudo-random number for each step instead of a static set of values.
The original idea of using a Plasma Ball never really went anywhere, and when I saw another cane made by Der Geis while googling around, I decided to change directions a bit…
For my cane, the upper cane body is made of Delrin, a plastic that is easily machined, made by a friend of mine who is an expect machinist and uses a lathe and Delrin for making many parts. The stuff is very easy to work with, but doesn’t accept paint well, so its still black, but it does look a bit rubbery, so that fits with the electrical theme. A future redo may use wood or some other material, but Delrin was an easy and fast prototype material. The entire section is held together by hex key screws so I could disassemble and change things around. Oddly enough, the hex key (Allen key) isn’t widely outside of “period” for Steampunk, having been developed around 1910! Future versions won’t need this flexibility, so I may redo the head in wood, or maybe not… The tubes are held in place by grease fittings called “zerks” that are used for greasing some engines, and I borrowed the idea from Der Geis’s cane. My friend also custom made the brass insert from round stock, as well as the aluminum end cap. The interior of the handle is hollow, houses the electronics and batteries, and is wrapped in leather cord for a grip and a sword-like appearance.
The shaft of the cane is a wood dowel from another project, wrapped with twisted brass wire, and secured to the chamber of the cane with two more grease zerks, one for each wire. The twisting was done using a pair of safety wire twisting pliers. These are special pliers that are designed to twist wire together for safety links or jewelry. I love the look! Just google around for the “safety wire twisting pliers” and you’ll find them.
Now to the insides! The light tube is the body of a “lightsaber” keychain, just like the one cane I’m pseduo-copying, but I didn’t just use the whole thing like he did. I removed everything but the plastic light tube, supplying my own blue LED. I built a custom circuit using an ATTiny85 (I describe that here) and googled around for interesting affects I could make. That boiled down to two: I could pulse the LED on/off or I could use a “flickering candle” style. I posted a poll (here) and the overwhelming result was the flickering…I agree, it looks like its working, but just barely…very Steampunk!
Here is the entire circuit: the ATTiny85 in a socket for easy programming, the battery pack (3 AAA batteries in a round holder stolen from a $2 flashlight), a resistor, and the LED, heatshrinked into the end of the lighttube. The LED uses about 20mw of power and I get 1000mw from the batteries at around 4.5v…I left it running for 24 hours as a burn in and the batteries are still pretty full! I did not put in an on/off switch, as I didn’t have one that fit well, that’s for a future version.
I don’t have a great video of the cane running in the completed form, but the effect is clear in this prototype video I made for my friend who worked the Delrin for me:
Some time ago I saw a cool blog post on Gizmodo about a steampunk “Tesla Cane” where the creator, Virtuoso Datamancer, had designed a cane with a Tesla theme. Later I say pics on Flickr from one someone else had made.
I thought the idea was pretty cool but had no reason to pursue making one.
With the steampunk wedding in the future, I now had a real reason to make one!
With the advice (and probably some construction help) from the guys at work (one is an Electrical Engineer and the other is one of the heads of the robotics club) this is going to be pretty fantastic!
So far, I’ve ordered the Plasma Ball: a 3″ USB powered one from Amazon ($10). Its a little hard to tell from the description, but it may also be powered by 4 AA batteries (1.5v x 4 =6v, USB supplies 5v)…if not, it won’t be hard to convert the ball to running off batteries. The guys at the office want to use rechargable batteries so we can seal them in the cane!
The ball should arrive in a couple of days, then to (carefully!) disable it to see what needs to be modified.
I also need to find a cane body, either a wood cane (maybe a sword cane so its already hollow?) or a brass/copper tube.