Step 1: Materials
* 1Iris Aperture (1 9/16" OD, 1 1/8" aperture diameter)
* 1 brass gear with a diameter larger than your iris aperture's (2 1/16"
* 1 brass gear with a diameter smaller than your iris aperture (1" or smaller)
* 1 small stepper motor
* 1 ultrasonic rangefinder (I used an SRF04)
* 1 large photoresistor
* 1 ATmegaX8 family uC (48, 88, 168, or 328)
* 4 2n7000 or equivalent mosfets
* 1 LM7805
* 1 100K potentiometer (optional)
* Ribbon Cable
* Male and Female breakaway pin headers
* Pipe with the same OD as the aperture
* Black thread
* Elastic Band
* Perf Board
* 12V Battery or power source
* Bench Grinder
* Super Glue
* Needle - straight or curved work
* Soldering Iron
* You can totally do this with two iris apertures! Adjust your materials appropriately
* The mosfets (2n7000) can be replaced by almost any other fet, or even BJTs. If you're going to use BJTs, Don't forget to put 1K base resistors.
* The battery can be anywhere between 9 and 12 volts. I used an 11.1V LiPo battery.
Step 2: Size the Frame
When it comes to completing the ring, I used a bandsaw blade spot welder, but you should be able to use super glue just as well.
Step 3: Embed the Ultrasonic Rangefinder
To do this, cut out a piece of leather about half an inch wider in diameter than the frame ring. You can use pencil to mark where you'd like to cut, if it helps.
Then, shiny side up, place the frame ring in the center of the piece of leather and try to fit the ultrasonic rangefinder inside of the ring. Make sure that the rangefinder's PCB doesn't overlap the frame ring. If it does, try to sand down the edges of the PCB using a bench grinder or belt sander. Make sure not to break any traces.
Trace the outline of the ultrasonic transducers (the metal cans with the cool metal mesh) on the leather circle with pencil. Then, draw an 'X' on the circle. You'll cut along the lines that form the 'X' with a knife in order to push the transducers through the leather. Check out the attached pictures if you're confused.
Finally, push the ultrasonic rangefinder into place by pushing the 'X' flaps inward, towards the rough side of the leather, then squeezing the rangefinder into place. This can be difficult if you didn't cut the 'X' large enough.
Now, onto the photoresistor!
Step 4: Embed the Photoresistor
Make sure that the frame ring still fits when both sensors are embedded at the same time.
You can trim and fold the excess leather over the ring so that the frame ring is embedded inside a hoop of leather. I used fabric glue to hold the flap down, but you could also sew it shut.
Step 5: Make It Comfortable
I got the idea to add some form-fitting support from aintMichael's Steampunk Airship Goggles.
In step 3 of his instructable, you can see how to construct the eye-cup that I used in my goggles.
In this case, cut out a pentagonal piece of leather, like the one in the picture below, so that the width is just a bit longer than the circumference of the frame ring, height is between 1/4" and 1/2". The angle of the taper on the last two sides is up to you. Try fitting it to your face when you're making your own.
Step 6: Attach the Actuated Gear
First, cut out a hole slightly larger than the aperture in the center of the brass gear whose diameter is larger than the iris aperture's OD. By slightly, I mean somewhere between 1/100" and 1/32". To do this, I drilled out the center of my gear and mounted it to a plastic disk with a screw. I then put this in a lathe chuck and turned out the center of the gear.
Next, cut a slit the width of the iris aperture's pin into the brass gear. The slit should be along a radius of the gear, so it may be helpful to cut the slit first, depending on your method of cutting the hole. I used a bandsaw to cut the slit with pretty poor accuracy, but I still had a couple of 64ths of an inch to play with. To correct for this, I sanded down the gear until the slit looked nearly radial.
Finally, place the ring-gear around the aperture so that the actuator pin fits within the slot in the ring-gear. Stand-off the gear so that the gear is in the center of the actuator pin when looking at it from the top of the pin. Turn up your soldering iron and start to heat the junction. Try and heat the gear first, tin it, then move on to the pin. Tin the pin, then bridge the gap. Use flux if needed.
Step 7: Make the Supportive Eyepiece
I found a piece of bicycle tubing that fit the edge of my aperture perfectly, so I decided to cut off a good 11/16". You can round up or down, depending on the structure of your face. Make it long enough so that the gear will fit comfortably.
Note: Notice how the ID of the tube isn't small enough to overlap with those little circles on the aperture. This is CRITICAL! Those circles are actually pegs that rotate in holes. If you're going to super glue the tube to the aperture, you need to make sure that the super glue won't go into those holes!
Now, we're going to carve part of the tube out so that the tube isn't just jamming into your face. I tried to trace out all of the parts of my face that were coming in contact with the tube while holding it up to my face. Then, I'd go over to the belt sander and go at it until I thought I was done. This was an iterative process, so I'd say just go for it. If you mess up, you always have more tube! The largest grind that I made was to accommodate my brow.
Step 8: Attach the Supportive Eyepiece
To glue the eyepiece to the aperture, you need to use a secret ingredient - thread! The thread keeps wicks the glue away from the aperture via capillary action, preventing the glue from getting into the holes that I mentioned in the last step.
I lined up my eyepiece with the aperture so that the little pin was pointing 45° left of vertical when the aperture was all the way open and I was looking at it from behind. This way, when the aperture is closed, the pin rotates around to 45° right of vertical.
Next, I wrapped some cotton thread twice around the circle where the eyepiece and the aperture meet. I made sure that they were both lined up perfectly, then I put in two drops of super glue, on opposite sides of the aperture. If you feel like you need more glue, feel free to use more, but don't overdo it! Otherwise the glue will wick into those holes, and your aperture will freeze up.
Step 9: Attach the Drive Gear
To make my coupler, I turned down some aluminum on the lathe at my local hackerspace (MITERS), drilled out a hole equal to the diameter of the motor shaft, (which happened to be perfect for tapping 4-40 screws, then faced it off. I tried to tap a hole for the 4-40 screw that you see sticking out of the coupler in the picture, but the threads stripped and I ended up crazy gluing the whole thing together.
I also tapped a hole for a set-screw to hold the coupler to the motor shaft.
Step 10: Give the Aperture an Actuator
I chose to cut out a strip of 1/8" aluminum about 1/2" wide and 1ft long. I started by wrapping the stepper motor as tightly as I could in the middle of the strip. I then drilled two holes and clamped the stepper motor in the strip with a nut and bolt.
Attaching the clamped stepper motor to the eyepiece required trial and error, but I basically bent the strip so that it wrapped around the eyepiece while supporting the stepper motor rigidly at some distance from the eyepiece. You need to make sure that the gears are meshing correctly, and that the two gears stay in contact throughout the aperture's entire 'swing', if you will. If the gears are too close to each other, the stepper motor might not be able to drive the aperture because of friction.
I super glued the aluminum strip to the eyepiece to fix it in place.
At this point, you might want to test the stepper motor/aperture assembly.
Step 11: Wrap Her Up in Leather
The bridge was made out of a 1 1/4" strip of leather rolled up, then sewn to the eyepiece and the eye cup. I tried to figure out how long the strip should be and where it should be placed based on my own head. You should try to do the same!
Finally, I added an elastic band on the back. I found mine from an old bed-sheet holder, but you can pull yours off of underwear or whatever you find lying around. I didn't cover the strap in leather because my last needle broke while finishing that, but I'm sure it'd look much more awesome if it were covered.
Step 12: Wiring
For the stepper motor I used, I needed six, for the ultrasonic rangefinder I needed four, and for the photoresistor I needed two. I attached female headers to both ends of the ultrasonic rangefinder's cable, one male 2X4 header and one female 1X6 header to the stepper motor cable, and one female header to the photoresistor, since I could just solder the cable directly to its leads.
You can route the wires nicely by sewing them into the straps, then zip-tying them together behind the neck.
Step 13: Give It Brains
I soldered a DIP header onto some perfboard, then added male headers for the sensor and stepper motor cables. I have a potentiometer that's used as a variable resistor in a resistor divider with the photoresistor. This lets me play with the scaling in case I go from a really dark room to the outdoors on a sunny day. I also used four mosfets (2n7000) to use as switches so that the motor can be driven from the ~12V battery, and not from the microcontroller. Finally, I added a 5V regulator (LM7805) to power the microcontroller.
I'm programming the microcontroller off-board, but you can add a programming header if you'd like.
The code is fairly simple. Basically, I ping the ultrasonic rangefinder, sample the photoresistor, calculate a scaled time average, and then step the stepper motor in the direction that it needs to go. Rinse and Repeat(); I also run an initial calibration cycle that forces the iris to open all the way, since I have no clue how open the iris is initially. (If someone's been messing with it) I've included the code and the makefile that I use.
Step 14: Eyeborg It Out
These baby's kill your ability to perceive depth, but at least you get to have a superhuman response to the same stimuli that your real iris uses!
Video coming later today!