Awesome!
Yes we will need a secret society. I just bought 4 Selectrics (one I, three IIs, and also a very strange Swiss knockoff—the Hermes 808), it looks like I'll have to join some kind of strange society for that too (probably a psychiatric ward).
The Selectrics and their marvellous banging inspired me to finish off the solenoid driver:
Schematics:
Top:
Bottom:
This was slightly more difficult than I intended. Once I started doing the sums I realised that it's really pushing the USB power spec to the limits. I was initially going to use the horrible old (cheap and available!) MC34063 switch-mode controller chip to get the 8–9V necessary, but it requires rather a lot of bypass capacitance on the input, and that is a big problem!
Because USB is hot-pluggable, they specify a max of 10uF bypass capacitance across Vbus and GND to stop the 5V sagging down too low on the other ports when you plug something in and all the caps charge up. With the controller board itself, we already have a nice juicy 4.7uF cap on there, plus one or two dozen 100nF local bypass caps scattered around like candy. The MC34063 usually wants a good 100uF or so (!); more modern switchers still typically want at least 10uF.
Making life even more difficult, one is only allowed to suck up to 100mA until you negotiate higher during enumeration. Ignoring the bypass caps, charging up the caps on the other side of the switcher is going to suck some juice for a little while too.
However there's a chip for that. Actually there's quite a few, but I used Micrel's MIC2009A. They are current-limited power switches; you set the current limit (about 400mA in this case) with a resistor. At first it's turned off, so the boost power supply is not running at all and we should be well below the 100mA limit. After the beamspring controller has negotiated over USB that it wants the full 500mA, we turn on the power switch with the enable pin. The current-limited soft start phase begins, the boost converter starts doing its thing and charging up the big output cap, and we're ready to go.
The MIC2250 switcher is a nice one; it runs faster than the old MC34063, so we don't need such a huge inductor, and it has a cool feature where it `dithers' the frequency to spread the noise out a bit over the spectrum, cutting down on EMI. I'm still a bit worried about interference with the capsense stuff. We will see.
I've used a big old ULN2003 relay driver with all of the darlingtons wired up in parallel, which is major overkill. It's old-school (a lot of voltage drop across two BJTs), but is cheap and effective. It even has flyback diodes built in which is handy.
I'm a bit unsure about the sums: the MIC2009A isn't very precise with its current limiting, could be anywhere between 320mA and 560mA despite me setting it to 430mA, and the amount of current RMS required to flail the solenoid at a higher duty cycle with somebody mashing the keys really quickly is obviously a bit of a guess. I think holding the solenoid in at 100% duty cycle could be beyond the limits of the 500mA interface; I think it wlil be about 240mA at 8V, and the MIC2250 switcher, although pretty efficient, isn't *that* good. However we don't want to turn on the solenoid constantly, I think a nice `clickick' smack/release like a Selectric would be quite pleasant.