Jump to main content

Digital Pinhole Camera

182 reviews


If you sit under a leafy tree on a sunny day, you may notice spots of sunlight on the ground from light passing through spaces between the leaves. Try putting a piece of cardboard on the ground and examining the spots of light on the cardboard. Even though the spaces through which the light is passing are irregular in shape, the spots on the cardboard are round. What you are seeing, in fact, are projected images of the sun. Light passing through an aperture forms an image. A pinhole camera uses a tiny aperture, instead of a fancy lens, to project an image. What happens to the quality of the picture as the size of the pinhole is changed? This project shows you how to find out.


Areas of Science
Time Required
Average (6-10 days)
Must have digital camera capable of taking long, controlled exposures without flash.
Material Availability
Readily available
Very Low (under $20)
No issues

Andrew Olson, Ph.D., Science Buddies



The goal of this project is to measure the resolution of a pinhole camera as a function of pinhole diameter.


Light passing through an aperture forms an image. Sunlight passing through spaces between the leaves on a tree projects an image of the sun. Make a loose fist with your hand on a sunny day and you can project an image of the sun through the aperture that your fingers make. For a great introduction to light and apertures, including many interesting demonstrations you can do yourself, see Bob Miller's "Light Walk" pages, in the Bibliography section (Miller, date unknown).

The resolution of the image projected from an aperture is determined by the size of the aperture (until the aperture becomes so small that diffraction of light dominates). Thus, the smaller the aperture, the greater the resolution of the image. When the size of the aperture approaches the wavelength of the light passing through it (roughly 400–750 nm for visible light) diffraction of the light by the aperture limits the resolution.

In this project, you will build a digital pinhole camera. You'll make several different-sized pinhole apertures for your camera, and you'll measure the camera's resolution as a function of aperture size. You can build a pinhole camera for film, but loading and unloading the film has to be done in total darkness. Also, you have to have the film processed before you can see the results. Determining the correct exposure time for a pinhole camera often involves some trial and error, and this can quickly become tedious when using film. A big advantage of using a digital camera is that you can see your results right away.

Since a pinhole does not let in much light, exposure times will be much longer for a pinhole camera than for a camera with a normal lens. Therefore, you must use a digital camera that provides a method for controlling long exposures (e.g., via a remote-control cable). For the lightbox camera described, exposure times may need to be tens of seconds, or even a minute.

There are two ways to make a pinhole camera with a digital camera. Which method you use depends on the type of digital camera you have. If your digital camera does have removeable lenses, you can make a pinhole for it using a spare body cap with a pinhole in place of the lens. With this type of camera, the light coming through the pinhole aperture forms an image directly on the light-sensitive component inside the camera.

If your digital camera does not have removeable lenses, you will use the "lightbox" (or camera obscura) method. With the lightbox, the pinhole projects an image onto a screen at the back of the box. Your camera takes a picture of this screen, through a small, light-tight "window" at the front of the box (see Figure 1).

Diagram of a camera taking a picture of the inside of a lightbox
Figure 1. Diagram of a lightbox-type digital pinhole camera (Hanft, 2005).

With this type of camera, the exposures are even longer than typical pinhole cameras, because the light from the pinhole does not fall directly on the light-sensitive region of the camera. Instead, the camera is capturing some of the light that is reflected from the projection screen. This, in turn, is only a fraction of the light that originally passed through the pinhole.

The resolution of the image will be determined by how much the light is "spread out" as it is projected through the pinhole. With larger pinholes, this will be determined by the diameter of the aperture. As the pinholes become smaller, diffraction will begin to have a significant effect. Diffraction ultimately limits the resolution of an optical system, even something as simple as a pinhole.

Terms and Concepts

