Thanks in no small measure to a timely visit from my friend Jim Gadd I've now got a much better grasp of what's required to drive a solenoid from the Basic Stamp. I've tossed the old circuits and replaced the redundant voltage regulators with transistors, as per my original idea. Thanks to Jim we had all set to rights in a brief afternoon's tinkering and I've been happily programming away ever since!
|Photo #1: Incorrect circuit for two solenoids, altho only the one on the right has one attached. Well, it seemed right to me, but at the time I didn't know the difference between a voltage regulator and a transistor. Ah, well...|
|Photo #2: Correct circuit, utilizing an IRFDC20 HexFet suggested by Jim Gadd. There's also an LED in each circuit so that I can monitor results without hooking up an air supply and making the thing jiggle all over the place. I soldered small "plugs" on the ends of the solenoids' wires. This really helps, as there was frequent plugging/unplugging when we were optimizing the circuitry.|
|Photo #3: Overall shot of circuit board coupled to Basic Stamp. I was taking power for the solenoids, their FETs and the Stamp from the Stamp's Vin bus, but I've since switched over to an external power supply (not shown), because the Stamp's wall wart didn't have enough juice to activate more than one solenoid at a time.|
At present my programming skills are for shit, but thanks to a few tricks I've picked up from Jim I've now got a feel for what's needed to make the thing work. To date I've managed to write several subroutines that, when combined, actually do make the thing sort of dance. The next thing I've got to figure out is where to go, to find some transcribed dance steps that I can "arrange", to use the composer's term, into something that works for Patty.
Following is the latest program listing, which includes several subroutines, along with descriptions of what happens when they run.
Return to A Foray into Robotics