Smart Phone Camera Turns Laser Cutter Into Hi-Res Scanner

Getting decent macro photos always seems to be a chore. Some important detail always seems to be just outside of the depth of field, or you have to be zoomed in so close that you get great detail in one spot but miss the big picture. [Nate B] had such a problem while trying to document some PC boards, and he came up with a nifty hack that uses a laser cutter and a smart phone camera to do the job.

Click for detail.

Having first tried scanning the boards with a flat-bed scanner but finding the depth of field unsatisfactory, [Nate B] then went on to his Samsung phone’s camera. Set to panorama mode, he manually scanned across the boards and let the camera stitch the images together. The results were better, but the wobblies got the better of him and the images showed it. He then decided to use a laser cutter — with the laser disabled, of course — as an impromptu X-Y stage to raster his camera above the boards. In a slightly cringe-worthy move, he gingerly clamped the phone to the cutter gantry, started the panorama, and let the cutter move over the board. This results in a rock-solid pictures of his boards with a lot of detail – perfect for his documentation. As a bonus, the honeycomb laser cutter bed makes for an interesting background texture.

Obviously anything could be used to raster a camera and achieve similar results, but full points here for maximizing available resources and not over-complicating a simple job. Yet another reason you can use to justify that laser-cutter purchase.

35 thoughts on “Smart Phone Camera Turns Laser Cutter Into Hi-Res Scanner

        1. The old-school scanners with the sensor in the back and a lot of optics for diverting the image did have a pretty good depth of field. I used the same technique for a lot of cool things. That was back when digital cameras were still in the kilo-pixel range.
          The new cheapo scanners are crap though…

          1. I don’t think it’s a case of old-versus-new, but it might be a case of flying-optics versus flying-mirror or something. I haven’t taken apart a lot of flatbed scanners, but I know I’ve had mixed results from flatbeds over the years. Some have really good depth-of-field, some have crap, some have a lot of jitter (mechanical perturbation) on objects in the far-field even though they’re still in focus, etc. It’s a mixed bag!

            If you find a scanner with good DoF, keep it around as long as you can find drivers for it. Much simpler than this hack!

          1. Another vote for Hugin, it’s great if you want to invest the time. I got “good enough” results with the 2-minute process detailed in the article here, but if I needed better and felt like putting in more effort, Hugin would be my first choice.

            One problem I’ve had with Hugin is moving the camera between shots. It really expects the camera to *pivot* between shots, and any shift in perspective causes huge stitching artifacts, which makes it hard to follow PCB traces, for instance. Being able to cover the whole board while pivoting the camera would mean a lens that can see micro-detail from far away, and I don’t have such a lens. Otherwise, shifting the board like in Stephanie’s setup below, I’d have to figure out how to conquer the perspective/parallax problems (which it sounds like ICE may do better than Hugin perhaps?).

            Hugin has served me well for landscapes, not so much for PCBs. By all means, do better and document your technique!

  1. My method:
    I put my Powershot S2 on my tripod, raise the camera up high, zoom in to have the short side of the board fill the width of the camera sensor, no direct light, very long exposure, self-timer to avoid blurred pictures. The board is moved below the tripod and the pictures are stitched with Hugin.

  2. A different approach:
    Use the laser and it’s focusing mirror assembly in combination with a “beam splitter” to illuminate and capture the back image. Use the Z-Axis/table height adjuster (make it linux-cnc and microstep) to get many field of depths (there are programs to render a 3d image from microscopic images – these should apply here)

    example beam splitter assembly:

    It came to my mind when I checked the alignment and condition of my used/new laser cutter that I could see base roaster in great detail through the _focusing_ mirror assembly.

    1. This is similar to how some metrology devices do imaging.

      It is also simialr to how we use microscopes to measure depth in micron scale – counting rotations of a micrometer that controls focal-depth, while watching for when features are in focus.

  3. I have a desk lamp which is a magnifying lens surrounded by a ring light, it’s good for soldering tiny parts. I just lay the smartphone of the lens and move the lamp as close as the focus will allow, then I shot with timer. It’s a 13MP camera, the photos are a bit distorted, but I can see a lot of details in the pcb. Never stitched it, but it sounds a good option.

    1. 13mp is a ton of pixels.

      it is the quality of the optics and the interpolation (from whatever the REAL sensor resolution is) that is making the image blurry.

      A $35 used digital camera is a far better option than this hackery!

    1. Clearely you have never tried the process you recommend. Just for discussion here are problems with that path.

      1) There are not 3D models available for all parts\packages
      2) The output simply is NOT a picture of the PCB and will not convey quality and other characteristics of the PCB
      3) 3D rendering high quality images takes patience, experience and commitment to a new discipline
      4) People like to see pictures of things they are going to buy – a 3D image is just a 3D image

  4. BTW, I think the quality of the included picture is not very good, you can hardly read what’s on the chips or resolve all the traces, there’s blurring and sensor noise.
    And I was also surprised how small that example PCB is, on the video and photos it looks to be small enough to shoot with a single shot. But I guess it’s just an example of the concept, better light and/or camera as well as larger PCB should be easily done with the same setup.

    1. You’re absolutely right, the example board wasn’t chosen to ideally exemplify the technique. It’s the board I was working on for another project, and I figured I’d shoot a quick video to get the technique out there. It’s better than the results I got from a single-shot with any of the cameras available (I’m jealous of Stephanie’s setup, below!) and had the advantage of being very quick — from idea to image in about 3 minutes. I did no tweaking, no lighting, didn’t even clean the lens, and I had a usable image to move ahead with my other work in the time it took to microwave some noodles. Not that Hugin isn’t great, but it also isn’t quick!

      I mostly wanted to get the idea out there (and thank you, Hackaday, for doing so!) in hopes that others would take it and run with it. With more and more people having a CNC gantry around for whatever reason (laser cutters, routers, mills, 3d printers), there should be plenty of folks who can take this spark of an idea, sit down with Hugin or whatever for an evening, and blow us away with the next iteration on process, analysis, and results. I eagerly await it!

  5. I use a camera setup to do similar pictures. I need really high resolution pictures, So I use a 5D Mark II with a 100mm Macro lens. I make a light fixtures using some aluminum extrusions, and some non-point source lights by using LED strips, cut and glued onto 2 aluminum plates and left fully adjustable.
    Then you need to set your camera correctly – a small aperture size for a large DOF, manual exposure and other settings. Overlap each picture by 50% or more, scanning across the board by moving it manually. Then I import it into Microsoft ICE (Sorry Hugin fans, I never could get that software to work correctly), and export the final image. I easily get a 100 Megapixel+ image of a board that’s ~3in x 3in.

    1. That sounds like an amazing setup! I went for the quick-and-just-barely-good-enough end of the tradeoff, it sounds like you went to the other extreme. Can you share any of the results?

      My biggest hassle when taking board photos is getting the lighting angle right to see the chip markings, and it sounds like you might have that licked with the adjustable strips — do you have to do much tweaking per shot, or are there angles that “just work” and you leave ’em set that way?

      1. It would work equally well with a 600$ camera. Practically anything would be better quality than a cell phone, especially considering that the lenses and focusing is not made for macro shots, you cannot change the aperture (necessary for a high DOF), or exposure (necessary for seamless images).
        It cost me less than 50$ in parts for this setup, comparable to a 200$ document camera stand.

          1. The typical tiny lens/sensor system of cell phone cameras intrinsically (due to the physics) has a much larger depth-of-field than the typical 35mm camera setup. However, a 35mm camera will have better light sensitivity and noise characteristics. There are tricks to compensating for the defects found in either system for this application.

        1. A Sony A5000 refurb cost me £100, the kit lens and the cheap eBay macro rings (with the pogo pins) gives you power zoom, OIS, remote viewfinder app on Android/iOS an APS-C sensor with decent sensitivity and the Sony image processing which is good at removing noise.
          That gets me close enough to see the dust between the edge balls of a the raspberry pi BGA with my standard room lighting.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.