Skip to main content

Fixing blurry 8-50mm Zoom Lens for Raspberry Pi High Quality Camera

When you mounted the lense with C-mount, it might be that everything is extremely blurry.
To adjust it, might feel like a daunting task.


The issue is the focal point when you attach the lense too close to the sensor. For this, you have the lock-screw on the C-mount and should not screw in the lense all the way to the end.

Ideally you'd open a video stream and watch it with the near/far focal ring in the middle and the tele/wide ring in the middle.While you adjust the C-mount screw depth.

image.png


You'd want to reach a point where either focal rings will have impact on sharpness with very tiny mainpulations (1/10th of a mm will be blurry or not  blurry).

You could make such a program and then refresh the page after every manipulation to focus the lens.

@app.route('/hq_snapshot')
def hq_snapshot():
    path = "/tmp/hq_snapshot.jpg"

    subprocess.run([
        "rpicam-still",
        "--camera", "0",
        "--nopreview",
        "--timeout", "300",
        "--width", "1920",
        "--height", "1080",
        "-o", path
    ], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

    return send_file(path, mimetype="image/jpeg")

After you're done, lock the lockscrew.
Now, you should be able to focus with the focal rings, you'd set the tele/wide ring to approximately the object you want to have in focus and adjust the "near/far" until it becomes sharp.

 

Opeing the shutter (open/close) ring has some effect on sharpness or image bleed. It reduces or increases the amount of light that hits the sensor. In bright shiny days, fully open shutter will create fuzzy overexposed images.