Showing posts with label digital camera. Show all posts
Showing posts with label digital camera. Show all posts

Monday, August 23, 2010

Build Your Own Camera Lenses - Tutorial 1

My latest photography-related project has been trying to build my own lenses for digital or 35mm film SLR cameras on as limited of a budget as I can manage. What I’ve discovered is that I can make excellent macro, pinhole, tilt-shift, and artistic/portrait-style lenses for as little as $10-15 from scratch. Interested in doing it yourself? Then…. read on!

I’ll be focusing on 4 lenses, discussing them in order of complexity. These lenses include:
1. pinhole
2. macro lens
3. ~70mm soft-focus portrait lens (my favorite project of these 4!)
4. Tilt-shift lens (described in an upcoming blog entry, since this entry is a bit lengthy)

Things I already own that will be used in these projects:
Digital SLR camera (I’m using Nikon D700 and D200)
50mm f1.8 portrait lens (for macro lens project)
Lenses that would work: 24,28,35,50, 70, 85mm, etc.
tripod (for macro and pinhole camera shots)

Things I purchased for these projects:
set of extension tubes to fit Nikon cameras ($6 on ebay from China with free shipping – how did they make money on that sale? No clue….)
Set of Nikon Body caps ($3 on ebay from China with free shipping)
70mm focal distance Positive Meniscus lens ($4 from SurplusShed)
70mm focal distance Achromat lens ($7 from Surplus Shed)
Silly Puddy ($1 at Wal-Mart)

But before we get into how to make a lens, let’s learn just a little about how lenses actually work – I’ll try to keep it as basic as possible but with the critical things covered.

At its most basic form, a camera lens consists of an actual glass (or plastic) lens and a method to attach that lens to the camera. Camera manufacturers have added much complexity to the design of lenses to deal with things such as spherical and chromatic aberrations, color control, sharpness, and other things. The truth is that all these imperfections that manufacturers correct in lenses can also make things interesting and beautiful if used in the right way. So that’s what we plan to do – make use of the imperfections in different lenses to give us varying artistic effects that we can capitalize on for cool photographic effects.

Lenses from Scratch:
Any lens that focuses light should, in theory, work for these projects. I purchase inexpensive lenses from SurplusShed.com; they offer a great variety of lenses at multiple focal ranges for $4-$10. I have used lenses that range in focal length from 50-100mm. The easiest lenses to work with, in my opinion, are positive meniscus lenses, which focus light at a certain distance behind the lens, dictated by their focal length (listed in millimeters). For example, a 50mm lens focuses a picture behind the lens 50mm. So in theory, if you placed this lens 5cm in front of a camera sensor or 35mm film, you would have an in-focus picture projected onto the digital sensor or film. If the lens is closer than 50mm, the image would be out of focus. If the lens was farther away than 50mm, the image projected on the focal plane would be larger, so it would appear more zoomed in when captured on the actual sensor or film strip.

Cannibalizing existing camera lenses:
Another method for making homemade lenses is to use an already manufactured lens and alter it in some way to create a new use for that lens. This is what we will do for the macro and tilt-shift lens. I will cover these in more detail in each relevant section. Old lenses are very inexpensive on ebay and can be used quite efficiently for this purpose.

Mounting the lens to a camera:
There are several easy and cheap ways to mount a lens to a camera. The simplest that I have found is using extension tubes, which consist of a connection to the camera, a set of hollow tubes that project away from the camera body, and then a mount for a lens. Extension tubes can be added in any number to create a longer or shorter total length for holding a lens. The picture below illustrates this. The benefit of this method is that the length is adjustable and the parts are reusable and completely configurable to different lenses you use.

Set of 3 extension tubes with connection to camera of left and lens mount on right

Another method for connecting lenses is to cut out the center of a camera body cap so that a lens can be mounted to it. The picture below also illustrates this. This body cap can also be used to mount a lens to the end of the extension tube set referenced above.
Hollowed out body cap can be used to mount a lens

PINHOLE CAMERA:
Now that we’ve covered a little bit about lenses and mounting them to a camera, we’ll make the most basic type of “lens”. In reality a pinhole camera doesn’t even have a lens. The lens, per se, is just a small pinhole that allows a very small amount of light to pass through it. Each ray of light goes through the pinhole and creates an inverted image on the other side. Pinhole cameras were among the first types of cameras made.

