Camera to take photos of assembled PCBs - Page 1
Forum section: electronics / general

author: rcbuck
author_rank: Frequent Contributor
timestamp: October 13, 2017, 03:13:47 am
content: I'm looking for suggestions for a reasonably priced (below $200) camera to take pictures of my assembled project boards. This is mainly for documentation purposes but I may occasionally email them to someone for review purposes. I have an older Kodak DX6490 that does a pretty good job on small boards. But sometimes I can't get good focus. For example, this evening I was trying to shoot a 3 in X 3 in board. When I get far enough away from the board to see the entire board and focus it, I can't see much detail.Most of my boards are less than 4 in X 4 in but occasionally I will have a 6 in X 6 in board. Is there some type of macro lens I can buy for my Kodak or do I need a different camera? I have a Dino Lite digital microscope that takes excellent photos of small (2 in X 2 in or less) but it can't handle a 3 X 3 board.I don't know anything about photography, just electronics.

author: Habropoda
author_rank: Regular Contributor
timestamp: October 13, 2017, 03:41:26 am
content: Just holding a good quality magnifying glass in front of the camera lens will work just fine for simple shots like that. You will have to experiment a bit with zoom and distance from the subject. If you can find a filter adapter for that camera you can use what is often called a close up lens. Various qualities and prices are available. Get a +2 or +4 in the same size as the filter adapter.Or jerry rig it with a tube and some hot snot. No reason to get fancy with PCB shots.

author: chicken
author_rank: Frequent Contributor
timestamp: October 13, 2017, 05:33:00 am
content: Any recent point & shoot camera or smart phone should be able to take decent images of a PCB. Provide as much light as you can and disable/ don't use digital zoom, and your results will be fine.

author: cat87
author_rank: Regular Contributor
timestamp: October 13, 2017, 09:35:19 am
content: I use a Nikon Coolpix A100. It does a decent job for taking pictures of boards, giving that I have zero photography skills and crappy lighting in my room.The built in macro mode is useless for PCBs i.e. minimum distance is ~ 20-30 cm, so I give it some help with a lens from an old projector when I need specific components. The level of detail I can get with this set-up is really awesome. It has no trouble in taking clear photos of 0402 packages or pesky QFN ones.The camera is below your 200$ mark, so it fits the bill. The only problem is that afterwards you're going to have to search for an objective that allows you to take macros from about 2-5 cm.The only thing I don't like is that you really have to muck around with the auto-focus, especially in macro mode. It takes some getting used to.Hope this is of some use to you.

author: jm_araujo
author_rank: Regular Contributor
timestamp: October 13, 2017, 09:58:08 am
content: I've found that a flatbed scanner takes great "photos" of assembled PCBs: even illumination and good depth of field well focused.

author: Kleinstein
author_rank: Super Contributor
timestamp: October 13, 2017, 10:29:49 am
content: There are two difficulties: one is focusing at short distance. Some P&S cameras can work close enough, but some not. Usually short distance works best with a short focal length and the min focal distance is usually give for the short focus.It is possible to use a kind of extra lens. I did this for quite some time with the a Sony camera and the front lens from old (damaged) binocular. By incidence mechanical mach was near perfect, but this was pure luck. The cheap cameras usually don't have a filter ring to use a close up lens, which would be the more obvious route - though cheap close up lenses are not high quality.The second problem is the small depth of field. This is a principle problem at close up. So one is kind of fixed to right angle or details of sections. To get a good depth of field one can us a small aperture - so it helps if the camera allows to adjust the aperture (and does not just use a filter). It is the absolute size of the aperture (relative to distance) that matters. So things are even more a problem with a larger sensor. With a APS-C size sensor and 100 mm lens I would use something like F/22 to F/40. To make it work with a small aperture lots of light help. The build in flash tends to cause to much reflections.A large sensor SLR or similar does not help much for close ups. It is more like a P&S with the needed short focus option, and ideally an external flash.A flat bed scanner can be also a great option, but it depends (especially the DOF if different between models).

