carlfoxmarten: (default)
[personal profile] carlfoxmarten
Ah, technology. Why do you suck sometimes... =>.<=

So, the last magic wand the theatre company used emitted a brilliant flash, and would glow white when it was ready to go. It did this by using the xenon flash unit from an old film camera, with a white LED replacing the tiny, green one that originally signaled that it was ready. The next wand will be able to the colour of the glow change to match the fairy's outfit, and will have an extra option (triggered, well... somehow...) to make the glow LED “throb” or brighten and dim on a cycle.

For this new wand, I've decided to again use the flash unit from a film camera to produce the bright flash, but use a microcontroller to control the LED and the flash module. Unfortunately, this brings some major challenges, as the flash unit takes a major amount of current when it's charging the flash capacitor back up, especially at the beginning, when the capacitor is empty. The large inrush of current is exactly why they make charge-controller chips for cell phones, and at some point I will be looking into the idea, but right now they just confuse me, more than anything else, so I'll hold off on that for the moment.

Anyway, this great big gulp of power actually causes the microcontroller to reboot, something you want to completely avoid, if at all possible, even engineering around it when it becomes an issue.

One of the many options suggested as I've been working on this problem, along with sticking a current-limiting resistor in line with the flash unit, is to employ a decoupling capacitor to provide the microcontroller with its own backup power reserve for those two or three seconds when the flash is sucking so much power that, without it, the microcontroller would get rebooted. To ensure that the flash unit doesn't suck power from the capacitor, I've employed a diode to ensure the power only goes one way.

The only problem with this is the fact that I'd actually been using the wrong version of the microcontroller. My original intent was to power the wand off one of those 5V, tube-shaped, USB-charging batteries you can find for ten- to fifteen-dollars. That way, it would be very easy to tell when the battery's low (the wand doesn't work), and very easy to charge them back up again. Because of this, I'd chosen to use the 5V variant of the microcontroller (an Adafruit Pro Trinket, for those interested). Well, it turns out that, with the flash unit plugged straight into the USB battery, the battery gets drained completely in less than a second when the flash unit tries to charge itself. So, I decided to switch back to using three AA batteries instead, at least they can take that sort of current drain. So, a 5V microcontroller can run off 4.5V. But not through a capacitor and a diode, it seems. So I have to switch to the 3.3V version, which meant yet another trip to my friendly, not-so-in-the-neighbourhood electronics shop.

Despite having the right version in my stash now (since yesterday), I haven't actually tried using it yet. For one thing, I haven't been able to find the code I'd used previously, and since I have to program the new one before I can use it, that's a pretty big stumbling block. For another, I'm currently trying to write the code that will run either this incarnation of the prototype or a good step towards the final code that will run the wand, and those two are hard to tell apart sometimes.

The physical part of the wand will probably give me the worst problems, as I already know how to combine electronics together to get what I want, and how to write code to run it, but assembling raw materials into something isn't anything I've done before, so I definitely have a learning curve ahead of me. Thus far, I have two sizes of PVC pipe to use for the wand's handle, as well as both a battery tray and container for the electronic guts. In addition, I have a piece of aluminum curtain rail that will work very nicely for the shaft of the wand, as well as a bunch of plumbing connectors to make things disconnect relatively easily.

I'm pretty sure, given time, I'll get it done. I just don't know if it'll be done right, or well, but it'll be done...
Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
Account name:
If you don't have an account you can create one now.
HTML doesn't work in the subject.


Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.


carlfoxmarten: (Default)
Carl Foxmarten

August 2017

272829 3031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 22nd, 2017 05:08 pm
Powered by Dreamwidth Studios