To create a pinhole camera with an SLR, all we have to do is take the body cap that comes with the camera (like in the photo above) to cover the lens mount area. In the very center of the body cap create a very small hole with a pin. Mount the body cap back onto the camera body and then shoot away!

There are a few caveats to this approach. Because the area for light to go through is so small, long exposure times are required in order to get a picture, so it is best to mount the camera on a tripod for shooting. Another issues is that the image quality is degraded quickly by how large your hole is in the body cap. The smaller the hole, the better resolution for the picture, but the longer the exposures will have to be. Below is a shot of the body cap pinhole camera and also a shot of my backyard shot with it mounted to an Infrared camera.

Infrared pinhole camera image

MACRO LENS:
Since I already purchased a set of extension tubes for mounting my lenses from Surplus Shed, I decided to use the tubes for creating a simple Macro lens. I already own a 50mm f1.8 Nikon lens that does not have any Macro capabilities inherent to it when mounted on a camera. However, one simple principle of optics is that if you are able to mount a lens further from the camera body than it was intended for, it is able to project a magnified image onto the Digital sensor or 35mm film. At the proper distance away from the camera, lenses such as my 50mm f1.8 lens can become excellent macro lenses even though that is not what they are designed for.

Below is a picture of the setup for the camera. I simply mounted my set of extension tubes on my Nikon D700, then mounted my Nikon 50mm f1.8 lens to the extension tubes. This system works best if the lens you are using has an aperture ring that you can manually adjust to control the amount of light entering your makeshift lens. Adjusting the aperture ring controls the depth of field in the image. At wide open f1.8, there is a very, very small fraction of an image in focus, but if I lower the aperture to f8 or f11, there is much more of the image in focus. With many newer lenses, you do not have control of the aperture ring manually – it is controlled electronically by the camera. If you use one of these lenses, the aperture is normally kept completely shut at whatever the minimum aperture is for that lens (normally between f22-f32).

50mm f1.8 Nikon lens attached to camera via extension tubes

Since my extension tubes have no electronic connections, focusing the lens becomes manual, meaning that I have to move the actual camera and lens to focus on my subject. This still worked remarkably well, which is shown in the images below. I was able to get some amazing macro shots of a few insects in my backyard with just handheld shooting and manually moving the camera to focus on the subject. Since the extension tubes don’t have any optical elements in their path, the high-quality Nikon 50mm lens does not have any impairment in its optical quality, so my shots are very sharp.

Closeup of a nickel


SIDE NOTE: Two other simple, but more expensive methods for really great macro capabilities are (1) using a bellow and (2) using a reversing ring for attaching two lenses together. Bellows (pictured below) range in price from $30-250 and are similar to extension tubes in that they are simply a hollow opening that extends the lens further away from the camera body. Bellows offer more incremental control in movements so are advantageous over extension tubes for improving control. The second method requires two lenses; the primary lens attached to the camera body is of a longer focal length than the second lens which is attached backwards to the front of the first lens. The focal length of the lens attached to the camera divided by the focal length of the second reversed lens gives you the magnification. As an example, a 150mm lens with a 50mm lens attached reversed gives a 3X magnification. One caveat is that the aperture of both lenses should be wide open or significant vignetting occurs. An example of a reversed-lens configuration is shown below, along with an example from a reversed-lens setup using a 150mm and 50mm lens configuration.

Camera Bellow system with Nikon 50mm f1.8 lens attached for macro shooting

Two lenses attached via a male-to-male 72mm reversing ring for macro shots


Closeup of a penny using 2 lenses with reversing ring (3x magnification)


Closeup of the back of the penny with 2 lenses plus reversing ring (3x magnification)


70mm SOFT FOCUS LENS:

Now on to my favorite project of the 4 home-made lenses! This one was just a whole lot of fun once I figured out the best way to connect the lens to the camera… but more on that in a bit!!

What I used in this project:
Nikon D700 camera body
Set of extension tubes connected to camera body
Hollowed out body cap connected to end of extension tubes
Silly Puddy (great way to hold lenses to body cap!)
70mm positive meniscus lens or 70mm achromat lens

The picture below shows the basic structure of what I did. It consisted of the camera connected to the set of extension tubes connected to the hollowed out camera body cap connected to the lens via..... silly puddy. I had a lot of trouble at first dealing with connecting the lens to the body cap. I tried permanent silicone, tape, and a few other things before having an epiphany. Use Silly Puddy, which I had lying around for use in holding objects when I shoot macro photography! It ended up working superbly!