author: Brumby
author_rank: Unknown
timestamp: October 13, 2017, 11:32:48 am
content: Auxiliary lenses will only ever reduce the image quality from the native camera lens. A purpose designed one may have less impact - but you will get what you paid for. (This rule isveryreliable when it comes to lens quality.)I would suggest going down that path is only going to cost you more money in the long run - by purchasing things that will not be any good for achieving the results you may want.Getting another camera is the direction I would choose. As well as checking the focusing range, make sure it has the ability to do manual focus - or at least a "focus lock" function. Sometimes the auto focus is going to stubbornly pick the wrong point.As for zoom function, there are two types: optical and digital. Rule number 1: Only take notice of the optical. Forget about the digital - it doesn't do anything but make images more pixelated.... and if you're going to go this far, see if you can get one with manual white balance capability (presets are OK - but limited). This may not be super critical for PCB photography, but it is never a bad thing to have.I've not given any direction on camera type - DSLR, etc. - as this is not afundamentaldecision criteria. An all-in-one like the Canon Power Shot G5 (an older model) can do all the above. You just need to do your homework.

author: taydin
author_rank: Frequent Contributor
timestamp: October 13, 2017, 11:53:13 am
content: I'm still happily using my canon ixus 800 is for closeup pcb pictures. This is a 6MP camera, but with outstanding optics. Gives much better results than my 12MP smart phone camera.

author: rcbuck
author_rank: Frequent Contributor
timestamp: October 13, 2017, 05:33:09 pm
content: Everyone, thanks for the replies. It seems an add on lens is not really the way to go. The Kodak is not a cheap camera. It was over $400 when I bought it about 10 years ago. Of course, today you can probably get the same quality for less than $200. It has digital zoom that works fairly well for distance objects. I waited until I had sunlight coming into the window this morning. I followed Brumby and chicken's advice and didn't use digital zoom to take the attached picture. It looks fairly good. Taking the same picture further from the board with zoom on gives poor results. The camera was approximately 16 cm away from the board for the attached photo.If I need close ups of small objects, 3-5 cm, my microscope does an excellent job. I have a high end HP flatbed scanner but it is packed away right now. When I get moved I will give it a try.

author: chicken
author_rank: Frequent Contributor
timestamp: October 14, 2017, 02:27:55 am
content: That looks great! To open up the shadows, you could prop up a few sheets of blank copy paper on the side of the shadows. That will reflect light into the dark areas.I regularly use a flatbed scanner to capture very high resolution pictures of SMD boards. But with this board the tall components will probably cause the PCB to be out of focus.

author: poorchava
author_rank: Super Contributor
timestamp: October 14, 2017, 05:01:39 am
content: I use a regular smartphone for that. Currently I'm using an LG G5, but previously had an HTC One M8s, which was otherwise crap, but took some good board photos too

author: David Hess
author_rank: Super Contributor
timestamp: October 14, 2017, 08:38:11 pm
content: I bought a Canon PowerShot SX150 IS for documentation purposes and it works well even under handheld conditions with marginal lighting. I like that it uses a pair of standard AA batteries, low discharge NiMH cells, so I am not beholden to expensive stock batteries or questionable third party batteries but if I used it more, then I would get the power adapter. It would be nice to be able to transfer images to my PC without connecting a cable or pulling the memory card though; I worry about breaking the mini-USB socket inside the camera body.I picked some of the better photographs I have taken to show below and left them at the native resolution. All were taken under marginal lighting conditions and in most I have not carefully setup the focus and f-stop for good depth of field. The first photograph shows measuring a 999 megohm resistor using a standard digital multimeter; I only included it because the subject keep coming up. The second photograph shows the modifications necessary to increase the common mode rejection ratio of the vertical output on a Tektronix 76xx series oscilloscope by about 20dB.Note: I had to set JPG compression at maximum so there are JPG compression artifacts if you look closely enough.

author: Brumby
author_rank: Unknown
timestamp: October 15, 2017, 12:51:52 am
content: Quote from: wilfred on October 14, 2017, 04:44:59 amThis is called barrel distortion. It is not a "lens distortion" as such - but an optical distortion that occurs withanylens because the corners of the PCB are further away from the lens than the middle of the sides. It is simple physics and unavoidable. Corrective action can certainly be performed in software, but it is always better to get the initial image as perfect as possible - and there is a way....As mentioned above, barrel distortion is the result of the distance from the lens to the corners being longer than the distance from the lens to the middle of the sides - and all points in between. When things are further from the lens, they are smaller. However, thedegreeof the barrel distortion is a function of the percentage difference of the distances involved. These differences decrease - and the barrel distortion gets less and less - the further the lens is from the subject. You can see this for yourself - just take a photo with the camera as close to the subject as possible, while still showing the edges (the one above will do) - and then move the camera as far away as you can for a second shot. (For this purpose, you can use the digital zoom if you want - we are just interested in seeing the difference in barrel distortion, not overall quality as such.) This will demonstrate the difference - which can be significant. (While you are comparing images, also look at the difference in the taller components, such as the capacitors - note their comparative diameters.)So - getting the camera further away from the subject will improve the barrel distortion situation, but digital zoom will reduce the image quality - so how do we win here? The answer is simple - but finding it in a camera will be a little more of a challenge. It isOpticalzoom. Optical zoom does its job through glass elements moving back and forth, changing theactual sizeof the image before it reaches the sensor. While optical zoom systems in affordable cameras (and even expensive ones) are not ideal, they are far, far,farbetter than digital zoom systems ofANYcamera. In fact, when choosing a camera, you only need to look at the optical zoom specifications. Forget about digital zoom - because you can do exactly the same manipulation with an image editor after the shoot.QuotePolarizing filters aren't usually necessary - and they are less and less effective as the angle of incidence approaches the perpendicular to the reflective surface. They are completely ineffective on specular (mirror like) reflections at any angle. Better placement of lighting will fix most problems and the addition of a diffuser, or even better for this type of photography, a light tent, will improve things dramatically.In this PCB shot, there seems to be at least two light sources - one from the top of the picture and the other from over the left shoulder of the photographer. I suspect the camera (and maybe the photographer) got in the way of the "over the shoulder" lighting, causing the shadowed area. This is just another thing to be mindful of.

author: rcbuck
author_rank: Frequent Contributor
timestamp: October 15, 2017, 01:57:28 am
content: David, those pictures look great. I would be happy with those kind of results. I checked and the camera you used is only about $120. It may be worth looking into. My camera doesn't have adjustments for f-stop, whatever that is. I did some research and I can buy a 42.5mm to 55mm adapater for my camera. That will allow me to use any 55mm thread lens. What type of lens should I look for? I guess I could go to the local camera supply store and show them what I am trying to do and they would have suggestions.Brumby, you are almost spot on. There were two light sources. The one from the top and one from my left hand pointing an LED flashlight at the left corner of the board. I was trying to eliminate shadows from that point. I adjusted the angle of the flashlight to eliminate most of the shadows. If I eliminated the bright spot completely, the shadows re-appeared. I can try chicken's idea of propping a few sheets of copy paper on the sides to eliminate shadows.

author: cdev
author_rank: Super Contributor
timestamp: October 15, 2017, 03:18:09 am
content: I have been using a Canon EOS-M and it takes stunningly gorgeous pictures. It also can shoot really nice video. The body can be bought used for around $200. Lenses vary.One big plus about this approximately 5 year old camera is that its quite fast if you want it to be - my previous digital camera's highest ISO was 400, this one goes up to 6400 or even more.Also it has 18MP resolution. So, you can take a picture in natural lighting, at your workbench, shining clip on lamps at your walls.. so the light is diffuse... and its very sharp.(The speed will also basically let you take pictures on the street at night, in natural lighting. They look really nice.)Its also supported by MagicLantern so it has all sorts of intervalometer and video capabilities (but its not plug and play like a dedicated video camera would be).Also, the price I cited might just be for the camera body alone, you would still need to get lenses, but one cool thing is you can use it with all sorts of lenses, including older, kind of interesting, potentially cheap ones.

author: cdev
author_rank: Super Contributor
timestamp: October 15, 2017, 04:28:42 am
content: You can use old 35mm lensesbackwardsas macro lenses. (If you can find an adapter for the thread.)They should be dirt cheap or free.Quote from: rcbuck on October 15, 2017, 01:57:28 am

