It’s been a busy few months without posts, but there is lots of stuff going on, some of it even coming off the back burner!
Wild Wild West Con 4 is rapidly approaching…and since my Tesla Cane Mk II (with a copy of the Mk I electronics but with the original chip) is in the Sky Harbor Airport Steampunk Exhibition as I mentioned last time, I needed to rebuild the electronics for the Mk I cane itself. I somehow lost (or maybe they were …stolen by an Airship Pirate Gang?!?!) the original code for the flickering, I needed to recreate it. I actually found an earlier version I was fairly happy with in a separate backup, and it made sense to rebuild all the electronics using a Trinket instead of the barebones chip: easier programming (via the built-in mini-USB), battery/voltage management, easy reset, cleaner pinouts, etc.
The Mk I electronics were very simple (see here): I used a bare Atmel ATTiny chip, a resistor, and LED. In the last few years Adafruit and other companies have come along and make really awesome low-cost ATTiny-based boards (I covered them in this post about what to do when an Arduino is too big for your project), and I’d pickup up a couple of the Trinkets to play with. Since a bare ATTiny chip is $2-4 individually and a Trinket is $8…that seems a decent deal.
So, out with the old:
And in with the new:
The Trinket is slightly bigger, but being able to reprogram via USB is a great advantage!
This is a necklace I’m making for a friend. The lantern is a tiny little thing by Tim Holtz that came with an incandescent bulb. I replaced the bulb with a white LED and control the pulsing using an Arduino. I’ll eventually replace the Arduino with an ATTiny and run the whole thing from a 3v button battery.
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:
A couple of the projects I’m working on will require very small electronics that still need some sort of microcontroller to do something smart, like pulse an LED, respond to a button press, etc…For larger things, I’m using the Arduino series of microcontroller boards, powered by the Atmel AVR MCU (MicroController Unit), but often the final project is to be embedded in something, like a cane, visor, or prop gun, and a full sized Arduino board is too large, even the smaller ones, like the nano, and too expensive ($30+ ) for a complete board…and they are probably overkill for what you need, having far more pins (inputs/outputs) and unnecessary parts (like headers, onboard LEDs, etc.)
I happened across a Make Magazine article called “How-To: Shrinkify your Arduino Projects” that describes using Atmel’s ATtiny AVR chips, which are a much smaller (8 or 16 pin) and much cheaper (I got mine for less than $1 each on ebay) version of the brain of the Arduino, the ATMega328. You have less pins (2 digital, 3 analog on the 8-pin ATTiny8x series) but the darned thing is tiny, the size of my pinkie fingernail! Note that you could do this with the larger and more expensive ATmega chips, but if all you need is a simple microprocessor, the ATtiny is pretty awesome!
The Make Article references a post from “High-Low Tech”, an MIT Research Group. The article has since been updated to reflect the support in the newest Arduino IDE (1.03 as of this post) and describes how to wire up the ATtiny to the Arduino and program it via the Arduino IDE.
To program the ATtinys, you need an Arduino to serve as the programmer and you either wire up via breadboard the ATTiny or use an Arduino Shield for it. I got a shield from a Turkish Company, Flytron, for $20, that does both the 8 and 16 pin variants. After the Make article, lots of companies are making shields and programmers for the ATtiny platform (Sparkfun and Adafruit being the two most common and popular, but they are also all over ebay.) I do wish the shield I got had a ZIF (Zero Insertion Force) socket, as the pins bend easily taking the chip in and out, but other than that, its a nice little shield!
So, without further ado, here is my first programmed Atmel ATtiny85, running the Arduino LED Fade sketch! Its currently powered from a full Arduino board just for convenience, but sans battery the entire setup is smaller than the 2″x1″ breadboard its running on!