You can see above and below that you have control of the aperture with how big or small you make the thickness of the silly puddy.
Homemade 70mm positive meniscus lens set about f2.8 attached via silly puddy.

There were many reasons I loved the silly puddy:
1. It is not permanent, so I can quickly change lenses
2. It allows me to control the aperture from f1.0 down to f32 and beyond by playing with the ring of silly puddy
3. Changing the shape of the aperture of silly puddy allows for controlling the shape of out-of-focus light sources in the image. If you make a star shape with silly puddy, light sources in the background of an image take a star shape! (This will be a whole other blog entry for those of you confused by this)
4. I can tilt the lens in the silly puddy to also have a tilt-shift lens for cool focusing effects
5. It’s easy to handle and control, so there’s no mess!

To get different angles of view (how zoomed in or out you are), you can play with your stack of extension tubes. The lenses had to be at a minimum of 70mm from the camera using the extension tubes in order to get an image in focus. If I mounted the lenses farther from the camera, say 100 to 150mm, then the lenses become more of a telephoto lens (The image is zoomed in more). To focus the lenses, you have to manually step forward or backward to get your subject in view. These lenses do have a pretty deep depth-of-field so it wasn’t too difficult to get subjects in focus.

One of the effects of both my lenses used (achromat and positive meniscus) is that the center of the image is much more in focus that the edges of the image. This allows for fun portrait style photos that create a soft effect around the edges. See the below examples.


Above photo shot with 70mm positive meniscus lens


Above photo shot with 70mm positive meniscus lens


Above photo shot with 70mm positive meniscus lens

Above photo shot with 70mm Achromat lens


Above photo shot with 70mm Achromat lens

But what is it about these lenses that create the out of focus edges, and what is the difference between the two lenses that I’m using? Well, I’m glad you asked!

Spherical Aberration:
Both of these lenses cause a significant amount of something called spherical aberration. Spherical aberration is an optical term that means that the rays of light that pass through the periphery of the lenses focus a bit in front of the rays that go through the center of the lens. See the diagram below from http://www.flickr.com/photos/johnnyoptic/4076620080/ for a diagram of what I am referring to.

The light passing through the edges of the lens that focus in a different plain of view cause out of focus light scatter that creates the increasing “soft” focus as you move to the edge of the image. To decrease this softness along the edges I used the silly puddy to decrease the radius for light to pass through the lens, forcing light to only go through the center of the lens, which created much sharper images along the edges of the photo. This is exactly what expensive lenses do with control of the aperture! Lenses are much sharper at f8 compared to f2.8 because the aperture ring is closed to a smaller diameter and forces the light to go through the center of the lens, thus eliminating a large amount of spherical aberration.

Chromatic Aberration:
So what is the difference in the Achromat lens and the positive meniscus lens I’m using? Well, another property of optics that camera manufacturers have to deal with is called chromatic aberration. Chromatic aberration (also called color fringing where purple/blue/red fringes are visible in your image at high contrast areas) is caused because short wavelength light (blues) and long wavelength light (reds) have different focal lengths when going through the lens. For the positive meniscus lens that I’m using, chromatic aberration is much worse than for the Achromat lens. Why is this?

An achromat lens deals with chromatic aberration because it is constructed of two types of glass – a convex lens of crown glass and a concave lens of flint glass. These two different types of glass correct for the different focusing distances for different wavelengths and can help control the chromatic aberrations.

Now, I’ve gotten into some technical aspects as the end of this because I wanted to point out just a few of the things that camera manufacturers have to deal with when building a lens. Many lenses manufacturers make have 10-15 lenses WITHIN the actual lens you purchased for your camera – each different lens helps to deal with a specific issue such as spherical or chromatic aberration. As I mentioned earlier, these imperfections that manufacturers seek to eliminate can also be capitalized on to give artistic and cool effects to your images. The positive meniscus lens gives plenty of spherical AND chromatic aberrations that give a lot of soft focus and color fringing to my images. The Achromat allows me to minimize the chromatic aberration and just use the spherical aberrations for soft focusing. So even for $4-7 I can still have some control over the imperfections that lens optics have!

TILT-SHIFT LENS:

I’ll focus on this in an upcoming blog post.... I've droned on long enough. Congrats for those of you who actually finished reading this. Impressive!