author: Brumby
author_rank: Unknown
timestamp: October 15, 2017, 10:00:49 am
content: Quote from: rcbuck on October 15, 2017, 01:57:28 amI hadn't really thought about hand held lighting ... but I got the axis rightShadows are indeed a problem. While additional reflectors - like white paper - can help, I have found the best results come from diffused light sources. For a small PCB, I would use a 2 litre or 3 litre plastic milk bottle, since they are translucent and diffuse the light very well. Just cut off the top and bottom, place around the PCB and shine a couple of lights on either side and shoot from above. You could also salvage the diffuser from an LCD television and use that. For best results (IMO), go for a light tent.Whatever you do try, make sure you have plenty of light.

author: Ian.M
author_rank: Super Contributor
timestamp: October 15, 2017, 11:07:55 am
content: A lot of the issues with PCB photography can be avoided with a good quality copy stand to hold the camera with its lens exactly over the center of the area of the board of interest, and sufficient lighting from multiple directions, none of which should be within or close to the field of view of the camera if the PCB was replaced by a mirror. Diffusers will probably be needed to avoid sharp shadow edges. Try to avoid having to hand-hold *ANYTHING* or the need to rely on ambient lighting. *NEVER* use camera mounted flash.As has been pointed out above, optical zoom + a greater distance to the subject PCB is helpful for minimising distortion, and digital zoom is always unhelpful as all it does is throw away resolution. Unfortunately increasing the distance reduces the amount of light from the subject entering the lens, so its vitally important to have a lot of very good lighting.Also, to avoid blur due to camera shake, remote shutter release is highly desirable, though one can make do with a timer shutter release at a pinch. As many higher end cameras support remote control over their USB lead, keeping the camera tethered to a PC is often the simplest approach, especially as it lets you rapidly see the results at full resolution, and in many cases will avoid discharging the camera's battery.

author: Kleinstein
author_rank: Super Contributor
timestamp: October 15, 2017, 12:38:00 pm
content: To reduce barrel distortion it helps to use a little more distance, especially if you can compensate with optical zoom. Usually the minimum object size to fill the picture will change very little. One will lose some light this way, but only at constant aperture. If a constant depth of field is used, the larger aperture will compensator for the light lost.Some simple cameras have automatic aperture control only. Here one can still get the desired relatively small aperture by using enough light and if possible adjust sensitivity. A larger distance and some optical zoom can also help if very large depth of field is needed with a limited aperture range.The camera internal flash can be used in combination with an extra diffusor, not perfect but also not that bad. However some cameras can have trouble due to to much light - so it might take some experiments to find the right way or scattering the light.Many simple cameras should be good enough for PCB pictures.

author: cdev
author_rank: Super Contributor
timestamp: October 15, 2017, 03:15:02 pm
content: This is all really good advice. There is no substitute for a tripod for improving the sharpness of images.A good poor man's copy stand can be made from the most inexpensive tripods by using some heavy object to weigh the long leg down. Use two legs at their shortest and the third leg at is longest extension to stabilize a camera facing downward- putting some weight on that leg to offset the camera's weight.A strong carbon fiber tripod that can fix its legs in several angles and have its head reversed so that the camera on its head can be attached underneath the base facing downward- that's the ideal setup.Some cameras can be triggered by sound - your simply making a sound.I personally like to use clamp on lamps for photography. Depending on the subject, you may need direct light, or sometimes shining a few very bright clamp on lights at a light colored wall is enough. That gives you a really nice diffuse light.A remarkably good light diffuser can be made from a cheap white umbrella.You want to see the effects of whatever you are doing as soon as possible.Some cameras - especially if you buy used, a used DSLR for example, might support tethering over USB or wifi with what is called "LiveView" on your computer screen.. they would be a very good choice. Others will let you view your image live on an HDMI monitor.Quote from: Ian.M on October 15, 2017, 11:07:55 am

