Help
  • FAQ
    browse most common questions
  • Live Chat
    talk with our online service
  • Email
    contact your dedicated sales:
0

Making a Pinhole Camera with a Digital Sensor

Author : AIVON | PCB Manufacturing & Supply Chain Specialists March 19, 2026

 

Overview

Interest in pinhole photography has been growing in recent years, with more related events, and pinhole cameras increasingly appearing in commercial and international photography activities.

 

Optical characteristics and limitations

From an optics perspective, a pinhole has properties that many lenses cannot match. For example, a pinhole camera has an effectively infinite depth of field, meaning objects at virtually any distance within the field of view appear sharp, and lens-induced distortions such as chromatic aberration are avoided.

However, pinhole cameras also have clear disadvantages. Whether purchased or DIY, pinhole cameras typically require film or photographic paper, which increases the cost per exposure. In addition, there is a delay between taking a photo and seeing the result.

Perhaps most significantly, because traditional pinhole cameras rely on film, exposures are very long—often several seconds even in bright sunlight—making it more likely that the shot will be disturbed or interrupted.

Pinhole Camera PCB

 

Using a digital sensor

A maker named David proposed that using a digital sensor could address these problems. He used an inexpensive ESP32-CAM board, which integrates an ESP32 microcontroller with Wi?Fi, a microSD card slot, an LED indicator, and an interface for several low-cost image sensors.

He used an OV2460 camera module, which can reach a maximum resolution of 1600 x 1200 pixels when paired with the ESP32-CAM.

 

Controls and firmware

For controls, he connected a micro switch to one of the board's GPIO pins and wrote firmware to use that switch as a shutter control and save images to the microSD card.

He also programmed the LED indicator to flash error codes when problems occur, such as attempting to write to a full microSD card. With the many software libraries available for the ESP32-CAM, writing this glue firmware did not take long.

 

Enclosure and interchangeable pinhole elements

On the hardware side, he used a Glowforge laser cutter to make a wooden box to house the sensor, the ESP32-CAM board, and the shutter switch. The critical pinhole components were made removable so that the focal distance and field of view could be adjusted by swapping different elements. This provides the flexibility of interchangeable "lenses" for pinhole photography.

However, there is a trade-off. Because the sensor is much smaller than a film frame—the sensor width is about 4 mm compared with 35 mm or 120 mm film—the camera must place the sensor closer to the pinhole to ensure the full image falls on the sensor surface. This requires a pinhole diameter smaller than those used with traditional film-based pinhole cameras.

 

Making precise pinholes

David first tried making pinholes in thin brass by using a center punch to create an indentation, then filing from the other side until the punch just broke through, producing a clean small hole. This method is labor intensive and requires several pinholes for testing.

data of making precise pinholes

He eventually settled on aluminum foil. By stretching foil and then piercing it with a needle, he could produce many pinholes quickly. Typically this approach makes holes that are too large, but placing the foil over a plastic work surface and gently pressing the needle so the plastic supports the foil helps the needle tip penetrate cleanly without producing an oversized hole. Although not perfectly reliable, this method speeds up producing multiple pinholes to find the optimal diameter.

 

Field testing and results

With the pinhole element in place, David took the camera to a local lighthouse and powered it with a battery. The image sensor sensitivity reduced the required exposure time to fractions of a second, and photos could be downloaded from the microSD card and reviewed on site.

He found that the images retained the luminous look characteristic of traditional pinhole photography, which he judged a success.

 

Possible improvements

David noted areas for optimization, such as coating the interior of the interchangeable optical components with a matte black material to reduce internal reflections that can soften images. Another improvement would be adding an LCD to preview the camera's view in real time—the ESP32 has enough spare processing capacity to drive a small display.

AIVON | PCB Manufacturing & Supply Chain Specialists AIVON | PCB Manufacturing & Supply Chain Specialists

The AIVON Engineering and Operations Team consists of experienced engineers and specialists in PCB manufacturing and supply chain management. They review content related to PCB ordering processes, cost control, lead time planning, and production workflows. Based on real project experience, the team provides practical insights to help customers optimize manufacturing decisions and navigate the full PCB production lifecycle efficiently.

Related Tags


2026 AIVON.COM All Rights Reserved
Intellectual Property Rights | Terms of Service | Privacy Policy | Refund Policy