Hacker News new | past | comments | ask | show | jobs | submit login
Taking a Good Picture of a PCB (brixit.nl)
80 points by zdw on Nov 28, 2022 | hide | past | favorite | 32 comments



Big Clive also has a neat method for his youtube videos: https://www.youtube.com/watch?v=L6sAS-y21xA


In an industrial setting, it is common for PCB/component inspection to take images using a telecentric lens, to eliminate all perspective on any tall components around the sides (and also allow precision measurement using optical processing only). That, coupled with good lighting and sometimes polarization can result in pictures of components so perfect that they look like they were renderings.


I've been thinking about doing this with a telecentric lens but the one in have is like 5 inches so would need to stitch a bunch of images for a bigger board. And bigger lenses are big bucks.


Another option is to lay the PCB on a flatbed scanner.

Check out the nice pictures at https://learn-cnc.com/reverse-engineering-pcbs/ for example.


The issue with this is you need flat PCBs due to the depth of field of a flatbed scanner. Even in that article they had to remove components from it. That's quite annoying since most of the boards I have have stacked USB connectors.


Yep, that's the big drawback. It looks rather nice, however.


I'd be scared of scratching the glass of the scanner.


I'd imagine you should be able to place a thin sheet of perspex - or something similar - to protect the glass


PCBs rarely contain diamonds. For decent scanners with real glass this is not a major problem.


Pockers rarely contain diamonds. Phone screens are real glass. Yet phone screens get scratched over time.


A lot of it is probably quartz in dirt.


Cling film on the bottom?


> Another option is to lay the PCB on a flatbed scanner.

That's detailed in the article.


No it's not.


Ugh, you're right, I read the wrong link. Sorry.


If you don't have a lightbox, a long exposure (15-30 seconds, might need a very small f-stop or ND filter) and waving an LED torch around the PCB is almost as good at removing all the shadows, but less consistent.


The author may be interested in gphoto - a way to control cameras over USB: https://github.com/gphoto/gphoto2


If it's supported that would require buying the propriatary usb cable for this camera sadly. And I'd have to have the computer nearby.


>>> All dust looks 1000x worse on pictures :(

Indeed, I use a cheap paintbrush and a blast of air to remove dust from small things, including circuit boards, before I have to take a picture.


A bit more on the technic (and expensive) side, you can use a Tilt-Shift lens to change the focus plane and get striking results with PCBs or any other small items.


Oh nice idea, I have not even tried using my tilt-shift adapter for this


The ingenious trick at the end: using a lightbox, take two pictutee: one with cirre lighting, and another heavily underexposed. The latter shows everything black but the background, and serves as a perfect mask for the former for background removal.

It's sort of anti-HDR. The author automates processing using imagemagick.


Nice article with some actual results and not too long either.

If one is on more of a budget here's a video by bigclive how he takes PCB photos on a budget. https://youtu.be/L6sAS-y21xA


Outdoors on a cloudy day can give excellent results too, especially if you use a camera where you can manually control the exposure.



I'm surprised it doesn't mention focus stacking


So far has not been needed. With the lens I'm using and the amount of light I can stop it down to f/8 and not have issues with blurry parts. For the macro pictures of components I need to look into focus stacking if I want to have both the board and the chip number in focus but that's not a big priority for me.


Why not auto white balance the off-white background? Seems easier than making a mask.


That would make everything lit with the flashes look way too yellow. also it wouldn't make it a perfectly FFFFFF white mask around the board.


That would mess with the colors on the pcb


Should use a longer focus lens to avoid perspective distortion.


Well the downside is that with my longer lenses I'd have to make a hole in the ceiling :D




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: