Pinhole cameras used to be a messy business, with negatives and developing and printing. With digital cameras that have interchangeable lenses, it has become much simpler.
You can take a picture without a lens. Just replace the lens with a scrap of aluminum foil that has a tiny pinhole in it. The smaller the pinhole, the better the focus will be. The trade-off is that less light gets to the camera's imaging sensor.
(Click on any photo for a larger image.)
If you look very closely in the center of the aluminum foil, you can see a tiny pinhole, made with a sewing needle. The foil is folded over an extension tube that fits onto the camera like a lens. The tube is 23 millimeters long, so we will take that as our nominal focal length.
Here is a photo of my car, taken using that pinhole. The exposure took 10 seconds at ISO 100.
The photo is quite blurry, but nonetheless, there is a recognizable image there.
A pinhole telescope
Since I have more extension tubes, lets change the focal length to 139 millimeters and see what happens. Again, I used a 10 second exposure at ISO 100.
Taken from the same distance, we can now read my license plate. The ratio of the two focal lengths (139/23) is about 6, and when I count the pixels of my license plate in both photos, I get about the same ratio — 1406 pixels wide in the telephoto shot, and 237 pixels wide in the wide angle shot.
Using my microscope, I took this photo of the pinhole:
Superimposing that photo on top of a photo of my stage micrometer slide, we can measure just how big my pinhole is:
It turns out to be 0.36 millimeters, or 360 microns, in diameter.
Here's a picture of a pot of flowers, taken at ISO 200 for 30 seconds, with the 139 millimeter extension tubes:
The optimum size of the pinhole to use was calculated by Lord Rayleigh in the nineteenth century to be:
where f is the focal length and lambda is the wavelength of the light. Using 550 nanometers as the wavelength, and solving for f, we get:
Since the diameter of our pinhole is 360 microns, we get about 6.5 centimeters for the optimum focal length.
Setting up my extension tubes for 68 millimeters, I got the photo above, using ISO 100 at 30 seconds. The focus is still quite soft compared to even a cheap lens, but this was made using aluminum foil and a rubber band.
Fixing some problems
My next pinhole attempts to fix some of the problems in the quick and simple version. First, I want to reduce the reflections inside the camera from the shiny foil. I am doing this by putting a disk of black paper behind the pinhole, with a small area cut out in the center. This should improve the contrast by keeping the light from the pinhole from bouncing off the image sensor, then back to the foil, then back into the sensor.
Second, I want to try a larger pinhole, on the assumption that any irregularities in it will be diminished on comparison to the aperture.
Third, I will make it a little more robust by using the thin aluminum from a soft drink can instead of aluminum foil, sanding the center down a little to thin just the part I want thin.
My new pinhole is 620 microns in diameter. There are a few rough edges, but it does not look bad overall.
The new focal length is about 193 millimeters. I only have enough extension tubes to make 170 millimeters, so we will get close, but not exactly optimal.
Here's what the pinhole looks like, installed in the body cap of my Canon Xti:
Below you can see another picture of my car, this time with the 620 micron pinhole.
The contrast and sharpness have improved, but there is still the soft focus effect pinhole cameras are known for.
A side-by-side comparison of the flowerpot shows less of a difference: