Motorized Focus IMX219 module on Raspi zero W and RPI4

Published by knewbery on

New Home Forums 1. Cameras Modules for Raspberry Pi 8MP IMX219 V2 Cameras Motorized Focus IMX219 module on Raspi zero W and RPI4

Tagged: ,

Viewing 6 reply threads
  • Author
    Posts
    • #14263
      knewbery
      Participant

      Hi,

      I have a standard RPI zero W, with latest distribution, connected to a standard RPI2.1 camera board with the arducam IMX219 motorized focus module on the genuine Raspi V2.1 board.

      Arducam IMX219 Auto Focus IR Sensitive (NoIR) Camera Module, drop-in replacement for Raspberry Pi V2 and NVIDIA Jetson Nano Camera

      I have enabled dtparam=i2c_vc=on in /boot/config.txt and can i2cdetect /dev/i2c/0 ok,

      Going through the code for ‘Motorized_Focus_Camera_Preview.py’ i see it calls i2cset for bus 0, address 0x0C but, the write/read fails.

      https://github.com/ArduCAM/RaspberryPi/tree/master/Motorized_Focus_Camera

      I have been spying on the I2C traffic to the camera module, and when using raspistill all the traffic goes to/from I2C address 0x10.

      Running “Motorized_Focus_Camera_Preview.py” and trying to read/write with icset to bus 0, address 0x0C fails

      So, my question is what is the correct programming I2C address/method for this module? It does not seem to be as the demo python script eludes to..

      Is there a datasheet for this module that explains how to drive the motorized focus?

      thanks
      K

    • #14266
      bin
      Keymaster

      Hi,

      Don’t worry and I will try my best to help you. All of the Arducam products are guaranteed of their quality.  Please attach me some pictures of  your hardware connection setup.

      Notice, our camera need to use the i2c0 bus, please ensure you don’t have other devices occupied the i2c0 bus.

       

    • #14276
      knewbery
      Participant

      Here’s my setup

      1) RPI Zero W with RTC.

      2) /boot/config.txt has

      dtparam=i2c_vc=on

      when I run ‘raspistill -t 0’  to get constant preview … I then run i2cdetect

      [email protected]:~/RaspberryPi/Motorized_Focus_Camera $ i2cdetect 0
      WARNING! This program can confuse your I2C bus, cause data loss and worse!
      I will probe file /dev/i2c-0.
      I will probe address range 0x03-0x77.
      Continue? [Y/n] y
      0 1 2 3 4 5 6 7 8 9 a b c d e f
      00: — — — — — — — — — — — — —
      10: 10 — — — — — — — — — — — — — — —
      20: — — — — — — — — — — — — — — — —
      30: — — — — — — — — — — — — — — — —
      40: — — — — — — — — — — — — — — — —
      50: — — — — — — — — — — — — — — — —
      60: — — — — 64 — — — — — — — — — — —
      70: — — — — — — — —

      and I can take pictures with raspistill ok, but as before, I can’t work out the address of the focus control function in the camera module that can control the focus, since I2C address 0x0C does not seem to be correct.

      I have read to all addresses on bus /dev/i2c-0  and there is nothing else on that bus _besides_ the RPI 2.1 camera module at address 0x10, and the crypto chip at 0x64

      setup

    • #14277
      knewbery
      Participant

      btw. also using IONinja to monitor the i2c bus directly at the connector on the camera board.

    • #29031
      ohlee
      Participant

      Hi there,

      I’ve been testing with same hardware RPi Zero WH and Motorized Focus IMX219 module…

      unfortunately I have no success and it seems like there is no complete setup guide.

      Can you please assist and tell me what is necessary in order to use above mentioned hardware with your motorized focus camera? I’m asking for this because it seems like there is no up-to-date software nor setup guide so at the moment I simply don’t know what to install! Not to mention the python 2/3 pygame-and-missing-dependencies-and-incompatibility-issues…

      Can you please assist and tell me how to do a fresh install on a Pi Zero WH with latest PiOS?

      Thank you!

    • #30227
      hasman
      Participant

      Hello, I have been having a similar problem.

      The I2C slave address programmed in the python and C code, is 0x0C. However, my camera shows up at address 0x36 (once it’s powered on).

      After I changed the address in the code, the I2C writes succeed but there is no effect–the optical focus does not change.

      I would appreciate any help in figuring this out. Is it possible I have a defective unit?

    • #30228
      hasman
      Participant

      Never mind, I figured it out. My camera has no motorized focus, it’s a fixed-focus model.

      No problem!

Viewing 6 reply threads
  • You must be logged in to reply to this topic.