I've been taking pictures of circuits every bit role of the (now defunct) Omzlo One Kickstarter and the new follow-upwards "Skware" Tin can-bus IoT project nosotros are building. I've started to develop a strange pleasure for taking pictures of PCBs and I thought I'd share my feel. Sure, you tin can accept pictures of PCBs with your smartphone and get nice results. However, if you desire repeatable quality and acceptable colour, you lot don't need to suspension the banking company but y'all will need a bit more gear.

Editor'south Note:
Guest author Alain Pannetrat is a self-described digital electronic fanatic who is currently working on an open up-source/open-hardware Arduino-compatible IoT platform based on CAN-bus. Y'all tin can follow Alain at his website Omzlo.com as well equally Twitter and Github.

My recommended setup has only 3 elements:

  • An entry level DSLR camera
  • A DIY light box
  • GIMP, the free and open up-source image editor

In fact, you don't even need a DSLR. Any advanced bespeak-and-shoot camera that has a zoom should work just besides. Warning: If you're an avant-garde photographer with professional lighting, macro lens and a studio, this article might hurt your eyes.

Now we tin walk through taking pictures of PCBs in vii steps:

  • Building a light box
  • Choosing a groundwork
  • Zooming out
  • Setting aperture and speed
  • Setting white balance
  • Taking the picture
  • Processing in GIMP

All those steps may sound like a lot of work, merely once you institute your routine, it but takes a few seconds to make a shot and a few more minutes with GIMP before you can upload your new project picture to your favorite website.

1. Building a light box

To take pictures of PCBs or products in general, information technology'due south proficient to have a diffused soft light source that comes from all directions uniformly. You desire to reduce shadows every bit much equally possible. A strong directional light volition often create shadows, hiding details of your PCB, such as pins or components.

The solution is to apply a light box, which is typically a box made of a white translucent textile which is illuminated from the exterior in club to give objects inside the box uniform lighting (meet hither for an case). In that location are enough of tutorials on the net for edifice a light box. Just Google "diy lite box".

I congenital mine with 2 cheap outdoor foursquare led panels and some scrap forest. The led panels produce diffused calorie-free and are placed on each side of a square box. The picture below shows the assembly almost finalized.

The led panels are directly plugged into the wall and can be switched on or off like a desk light. This setup is simple, solid, cocky-contained and easy to move around, which perfect in our pocket-size garage lab.

two. Choosing a groundwork

When taking pictures of PCBs, yous typically have ii options for a background: blackness or white. This is a matter of personal gustation and style, but I found that in that location are modest pros and cons for each.

White backgrounds are ubiquitous in electronics: meet SparkFun for example. The advantage of a white background is that information technology's like shooting fish in a barrel to remove later in GIMP to create a transparent background. You tin so create a transparent PNG/GIF image of yous PCB and merge it with an existing background on a web page. On the downside, a white groundwork volition be very sensitive to whatever projected shadow from your PCB. To avoid projected shadows, it's best to avoid resting the PCB straight on the background: raise it on a small object, to create a altitude with the groundwork, as shown in the movie below.

Black or night greyness backgrounds give your picture a more specific style, check out Adafruit for instance. They are less flexible in terms of integration in web pages. On the other hand, they are also more forgiving of shadows: yous can directly residual your PCB on the background without much worry as shown on the flick below.

Most cameras today are quite smart and they will automatically summate the correct exposure for your shot. Beware that in some cases, the use of a blackness or white background can confuse your photographic camera. A white background tin crusade your PCB to look also dark, while a black groundwork may crusade your PCB to look too vivid. If this is the instance, you can typically set your camera to underexpose or overexpose the shot a little to correct the trouble.

iii. Zooming out

When taking a portrait of somebody with a camera, rather than getting close to the subject, it's best to zoom as much equally possible and pace abroad as much as needed to frame the person's face in the photographic camera. This gives much more than flattering results past reducing distortions. The aforementioned applies to taking pictures of PCBs.

The actual zoom focal length range of a photographic camera is influenced by several factors including the sensor size and the optics of the zoom. A detailed discussion of focal length is beyond the scope of this weblog entry: simply zoom equally much every bit possible! My DSLR has a zoom with a focal length that goes from 17mm to 50mm, on an APS-C sensor (equivalent to 26 to 75mm on a 35mm motion-picture show frame). I always zoom all the fashion to 50mm to take a motion-picture show of a PCB.

The motion-picture show beneath shows roughly the same moving picture taken with 2 different focal lengths. On the right, the picture is taken with a 12mm focal length, using a broad angle lens. On the left, the film is taken with a 50mm focal length, using my zoom at maximum focal length. As yous tin can see, the picture on the correct has much more distortions: pin headers seem to exist bending outwards.

You could debate that the picture on the left has nonetheless a bit of baloney, just I retrieve it'southward skillful enough for showcasing a PCB.

