Motorized Focus IMX219 module on Raspi zero W and RPI4

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.

https://www.arducam.com/product/b0190-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

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.

 

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

pi@raspberrypi:~/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

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

Hi,

Thanks for your detail description. I have tested the preview script and find it exists some problems. I will fix it later. I have update a C code used to preview and manual adjust the focus.

Please try the new code here:https://github.com/ArduCAM/RaspberryPi/tree/master/Motorized_Focus_Camera/C

I have tested it and it can work normally.

 

Hi,

Thanks for your detail description. I have tested the preview script and find it exists some problems. I will fix it later. I have update a C code used to preview and manual adjust the focus.

Please try the new code here:https://github.com/ArduCAM/RaspberryPi/tree/master/Motorized_Focus_Camera/C

I have tested it and it can work normally.

 

Hi,

Thanks for your detail description. I have tested the preview script and find it exists some problems. I will fix it later. I have update a C code used to preview and manual adjust the focus.

Please try the new code here:https://github.com/ArduCAM/RaspberryPi/tree/master/Motorized_Focus_Camera/C

I have tested it and it can work normally.

 

Hi,

Thanks for your detail description. I have tested the preview script and find it exists some problems. I will fix it later. I have update a C code used to preview and manual adjust the focus.

Please try the new code here:https://github.com/ArduCAM/RaspberryPi/tree/master/Motorized_Focus_Camera/C

I have tested it and it can work normally.

 

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!

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?

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

No problem!