Optical Commutation

I finished putting together an optical commutation circuit on a breadboard tonight. It uses an IR emitter/detector pair to trigger timer chips that ultimately turn on power transistors to drive solenoids. The solenoids are logically opposite, so they alternate as the IR beam is made and broken.

The timer chips aren’t strictly necessary, but they prevent the solenoids from staying on too long and burning up. You can see this in the video below when I am blocking and unblocking the IR path using a playing card–I sometimes leave the card in or out for a few moments, during which time whichever solenoid is powered returns to a resting state after about one second.

I’ll use this circuit to drive the two solenoids in my solenoid engine, which will have a rotating half-moon to block and unblock the IR beam.

Solenoid Engine Prototyping

I’ve started thinking about how I might build a solenoid engine. I bought a couple solenoids on Amazon, Uxcell brand, and they seem to have quite a bit of zip to them, so I’ve been looking into how to mount them to a block in a way that would allow them to rotate around an axis, eliminating the need for the connecting rod to rotate with the piston head, which in this case is just the armature of the solenoid.

Pictured below is the first three attempts at printing a little box to hold a solenoid. The little wings on the side have 1/8″ holes in them that will fit over a rod, allowing the solenoid assemblies (I plan on having two of those) to lie directly over the crankshaft and rotate back and forth with the cranks.

You can see the design process as it unfolded, first with no venting on the sides, then with vertical venting and finally diagonal venting to allow the solenoids’ windings to cool off better during operation. I don’t know how much of a problem heat will be, though, since I’ll be running somehow around half the rated service voltage of the solenoids, at 50% duty cycle to boot.

I did melt the diagonal vents a little with a heat gun while trying to de-string the object. Oops.

The PRalarm

I have been working on stuff without posting about it this entire time. My latest finished product is the PRalarm, short for Pull Request alarm. It is an Arduino-driven USB device that lights up when somebody pushes a pull request that needs review.

We recently transitioned to this source control pattern at my work, so I decided this device would help me stay on top of reviews better than yet another e-mail alert.

The Arduino is a Teensy LC with a simple “rawhid” program that accepts messages from the PC host. When the device gets any kind of message, it does a three-second lightshow. On the PC side, I just use a cron job that uses the “hub” command-line github client to check the latest PR number and compare it to a hidden file, ~/.pr. If the PR from hub is newer than what’s in the hidden file, or if the hidden file does not exist yet, the script calls a C program that sends one message to the device and then terminates. The script then records this latest PR number back into ~/.pr.

Here is a picture of the device, which is inspired by the git logo. I’ll work on getting a video recorded of the lights in action.