16mp autofocus on Pi Zero

  1. Where did you get the camera module(s)?
    Amazon

  2. Model number of the product(s)?
    Arducam 16mp autofocus SKU: BO371C

  3. What hardware/platform were you working on?
    Raspberry Pi Zero W, running bullseye (Linux 11)

  4. Instructions you have followed. (link/manual/etc.)
    How To Use Arducam 16MP Camera On Rapberry Pi - Arducam
    With a few modifications

  5. Problems you were having?
    None - worked out the issues of the Zero

  6. The dmesg log from your hardware?

  7. Troubleshooting attempts you’ve made?

  8. What help do you need?
    Trying to get consistent (but changing) focus in an automated growth chamber, where taking an image (via cron) every hour of growing plants, from 6 to 30cm distance.
    Currently using:
    libcamera-still -t 5000 --width 2328 --height 1748 --autofocus -o /home/pi/Desktop/test.jpg
    a) I take it there is no way to set a specific focus via libcamera, only --autofocus. How long does it take for autofocus to ‘settle’? 5sec usually gives a good focus, but is fuzzy several times a day.
    b) Is there a mapping between the v4l2-ctl manual focus (1-1023) and focus distances (6cm to infinity), or does this have to be trial and error for each camera?
    c) I assume in a shell script you can use v4l2-ctl to set the focus, then call libcamera (without --autofocus) to capture the image.
    I finally figured out a consistent build process, now trying to work out the details.
    Great little camera, thanks for the help.

Hi,
a. Autofocus time is inversely proportional to frame rate. In other words, the higher the frame rate, the longer the autofocus time. And autofocus is center focus, which may cause photos to become blurred due to changes in ambient light.
b.There is no specific mapping between code(1-1023) and distance(6cm-infinity)
c. It is certain that we can use v4l2-ctl to set the focus by calling libcamera to capture the image.

Your questions and ideas are great!