Sorry I've been a bit tardy about posting this video; I finished the staff immediately prior to attending a Halloween party, and arrived late enough as it was without having tried to upload a video. And then even after I uploaded the video, I hesitated about posting it here; I've yet to give you guys the source code for my program (since it's insufficiently commented and I don't know what version of the GPL to license it with), and it feels weird to post a capstone video if I might write more posts in the future. Still, I've made you wait for this too long; here is the final staff, in its completed form.
If you're still interested in seeing the source code, add a comment to this post and I'll see what I can do.
Tuesday, November 2, 2010
Saturday, October 30, 2010
Hardware: Video demo of fully assembled upper hemisphere
I've now completed assembling all of the LEDs for the project; they are both installed into the hemisphere and connected to the Arduino board in their final configuration. This video demonstrates how the orb functions, with all three phases clearly visible.
Friday, October 29, 2010
Hardware: Demonstration of glow LEDs embedded in styrofoam hemisphere
I've made further progress on the project, hollowing out the styrofoam hemisphere and connecting all three white LEDs in their final positions. Although nothing is soldered yet, and I still need to place the colored flashing LEDs, this video gives a sense of what the top of the staff will look like when completed.
Thursday, October 28, 2010
Hardware: Video of capacitive switch testbed
I put together a video of the current state of the project. While the board itself has been completely programmed, the rest of the hardware isn't finished yet; I've only got one LED hooked up, and both the grounding and capacitive plate are just pieces of aluminum foil I have clipped into various leads. Still, this shows what has been built so far, as well as demonstrating that the current design for the capacitive switch is functional.
Software: Design Specification
So far, I've been talking fairly generically about a "technomage staff" without really going into what it's going to look like and what it will do. First I'll describe it from "in-universe," that is, what it's doing in the context of the costume, and then I'll go into what this means in terms of actual behavior.
Since the costume is a technomage, the premise is that I have reserves of magical power I can use to cast spells or whatever. However, I can only channel a certain amount of this at a time, so on my own I'd only be able to cast relatively weak spells. To get around this, I use a magic item to store up my magic, so I can release it all at once in a larger spell. The staff will be this item: I hold my hand over it, and this will charge the orb at the top with power. The longer I hold my hand over the staff, the more power I imbue into it, until it has so much power it begins to flash dangerously, warning of an impending overload. If I ignore the warning, it will overload and begin drawing magical power on its own, even without using me as a source.
In reality, of course, all of the above will be expressed through LEDs turning on and off. I currently have 15 LEDs, which will be controlled by seven separate output pins. Three of these LEDs are white and are used during the first phase of operation, when I'm imbuing power into the orb; the longer I hold my hand on the switch, the more of these that will light up (in particular, one will light up immediately, a second will light after one second, and a third will light after two seconds). The remaining LEDs are used during the flashing phase, which begins one second after the third white LED has turned on; they are 4 LEDs each of red, green, and yellow, and will flash while the three white LEDs remain lit. If I remain in the flashing phase for five seconds (this is in addition to the three seconds it took to reach the flashing phase), I enter the overcharge phase; the colored LEDs continue to flash, but the white LEDs also begin to flash.
Up until the overcharge phase, releasing the sphere will turn off all the LEDs and return the orb to the off state; however, once it reaches overcharge, releasing it does nothing, and I need to touch it again to turn off the sphere. I've also added an additional feature, where if I am touching the orb when I turn on power to the system, all of the LEDs will turn on and stay on until I release and re-touch the orb again. This lets me use the staff as a flashlight if I wish.
I still need to clean up and comment the source code implementing the above design, but when I have done so I will post it here.
Since the costume is a technomage, the premise is that I have reserves of magical power I can use to cast spells or whatever. However, I can only channel a certain amount of this at a time, so on my own I'd only be able to cast relatively weak spells. To get around this, I use a magic item to store up my magic, so I can release it all at once in a larger spell. The staff will be this item: I hold my hand over it, and this will charge the orb at the top with power. The longer I hold my hand over the staff, the more power I imbue into it, until it has so much power it begins to flash dangerously, warning of an impending overload. If I ignore the warning, it will overload and begin drawing magical power on its own, even without using me as a source.
In reality, of course, all of the above will be expressed through LEDs turning on and off. I currently have 15 LEDs, which will be controlled by seven separate output pins. Three of these LEDs are white and are used during the first phase of operation, when I'm imbuing power into the orb; the longer I hold my hand on the switch, the more of these that will light up (in particular, one will light up immediately, a second will light after one second, and a third will light after two seconds). The remaining LEDs are used during the flashing phase, which begins one second after the third white LED has turned on; they are 4 LEDs each of red, green, and yellow, and will flash while the three white LEDs remain lit. If I remain in the flashing phase for five seconds (this is in addition to the three seconds it took to reach the flashing phase), I enter the overcharge phase; the colored LEDs continue to flash, but the white LEDs also begin to flash.
Up until the overcharge phase, releasing the sphere will turn off all the LEDs and return the orb to the off state; however, once it reaches overcharge, releasing it does nothing, and I need to touch it again to turn off the sphere. I've also added an additional feature, where if I am touching the orb when I turn on power to the system, all of the LEDs will turn on and stay on until I release and re-touch the orb again. This lets me use the staff as a flashlight if I wish.
I still need to clean up and comment the source code implementing the above design, but when I have done so I will post it here.
Hardware: Capacitive Switch Proof of Concept
While I'll go more into the software and general design of the staff later, I wanted to post this picture of my test of the use of a capacitive-switch plate to be used as the main control switch of the device. This was somewhat trickier than would be normal, since the staff will not generally be grounded; all of the circuitry will be encased in a sphere of styrofoam, sitting on top of a wooden staff, which at best would be resting against a wooden floor. Thus, I've decided to create a second plate, wired directly to the ground pin, which I will physically be touching at all times; this way, the board is grounded to me, and this seems to provide sufficient grounding to allow the capacitive-switch plate to work.
Below is a photo of my test setup, to verify that the grounding plate as described above actually works:
Here's what's going on in the image: The yellow jumper on the left is for the LED output (in fact, the board here is running the full circuit, so all pins from 12 to 6 are output LEDs; here, it's connected to 11 to demonstrate one of these). In particular, a 100 Ω resistor is connected to pin 11, which then connects to the positive lead on the LED; the negative lead (which I've bent, to remind me which one is which) is then connected directly to ground. A black clip goes from the LED's negative lead (which is equivalent to ground) and goes to the ground plate in the back. Pins 5 and 4 are the output and input pins on the capacitive switch, respectively; pin 5 has a 10 MΩ resistor, then the yellow jumper on the left, which connects to the capacitive plate on the left. Pin 4 has a piece of green wire connected to the rightmost black jumper, which then connects to the capacitive plate right next to pin 5's jumper.
Note that the entirely assembly is located on a glass-topped table; because it's connected to a 9V battery, there is no other grounding. I tested this circuit by holding one hand against the grounding plate and waving my other hand near the capacitive plate (generally, within 0.5 in); this activated the switch. This worked even if I was sitting in a wooden chair without any part of me touching the ground. Thus, by using a second grounding plate, it is possible to build a capacitive switch even in the absence of a true ground.
Hardware: The Arduino Uno
While my initial design was going to just be some logic chips on a breadboard (I envisioned a combination of simple "chase" pattern and always-on which would be easy to plot out with Karnaugh maps), I was soon convinced that I should move past simple logic design and get a programmable chip. This led me to the Arduino Uno, an all-in-one board which comes with a ATmega328 processor, USB input, the ability to be powered by a regular 9V battery, and direct access to the chip's digital I/O ports. The best part is the Arduino IDE, which lets you write programs in a variant of C, rather than machine code.While I can't claim that my code has been completely bug-free, the ability to write in a (relatively) high-level language and then immediately translate this code to an embedded microprocessor is fairly magical, keeping perfectly in line with the technomage theme.
Wednesday, October 27, 2010
Introduction and Explanation
This is a blog I'm putting together to document the main prop I'm building for my Halloween costume. At the suggestion of some friends, I settled on going at a "technomage," that is, some sort of magic + technology archetype. Not a particularly original idea, I'll grant, but given my track record I was already ahead of the curve. The costume itself isn't going to be that impressive (although I'll certainly post pictures of it here); I'll likely wear one of my nerd t-shirts, my cloak, and a wizard's hat, possibly with source code written on it.
The interesting part of the costume is going to be the staff I'm building to go along with it. Initially this was just going to be a painted styrofoam ball affixed on top of a walking stick; I imagined that painting the Debian logo (which is similar to a red spiral) would both be stylish and an inside reference. However, to be a true technomage staff, it should actually do technological stuff, e.g., have flashing LEDs. Once I decided that I was going to build a circuit, the plan kind of spiraled out of control, leading to the current project, which includes 15 LEDs and an Arduino Uno board to control everything. Future posts will both discuss the hardware and software used, as well as provide photos and videos of different parts of the build process.
The interesting part of the costume is going to be the staff I'm building to go along with it. Initially this was just going to be a painted styrofoam ball affixed on top of a walking stick; I imagined that painting the Debian logo (which is similar to a red spiral) would both be stylish and an inside reference. However, to be a true technomage staff, it should actually do technological stuff, e.g., have flashing LEDs. Once I decided that I was going to build a circuit, the plan kind of spiraled out of control, leading to the current project, which includes 15 LEDs and an Arduino Uno board to control everything. Future posts will both discuss the hardware and software used, as well as provide photos and videos of different parts of the build process.
Subscribe to:
Posts (Atom)