To do this project, you should do research that enables you to understand the following terms and concepts:



  • The following sites have useful information on pinhole cameras, including making pinholes, calculating exposure times, and calculating dimensions for building cameras:
  • This webpage has specific information on building a lightbox-type digital pinhole camera:
    Hanft, A., 2005. Pinhole Camera (part 3), Be A Design Group Blog. Retrieved April 3, 2006.
  • Bob Miller has created many exhibits at the Exploratorium in San Francisco built around light projected through apertures. If you can't visit Bob's exhibits at the Exploratorium, you can still visit his Light Walk pages online. They are a good intuitive introduction to pinhole optics. You can also learn how to make your own pinhole viewer.
    Miller, B., date unknown. "Bob Miller's Light Walk," Exploratorium. Retrieved April 3, 2006.
  • Diffraction and the limit of resolution in photography:
    McHugh, S.T., date unknown. Tutorials: Diffraction and Photography, Cambridge in Colour. Retrieved April 4, 2006.
Measuring Resolution Measuring Sharpness: The Modulation Transfer Function (MTF)
  • A good, basic description of the gold standard for measuring sharpness, the modulation transfer function or MTF:
    Atkins, B., 2005. MTF and SQF, Bob Atkins Photography. Retrieved April 4, 2006.
  • How to actually measure MTF for a lens:
    Koren, N., 2005. Understanding Image Sharpness, Part 5: Lens Testing, Norman Koren Photography Page. Retrieved April 4, 2006.

Materials and Equipment