author: David Hess
author_rank: Super Contributor
timestamp: October 16, 2017, 01:52:47 am
content: Quote from: rcbuck on October 15, 2017, 01:57:28 amI posted those to show what can be done under poor conditions. They were all taken by hand instead of mounting the camera and with poor lighting. The things I was looking for in the camera to allow this were optical zoom, which came with macro capability, and image stabilization.QuoteThe f-stop controls how much light gets through the lens. The reason this is important is that it does this with an adjustable iris and when the iris is contracted, the depth of field is increased making focus less critical. However this then requires a longer exposure so brighter illumination is required or if shooting by hand, image stabilization.QuoteIn the past when it mattered, my lighting of choice was multiple linear fluorescent light fixtures. I prefer that for my workbench as well.

author: Brumby
author_rank: Unknown
timestamp: October 16, 2017, 02:44:59 am
content: The issue with depth-of-field is a very important one as well when you are shooting things like PCBs.When you focus a lens on a subject, some objects that are a little closer or a little further awayappearsharp because the loss of sharpness is so small that it is not visible. The range over which this characteristic occurs is know as the "Depth of field".Depth of field increases when the physical aperture of the lens is smaller (higherfnumber), so if you want to have the greatest depth of field possible, then you generally want to use the highestfnumber you can. (There can be an issue with diffraction if you go too high (start paying attention fromf22)). The trade-off here is that the smaller the aperture, the less light gets through. Really good lighting is the answer!For a flat, unpopulated PCB, depth of field is pretty much irrelevant - but for a PCB with tall capacitors, you need a decent depth of field for everything to look sharp. To get the greatest useful depth of field, you must also choose your actual focus point carefully ... remember, you want therangeof acceptable focus to cover your subject. If your PCB is 4cm high and your depth of field is the same, you will need to focus on a point that is a little more than 2cm above the table top.This is where moving the camera away can be helpful... The further away, the greater the depth of field becomes. Using optical zoom can reduce the depth of field a bit - but overall, you are better off.If you want to take on some more advanced material, try checking out: "hyperfocal distance" and "circle of confusion".

author: Brumby
author_rank: Unknown
timestamp: October 16, 2017, 03:48:54 am
content: Here's an interesting calculator....http://www.dofmaster.com/dofjs.html

author: Howardlong
author_rank: Super Contributor
timestamp: August 27, 2018, 08:52:03 pm
content: FWIW, I've been eyeing up one of the pixel shifting cameras for a while now for taking pictures of larger boards. These increase the sensor's native resolution by taking eight pictures in quick succession and shifting the sensor by a fraction of a pixel each time.I was in Akihabara yesterday and couldn't resist it any longer, so I picked up a Panasonic G9 which offers 20M pixel native and 80M pixel in high resolution pixel shifting mode.20M pixel link80M pixel shifted linkLens is an Olympus 60mm macro prime f2.8 1/25s using some not too great lighting in the lab. Unsurprisingly, you have to use the camera on a tripod, and you set up a timer delay, although I was operating the camera from an ipad so the timer delay can be minimal. It takes the eight pixel shifted pictures in very rapid succession, then spends a couple of seconds processing the image in camera. It offers options for either raw or JPG images, or both, plus an option for a native resolution version.For reference, here is a downsampled 1M pixel version of the original, and a zoomed in comparison snap of resistor R7 in the middle of the board, 80MP on left, 20MP on right.(The focusing's not right at the bottom right because the board wasn't level and the aperture's wide open, but you get the idea.)

author: jaromir
author_rank: Unknown
timestamp: August 28, 2018, 12:19:25 pm
content: Since this thread has been already revived, I'll ask another question: How do you prevent the red LEDs to look pink-ish?It is visible on first picture in post 11 of thread -https://www.eevblog.com/forum/chat/camera-to-take-photos-of-assembled-pcbs/msg1324070/#msg1324070so I'm not the only one.I obtained the same results from smartphone (Motorola G4), also from a few compact cameras, the results are very alike. Attached is my photo - the LED display is red, almost a bit orange when viewed by my eyes, but has pink or even purple hue on photo.I know this isn't the best photo equipment and more expensive gear probably provides better results, but is there a way to workaround it with cheaper cameras?

author: rdl
author_rank: Super Contributor
timestamp: August 28, 2018, 12:33:00 pm
content: It's probably just that the LEDs are overexposed. Try increasing the ambient light or dim the LEDs somehow.

