OK, first, the "meat" of the matter. This is the overall project glance. Going clockwise from the voltage divider.
The voltage divider is set up to drop 20v of current down to a 5v current (Two resistors, R1 equaling 30k ohms, R2 at 10k ohms. If you look really closely you'll see that there are 4 resistors at 10k each. It's what I had on hand). I'm using a top end of 20v because that's the top end of what -I- would crank through one of these motors. The voltage divider is wired to the battery (+), the ground, and one of the Arduino analog read pins. This system allows me to see the actual voltage of the battery (across 1024 increments ranging from 20v to 0v). I may increase the voltage divider to drop 30v down to 5v. This will increase the protection on the Arduino analog input, and allow for a wider range of batteries to be used, without really sacrificing resolution.
The black breadboard is a simple low voltage trigger setup. This is actually the part that got this build started. Conventional AEGs use a high voltage, metal plate switch to turn the motor on and off. Watching these switches in action is a great demonstration of electricity, as the contacts frequently arc as the motor is turned off and on. This contributes to oxidation on the contacts, reducing circuit efficiency, which slows the motor down. On this system, those metallic contacts and "high" voltages have been transferred to a MOSFET breakout board. The MOSFET acts as a switch, but has no moving parts, and no arcing. Which the push button on the breadboard still has metallic contacts (teeny tiny little ones, compared to the mechanical switch of the old AEG), it's handling only 5v at just several dozen milliamps.
To the right of that is the fuse box. Inside is a 20amp, 12v automotive fuse. I'm taking a fair amount of pride that I haven't blown this fuse yet. Airsofters who mess with their guns blow-out fuses so often that many remove the fuse and short the terminals.
Next to that is the AEG gearbox. The air nozzle is on the far right (black). The blue tube to the left of it is the compression cylinder. To the left of the compression cylinder is where the cylinder travel space is. The actual spring is about 90% of the space from the start of the compression cylinder to the back of the gearbox. Different springs are available. This is actually a pretty weak spring (compared to those you find on AEG's built for range), as I use the AEG inside, or when I'm working in close proximity with people. The last time I checked the FPS it was around 220 Feet Per Second, which is pretty anemic. Still, it's a pain in the butt to get this spring back into the gearbox, so I prefer to not do it if I don't have to.
Below the cylinder and spring is the actual gear system. Three gears between the toothed cylinder and the pinion gear on the motor. The gear that interfaces with the cylinder is the sector gear. It only has teeth across half (approximately) of the gear. The sector gear also has two separate timing features on it. The first is a simple post on the gear that moves the air nozzle, to allow the next BB to fall in place. The second is a cam that moves an arm (the piece of metal sticking out of the gearbox under the cylinder, approximately an inch above the word "box" in "AEG Gearbox"). On a conventional AEG this arm breaks the trigger contacts after a single cycle of the gearbox, allowing the gearbox to fire strict single shots.
Below the AEG are two 4D Systems uOLED screens (the 96 and the 160). These screens have similar pinouts (The 160 has 2x5 pins, while the 96 has 1x5 and a 1x2 arrangement), and are very bright and colorful. They also sport their own embedded processors and uSD card slots. Both boards have an IO pin that can be used as a digital pin, a joystick (using a resistor arrangement), a speaker, or an 8 or 10 bit analog sensor. The 160 has an additional IO pin as well.
Above that is the MOSFET Breakout board from Sparkfun (http://www.sparkfun.com/products/10256)
. I replaced that MOSFET with a higher rated MOSFET I had purchased in bulk (IRT 3205). Again, airsofters that mess with their guns tend to do horrible things to them. I used a breakout board because I'm an electrical amateur. I had tried wiring the MOSFET up myself, without a board, and it just wasn't working. To the right of the board you may be able to make out a capacitor and diode arrangement. This is something that I'll need an actual electrical guy to look at and make sure it is spec'd correctly. I have no idea what the diode is, but it has HUGE leads. The capacitor has the markings 561 and 1kv. I'm guessing it's rated at a kilovolt. Again, it's what I had on the bench at the time.
Above that is the Arduino board, powered through a barrel jack which is run to the batter side of the MOSFET. I'm hoping that the MOSFET and diode/capacitor arrangement will protect the voltage input from the crazy electrical spikes generated by the motor in the gearbox. I'm using my oldest Arduino, a Diecimila (http://arduino.cc/en/Main/Boards
). Honestly, I can't believe this little board has survived all the abuse I've heaped on it.
To the left and below (at the 7 o'clock position) is the Arduino Nano board that will eventually be the brains of the gearbox. These things are tiny, but still pack all the features (and more) of the full size Arduino. I'm hoping to design a MOSFET breakout board that will sit on top of the Nano like a backpack (or Shield, which is the Arduino terminology).
Below the Nano is the Lithium Polymer battery. I love these batteries, but they have several special handling requirements. A big thing with airsofters is to hold down the trigger until the battery runs out (OK, maybe that's overstating it). Doing this to a LiPo damages it. One of my goals is to incorporate a battery safety system that will warn the user when the battery is running out, and eventually disable the motor when the battery is below a certain threshold.
OK, a big huge post. I apologize if "TLDR" applies here. I'm going to snack real quick, and post the pictures you really want.