Experimental Procedure

  1. The illustration shows an example of a lightbox-type pinhole camera, suitable for use with a digital camera (Hanft, 2005).

    Lightbox covered in aluminum tape has two holes cut into the front to fit a camera lens and pinhole lens hood
    Figure 2. A lightbox-type digital pinhole camera (Hanft, 2005).

  2. Here are some tips on constructing a lightbox-type camera (for more details, see Hanft, 2005):
    1. The box depth is determined by how close your camera can focus. The further your projection screen is from the pinhole, the dimmer the light will be, and the longer exposures you'll have to take, so try to keep this reasonably short (10-12 inches, if possible).
    2. Paint the inside of the box flat black to prevent stray reflections. This is especially important with the long exposures you'll be using.
    3. Cover the outside of the box entirely with aluminum tape, to ensure that your box is light-tight.
    4. For the "window" for your digital camera, use a piece of rubber tubing from an old bicycle inner tube to make a tight-fitting rubber seal that will fit around the lens of your camera. This will perform two functions: 1) make a light-tight seal, and 2) hold the camera firmly in place.
    5. Also, remember that the camera needs to be tilted down slightly so that it does not block light entering the pinhole (see Figure 1 in the Introduction).
  3. Turning a digital SLR camera into a pinhole camera is much easier. All you need are some spare body caps, which you should be able to order from the camera store where you purchased the camera. Find the center of the body cap and drill a hole in it. Glue a pinhole made from thin aluminum, over this hole, and make the glue joint light-tight by covering it with black tape.
  4. Here are some tips on making and measuring a pinhole (used for either type of camera:
    1. Here are instructions for making a pinhole from David Balihar: "A piece of metal cut from a drinks [soda] can, approximately 4 x 4 cm, is sufficient. First, using coarse sandpaper, remove the paint from the area where the hole should be, and try to make the metal as thin as possible. Then finish the surface by using fine sandpaper. Place the plate on a flat wooden block and, using a sharp needle, make the smallest hole possible. Be careful not to injure your hand and use a hard block to press down on the needle. Remove the embossed material from the reverse side of the plate using fine sandpaper. Place the needle into the hole again and, by gently pressing and turning the needle between your fingers, make the hole round. Smooth the hole again using sandpaper. It is necessary to repeat the process until the required diameter is achieved. A regular round hole in a very thin plate can be made with a bit of patience." (Balihar, 2006) Use the same size for each of the aluminum pieces, so that your pinholes are easily interchangeable on your camera.
    2. Remember to paint the back side of the pinhole metal flat black after you have made the pinhole. The back side will be inside the camera, and you want to prevent stray reflections inside the camera.
    3. There are many ways to measure the diameter of your pinholes. You can use a alide projector, overhead projector, or enlarger to project light through the pinhole, and measure the diameter of the enlarged image. To check the scale (enlargement factor) also measure the projected size of the edge of the aluminum. Another method is to use a flatbed scanner at 600 or 1200 dpi.
  5. Make a set of at least 3 different pinholes (more is even better) for your camera spanning a range of diameters from about 1.0 mm to 0.2 mm (or less).
  6. Experiment with exposure times so that you can photograph the same scene with each different pinhole to achieve about equal gray levels in the photographs. (The references in the Bibliography have information and calculators that should help with this. Knowing the diameters of your pinholes will also help.)
  7. If you are using a lightbox-type camera, it is best to keep the aperture setting constant, and change only the exposure time.
  8. Keep the camera steady by attaching it firmly to something heavy (e.g., a brick).
  9. The Bibliography has references that will show you how to quantify both resolution and sharpness for your photographs made with different-sized pinholes.
  10. Here are some questions you can attempt to answer with your pinhole camera.
    • What pinhole diameter maximizes resolution for your camera?
    • What pinhole diameter maximizes sharpness for your camera?
    • How do these compare to the predicted results from the pinhole calculators in the Bibliography? If there are differences, can you explain them?
icon scientific method

Ask an Expert

Do you have specific questions about your science project? Our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.


  • How does resolution with a pinhole compare to resolution with a normal camera lens?
  • How does depth-of-field with a pinhole compare to depth-of-field with a normal camera lens?
  • How does sharpness with a pinhole camera compare to sharpness with a normal camera lens?
  • Examine exposure time in relation to pinhole size. Remember to keep digital camera aperture constant for lightbox-type camera. Use photo editing software and adjust exposure time to match gray values in the images taken with different-sized pinholes.


If you like this project, you might enjoy exploring these related careers:

Career Profile
Mechanical engineers are part of your everyday life, designing the spoon you used to eat your breakfast, your breakfast's packaging, the flip-top cap on your toothpaste tube, the zipper on your jacket, the car, bike, or bus you took to school, the chair you sat in, the door handle you grasped and the hinges it opened on, and the ballpoint pen you used to take your test. Virtually every object that you see around you has passed through the hands of a mechanical engineer. Consequently, their… Read more
Career Profile
You use mechanical devices every day—to zip and snap your clothing, open doors, refrigerate and cook your food, get clean water, heat your home, play music, surf the Internet, travel around, and even to brush your teeth. Virtually every object that you see around has been mechanically engineered or designed at some point, requiring the skills of mechanical engineering technicians to create drawings of the product, or to build and test models of the product to find the best design. Read more
Career Profile
Physicists have a big goal in mind—to understand the nature of the entire universe and everything in it! To reach that goal, they observe and measure natural events seen on Earth and in the universe, and then develop theories, using mathematics, to explain why those phenomena occur. Physicists take on the challenge of explaining events that happen on the grandest scale imaginable to those that happen at the level of the smallest atomic particles. Their theories are then applied to… Read more
Career Profile
One of the basic truths in the universe is that objects tend to go from a state of higher organization to a state of lower organization over time. In other words, things break down, and when those things are precision instruments or equipment, they require the services of very specialized technicians to restore them to their working order. Precision instrument or equipment technicians often combine a love of music, medicine, electronics, or antiques with delicate mechanical repair work. Read more
Career Profile
What makes it possible to create high-technology objects like computers and sports gear? It's the materials inside those products. Materials scientists and engineers develop materials, like metals, ceramics, polymers, and composites, that other engineers need for their designs. Materials scientists and engineers think atomically (meaning they understand things at the nanoscale level), but they design microscopically (at the level of a microscope), and their materials are used macroscopically… Read more

News Feed on This Topic

, ,

Cite This Page

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

MLA Style

Science Buddies Staff. "Digital Pinhole Camera." Science Buddies, 20 Nov. 2020, https://www.sciencebuddies.org/science-fair-projects/project-ideas/Photo_p005/photography-video/digital-pinhole-camera. Accessed 27 Sep. 2023.

APA Style

Science Buddies Staff. (2020, November 20). Digital Pinhole Camera. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/Photo_p005/photography-video/digital-pinhole-camera

Last edit date: 2020-11-20
Free science fair projects.