Photographic Depth of Field

I was curious why a large aperture on a lens reduces depth of field. To investigate this I set my camera up with a macro extension tube and a subject with lots of depth.


The subject is a potassium sodium tartrate (Rochelle salt) crystal mounted in a brass holder, with a copper contact wire for detecting the crystal's piezoelectric properties. From the perspective of the camera, this setup looks like this:


This image shows a very short field, as is typical with macro photos that are taken from very close to the lens. The focal plane is about 10 degrees off of perpendicular from the surface of the coins, and intersects the subject about where the copper wire wraps around the crystal.

To understand why some parts of the image created when the aperture is large are blurry, it's helpful to visualize the paths the light takes through the lens. I used this simulator to make a simple diagram:


From any given point on the subject on the left, light passes through every point on the lens and is focused onto the camera's sensor. If you imagine a tiny bug with an equally tiny camera walking around on the big lens and taking his own pictures of the subject, you would noticed that depending on where he was standing, his photos would each be slightly different, sometimes from a little higher or lower, or one side or the other. We can simulate the bug camera photos by taking a picture through a pinhole placed in front of the lens.



Because the tiny bug camera has a really tiny aperture, all his photos will have very large depth of field, they'll be sharp all over. My bug-simulator has a fairly large pinhole, you can see it near the top of the image, it's about 2mm wide, so I won't get as much depth of field, but you can definitely see that much more of the depth of the image is in focus, compare to the image above and note how in these both the rubber band near the back of the image and the reeds on the edge of the coin are sharp. Here the bug is walking from one side of the lens to the other:




It's hard to tell in the still images, but the perspective is different in each shot, the angles all change a bit as the bug walks across the lens. It's easier to see this if you user a bigger hole so that you get a full-frame image instead of the circular shot, but it's harder to see the increase in the depth of field. Here is another example with a slot to let in more light. Left side from the top of the lens, right side from the bottom. 



Since the tiny bug camera can only collect a tiny bit of light with each photo, all those slightly-different photos will be quite dark. If we stack them all up to increase the brightness, we get the image we would get from the regular-sized camera. It's a bright, but only the parts that were all the same in the individual images will still look sharp in the combined image. The parts that were all slightly different will be all mixed together, making them appear blurry. 

That's exactly what the big lens is doing, stacking together thousands of different perspectives of the view all taken at the same time. We could get deeper depth of field in the image by using a smaller aperture, but that makes the image darker. To compensate we can increase the light on the subject, leave the shutter open longer, or use a more sensitive sensor.

To really see this effect, it's best to see it in a video, so check this out:


Web-attached pan tilt camera

With some help from Brandon and Ben I got the mechanics for the pan tilt camera rig going. The servos attach to an Arduino which is connected to a computer running a Windows web service that provides access to the camera.

I had an issue with the movement speed initially, and had to update the Arduino code with some position speed ramping. That went well and it is moving more smoothly. It flops around a bit, but I think that is mostly the slop in the mechanism.

The web service supports tagging of positions so that interesting views can be labeled. Once labeled a single button press takes the camera back to the associated position.

I will post some video of it in action soon.

Tippy forge

Here are a couple of videos of the tippy forge I've been working on for the Omaha maker Group. At this point it just needs the frame to hold it and a handle to make it easy to tip. There is a little leakage from the input that we need to get sealed up, but it works quite well so far.


Motor demonstration rig

One of the interesting projects from the Omaha Maker Group meeting on Jan 10. Ben put together this little motor demonstration rig with a couple of magnets, a 3D printed frame, and the armature from a commercial motor. Here he is just holding a couple of wires against the commutator as brushes. It's interesting to see the effect of adjusting the brush positions relative to the magnets.


Doorbell Upgrade

Recently I discovered that my doorbell has become unreliable. The UPS guy never wants to wait around, and sometimes he takes the packages with him, so I had to do something about this problem. I picked up a new bell at the hardware store for a couple bucks, but it's a cheap plastic model, where the original is a nice heavy metal model with a light in it.

I took apart the old one to see if I could swap parts to reuse the nicer one, and found that the only part that was really a problem was the button, which has degraded on the side facing the afternoon sun.


Fortunately the new one is almost exactly the same size, so I swapped it in and had a like-new repair. Cool, 5 minutes and the job was done.


Of course, as soon as I reconnected the wires the little light bulb burned out. It's been running continuously for 5 years now, so I guess that isn't too bad a lifetime, but I'd like the button to be lit, so I'll need to get that little guy out of there and find a replacement.


I'd probably have to spend $15 on a new lighted switch to get one of those little 20VAC bulbs, so I'll be looking for something else. Twenty volts is a little low for neon bulbs and electroluminescent wire or film, so I guess it'll have to be an LED. Fortunately I've got a ton of those. Red would be neat, but maybe a little boring. I have a bunch of IR LED's and some luminescent powder, so I could coat the inside of the button and make it glow, but I'll probably have to replace it again in a few years, and I don't want to have to reapply the glow powder. So I think I'll go with one of the blue LEDs I had left over from my binary clock project.

The LED will need a diode to block half the AC voltage and a resistor to limit the current. I used 33mA for the clock, and that's plenty bright for this, so I found an ~800 ohm resistor for this.


There isn't much space in the doorbell, so I marked where the circuit board did not lay on top of the metal contacts, connected the resistor and diode and laid them out to see where I'd need new holes for the leads.


Looks like it will fit without much trouble. There is just enough room between the PCB and the wall to avoid squashing the resistor. I marked the trace where the new holes will go and drilled them out.


Then cut the trace between the new holes.


A little work with a needle file to make some new pads around the holes...


And I can solder in the new components.