4. Setting aperture and speed

Yous want all of your PCB to appear in focus. The depth of field -- the depth of what appears in focus on the picture -- is controlled by the aperture on your camera. You lot want to reduce the discontinuity while maintaining a reasonable shutter speed. If information technology sounds gibberish to you, just look at your photographic camera settings display:

  • it will usually show a speed expressed as a fraction of a second, such as ane/250, 1/60, 1/fifteen, ...
  • it will usually show an aperture expressed every bit a number, such as f/ii.eight, f/3.v, f/8, ...

You want the discontinuity number to exist as loftier as possible: higher means a smaller discontinuity. But at that place is a link between speed and discontinuity: the smaller the apertures, the lower the speed. And when the speed gets as well low, the camera will record the involuntary movement of the photographer, resulting in a blurry picture. As a dominion of thumb, you don't want to get much beneath a speed of 1/50th of a second.

The moving-picture show below shows the same picture with 2 different apertures:

  • The picture on the left is taken with aperture f/10
  • The picture on the right is taken with aperture f/3.5

While both pictures evidence the circuit board in skillful particular, the picture on the right has less depth of field. Some components such as the DC butt jack or the bottom female headers are a bit blurry.

On DSLRs and avant-garde point and shoot, you can prepare the photographic camera in a mode where you lot can command the discontinuity: information technology's typically called mode "A". I normally pick an aperture between f/eight and f/11, which results in a speed between 1/50th and 1/100th of a 2nd with my low-cal box. Stronger lights volition requite you more flexibility.

5. Setting white residuum

At present y'all put you PCB in the light box, have a moving-picture show and view the corresponding JPEG file on your calculator. In some cases, you lot might be surprised that the image has a strong color bandage: information technology might look more than yellowish or blue than what yous "saw" when you took the moving-picture show...

There are several reasons for this deviation. The light you use in your calorie-free box is non perfect, it is a far weep from existent natural lite, particularly if you apply cheap led panels like I do. The photographic camera may accept made a wrong "guess" about the light source. Your brain will also fool y'all. Your calculator screen might likewise exist off a bit likewise...

You can correct this color cast in GIMP to a certain degree, but it's better to minimize it from the commencement. To do that, y'all will need to set the White Balance of your camera (often abbreviated as "WB"). I've constitute that trying out the predefined settings of the camera until one works reasonably well is plenty (Motorcar, Tungsten, Fluorescent, ...).

half dozen. Taking the picture

Now it's time to take the picture. Switch on the light box and eliminate all other sources of calorie-free. Close windows and doors. Switch off the room ceiling low-cal. This will eliminate parasite light sources that may confuse your camera. This is very important.

Center the PCB in the frame, stay steady and press the shutter!

seven. Procedure in GIMP

GIMP is a gratis and open source image editor that works on Windows, macOS or Linux. At that place are plenty of online resource available on how to install and utilise this tool. If you are a photographer, there are much better proprietary alternatives out there, merely information technology'southward hard to trounce the price of GIMP and it has all the basics y'all need.

So you took your picture, yous can now upload the resulting JPEG file in GIMP to make some terminal corrections, namely:

  • Minor color correction
  • Cropping

The merely tool I use for color correction is the levels tool in GIMP, which you lot can detect in the "colors" menu, equally shown below.

In many cases, it's enough to click on "Automobile" to conform the color and contrast of the picture: you're basically done. For other cases, I use the white point and black point "pipette" icons that are sitting next to the "Machine" push in the levels dialog box shown above:

  • Click on the black indicate icon, and then select the absolute darkest expanse in your flick (east.g. a female header socket pigsty).
  • Click on the white point icon, so select the brightest white area in your movie (e.thou. a bright silkscreen area).

The picture below shows an instance of a correction applied. The lower right role of the picture is unprocessed while the upper left expanse is corrected.

Once color correction is applied, it's time to crop the picture if necessary to let the PCB fill the frame well enough.

Going further

By following the simple steps above, I've developed a pretty satisfactory approach to taking pictures in our projects. Of course, information technology's non perfect merely it'south simple enough.

There are some easy improvements to this process:

  • Setting the camera to have pictures in "RAW" format instead of JPEG: this allows yous to exploit the full potential of the picture, notably setting white balance in software subsequently the shot, but comes with boosted complication and requires the use of applications such as aperture, lightroom, ...
  • Using a macro lens: With a macro lens in the 80-120mm range, you tin can get closer to the PCB, capture more details and get less distortion.
  • Putting the camera on a stand: By putting the camera on a stand y'all can have a picture show at even slower speed and increase the aperture for greater sharpness and depth of field.
  • Calibrating your monitor: By default, PC monitors don't display colors reliably, this can be partially corrected through calibration, but it comes at a price.

And y'all, what are your tips and tricks for taking pictures of your electronic projects?