author: Ian.M
author_rank: Super Contributor
timestamp: August 28, 2018, 12:35:05 pm
content: That's due to the different colour response of the human eye and the camera sensor. Also the sensor has far less dynamic range than the eye so bright LEDs may be saturating it.If Rdl's quick and easy suggestions don't help, the best option would probably be to take two exposures with the camera on a stand without moving it, one with good lighting and power off to get the whole board and unlit display, and the other with the device on in the dark, with the camera well stopped down to prevent saturation and blooming. Colour correct the second exposure till the sampled illuminated LED is where you want it in RGB colourspace, threshold it to eliminate (black out) everything except the illuminated LEDs, then overlay them using an 'if brighter' merge mode.

author: Brumby
author_rank: Unknown
timestamp: August 28, 2018, 01:01:09 pm
content: Quote from: jaromir on August 28, 2018, 12:19:25 pmIt is a problem for even the most expensive cameras and comes down to one critical factor: dynamic range.The human eye is amazingly adaptable in dealing with bright and dark areas within a scene. Photographic equipment far less so. A typical example I can cite is watching a tennis match as the shadows move across the court as the sun goes down. When play goes between areas in sun and areas in shade, the TV image doesn't cope with the difference very well and following the ball is a challenge - but if you are sitting in the stands, you don't really notice. The difference is the primary image sensor - a piece of silicon in a camera or the human eye.This difference shows up in photos of LEDs where the centre spot of the LED is very high in brightness compared to the surrounding areas and this can push the numeric values extracted from the silicon quite high, heading towards maximums (which, in the extreme, would represent the brightest white) in a scene where the rest of the image would be properly exposed.There are cameras that have a dual scanning of the sensor - once with high sensitivity and once with lower sensitivity, with electronics to mix the signals in a way to obtain the best total image. I looked at a Panasonic camera for a project some 20 years ago which had this feature - but I don't know if even it would have been able to render a scene with an LED in it.Look for cameras that boast High Dynamic Range. My Samsung Galaxy S5 phone has a HDR setting on the camera. With it off, a red LED shows up as a pinkish white spot with a red halo. With it on, the LED shows up as orange with a red halo.It's been a long time since I was seriously assessing cameras - so I don't know if there is anything on the market that would do this properly ... but I have my doubts. Seems a bit of post production airbrushing is still the best way to achieve a satisfactory result.

author: EEVblog
author_rank: Unknown
timestamp: August 28, 2018, 01:09:11 pm
content: I'd go for an older model DSLR camera (even 10Mpixel is fine) that no ones wants with a proper 1:1 macro lens. Find the (used) macro lens first, and then get the cheapest DSLR camera to match.

author: jaromir
author_rank: Unknown
timestamp: August 28, 2018, 01:16:51 pm
content: Quote from: Brumby on August 28, 2018, 01:01:09 pmCould you, please, take pictures with both settings? I'm really curious how much better results it does provide. There is a plenty of phone camera reviews online, but most of reviewers don't do pictures of red LEDs.Thank you for detailed explanation.

author: TERRA Operative
author_rank: Super Contributor
timestamp: August 28, 2018, 03:23:19 pm
content: If you can output RAW, you can make a colour profile in Photoshop etc with a colour checker card.You'll need to redo it if the lighting changes, but if you use the same lighting setup each time, you can reuse the profile.This will help ensure your colour reproduction is as accurate as possible.

author: Brumby
author_rank: Unknown
timestamp: August 29, 2018, 01:04:37 am
content: Quote from: jaromir on August 28, 2018, 01:16:51 pmHere you go:(and, no, I don't normally run my hot air at 500º. I just wanted a second LED in the shot - and one that wasn't blinking.)

author: arthurhopkins
author_rank: Newbie
timestamp: September 26, 2018, 01:41:02 am
content: Quote from: rcbuck on October 13, 2017, 03:13:47 amI am using Canon PowerShot ELPH 360 HS, I love it because the 3rd part of the exposure triangle is ISO, which when increased, brings in more light to the sensor. But how about Go Pro HERO5 or Canon 70D.. this posthttps://passtools.com/best-camera-for-youtube/make me thing to change my Canon to Go Pro.