Next the LED goes in, but first I lopped off the lens with the dremel to turn the end of the LED into a diffuser. There isn't enough room in the switch body to stand it up, and the beam is too narrow for that anyway.


Before I reassembled the switch I took the chance to bend the contacts into a higher arc so that the button only has to be pushed about 2mm to make contact. It was set for more like 3mm, which put the button almost inside the switch body, which was contributing to the difficulty of getting it to work.

I put it back together and hooked it up, and it's working as planned:


A neat improvement on this would be to replace the factory board with a custom board with an ATtiny13 and a couple SMT RGB LEDs so that the button could cycle through a set of colors. It would reset when the switch is pressed, so the startup code could do a neat flash of colors to indicate that it had been pressed before returning to the usual slow color cycle.

Motorized Potentiometer

I had a broken micro RC car that used a gearbox with a tiny potentiometer on it for controlling the steering angle. I thought it would be interesting to replace the little potentiometer with a regular sized version so I could set the position either manually or from a microcontroller by driving the motor.

I drilled a bit of brass rod to fit over the gearbox output and to fit the stub of shaft on the back of the pot. I used some loctite and epoxy to connect the shafts together, and ran it a bit to get it all concentric, then epoxied a bit of aluminum strap to both.


The next step is to come up with some code to read the pot and drive the motor to the commanded position. Since it holds position without power to the motor, the h-bridge can be left idle except when it is moving to a commanded position, so that a user can turn the knob to adjust a setting.

Binding Books

This weekend some friends and I spent a few hours working on binding some books. We started with the paper from some drawing pads which we folded in half in sets of 4 to 6 to form signatures. We stacked between 5 and 8 of the signatures and stitched book tapes to them, then glued on the mull to form the book block.


I cut some 1/8th inch hardboard to make coverboards and the spine. To this we glued some card stock to make the hinge, and then to the coverboards we glued some fabrics.



The book block was then pasted into the cover along with end papers made from scrapbooking papers. This was then clamped to prevent the pages wrinkling while the paste dried.


The spines ended up being to wide IMO, I think I prefer them to be about 1/8 to a 1/4 inch narrower than we made these. On the other hand, we can put lots of stuff between the pages of these books and then the spine will be just right.

Zinc Casting

Did a quick zinc casting of a small knight figure. This was a sand casting demo for some friends who are interested in the skill. I was surprised that the shaft of the mace came out, since it is only about 2mm in diameter.

The casting ended up with a poor surface finish. I haven't worked out the main cause of this. It may be related to pouring temperature or venting.

For small things like this I think it would be interesting to try building a small electric furnace.

Re-Recording Test: I Am Sitting in a Room

A few years ago I ran across composer Alvin Lucier's work "I Am Sitting in a Room".

I thought that this was pretty cool, though excessively long. I've thought that it would be interesting to reproduce it, just for fun. Since the Makery is in a large multi-chambered concrete basement, it has some interesting acoustic properties.

So on Saturday I took my laptop down and plugged it into a little stereo and a USB microphone from the parts box at the Makery and tried some very simple re-recording experiments.

While I was doing the recording inside the Makery we noticed that the drywall was resonating fairly strongly, enough to rattle the array of hard disk platters hanging from the corkboard on that wall.

For recording I just used the Windows Sound Recorder. I mistakenly allowed it to save in the default WMA format which made getting the audio into Audacity tedious, since Audacity doesn't support WMA. For playback I just dropped the WMA files into Windows Media Player.

The work flow was pretty simple. I would listen to the recording to check the levels. If it sounded like it was clipping I'd adjust the volume on the stereo, delete the recording and rerun the one before it. To record I'd just hit play, wait a few moments, then hit record. Wait for the clip to end, then press stop and save the file. Repeat.

The microphone had to be pretty close to the speakers to get enough input level, but it picked up the room sound well enough. It would have been nice to get only the room sound by locating the microphone farther from the speakers, but on the other hand the original signal might degrade too fast to be as interesting to listen to.

The small speakers I was using have some pretty bad panel resonances, and don't have any low frequency extension to speak of, and I did get some pretty bad clipping in a couple of the samples, so the result is not nearly as clean as it could be, but it's a good first pass. For the next try I want to use some higher quality speakers and keep a closer eye on the input and output levels to avoid clipping anywhere in the signal path, and hopefully the speakers will be sufficiently constructed to eliminate most of the panel resonances.

A waterfall spectragraph shows the room modes, and how the sample degrades over time, which is interesting, but I want to do a higher quality recording before I post pictures of that.

Anyway, here are links to the clips. The first one is from inside the Makery, the second from the large room outside the Makery.


Testing the Aluminum Furnace

I and a couple guys from the Omaha Maker Group got together all the tools for doing some aluminum casting this morning. We're going to do a forge day with the group at some point, and we wanted to make sure my burner, the furnace body, and the crucible all work together.

Yesterday we fired it up at the Makery to make sure it at least worked well enough to go forward, which it did. We also made a box and a little ingot mold to use to cast some ingot-shaped ingots. We could use a muffin tin too, but we thought some traditional rectangular frustrum ingots would be cool.

For the second pour I rammed up a small mold from a previously made mold. We're thinking it will be fun to keep casting copies of copies and see how it degrades. While I was packing the cope we left the forge running. It went a little over temperature. The pouring temperature we aim for is about 1450F, when the aluminum has just a bit of a pink glow to it. This is way hotter than that.

Waiting around for some aluminum blocks to melt. There are some scrapped pieces of robot arm in there.

Opening up the mold after casting the skull.

Here is the setup for pouring from the crucible.


The crucible after pouring.

The inside of the furnace after running it up a bit too hot. Looking a little melty.

Hot ingots.


Here's a hard drive being recycled.

Pouring:

This was lots of fun, I'm looking forward to getting everyone together for forge day.