If you can attach lenses to your digital camera, you can make your camera into a pinhole camera. Just poke a pinhole (with an actual pin, if you want) in a cap that attaches to your camera when you don’t have a lens mounted:
Find the exact center of the cap and cut an opening.
The opening you cut (like the one in this figure) is probably too big to serve as a pinhole.
If the hole is too big, cover it with a piece of metal, as shown in this figure.
You can use aluminum foil, a piece cut from a cookie sheet, or some other thin metal — the thinner the better.
Poke a tiny hole in the metal.
Make is as small as possible. This is called a pinhole lens for a reason.
Attach your new pinhole lens to your camera.
Don’t force something onto your camera that isn’t supposed to fit. Use a cap that’s supplied by your camera’s manufacturer.
Look through the viewfinder to see a fuzzy, dim image.
This is what the world looks like through pinhole photography.
Mount your camera on a tripod and shoot time exposures.
Your aperture is so small (it’s a pinhole!) that your pictures need long exposures, even in bright daylight. This figure shows an image exposed for three seconds with a pinhole lens on a digital camera.