Introduction
This Arducam IMX477 High Quality motorized focus camera module integrates a motor that could be controlled by software for a smarter focus, and you will no longer focus the camera by screwing the lens with your bare hands.
So how has software focus control made it more convenient? Here is an idea: Arducam provides you with an example program to control the focusing motor with keyboard keys, so you can focus the camera remotely with precision in an intuitive way. In another example powered by OpenCV, algorithms are used to control the motor and achieve autofocus.
Other than its motorized focus, it offers the same picture quality and camera controls as the Raspberry Pi High Quality camera.
To learn more about autofocus with Raspberry Pi camera modules, we recommend you read Raspberry Pi Camera Autofocus: The Complete Guide.
Common Specs
Image sensor
Sensor Model | IMX477 |
Shutter Type | Rolling Shutter |
IR Sensitivity | Visible light |
Active Pixels | 4056×3040 |
Resolution | 12 MP |
Image Sensor Format | 1/2.3″ |
Pixel Size | 1.55μm×1.55μm |

Lens
F/NO | 2.0 |
Focus Type | Motorized Focus |
Lens Focal Length | 3.24mm |
Field of View(FoV) | 87° (H) |
Back Focal Length | 7.53mm |
Lens Dimention | Φ16×18mm |
Connector & Cable
Camera Connector | MIPI CSI-2 22-pin |
Cable Length | 300mm (22-pin), 300mm(15-22pin) |
Pin # | Name | Description |
---|---|---|
1 | GND | Ground |
2 | CAM_D0_N | MIPI Data Lane 0 Negative |
3 | CAM_D0_P | MIPI Data Lane 0 Positive |
4 | GND | Ground |
5 | CAM_D1_N | MIPI Data Lane 1 Negative |
6 | CAM_D1_P | MIPI Data Lane 1 Positive |
7 | GND | Ground |
8 | CAM_CK_N | MIPI Clock Lane Negative |
9 | CAM_CK_P | MIPI Clock Lane Positive |
10 | GND | Ground |
11 | CAM_D2_N | MIPI Data Lane 2 Negative |
12 | CAM_D2_P | MIPI Data Lane 2 Positive |
13 | GND | Ground |
14 | CAM_D3_N | MIPI Data Lane 3 Negative |
15 | CAM_D3_P | MIPI Data Lane 3 Positive |
16 | GND | Ground |
17 | CAM_IO0 | Power Enable |
18 | CAM_IO1 | LED Indicator |
19 | GND | Ground |
20 | SCL | I2C SCL |
21 | SDA | SCCB serial Interface data IO |
22 | VCC | 3.3V Power Supply |
Quick Start Guide
For Bullseye System
If you are running the latest version of Raspberry Pi OS. (January 28th,2022 or later releases, Debian version:11(Bullseye)). You need to update the config file and use libcamera apps.
- For Raspberry Bullseye users running on Pi 4, please do the following:
sudo nano /boot/config.txt Find the line: camera_auto_detect=1, update it to: camera_auto_detect=0 dtoverlay=imx477 Save and reboot.
- For Bullseye users running on Pi 0 ~ 3, please also:
Open a terminal Run sudo raspi-config Navigate to Advanced Options Enable Glamor graphic acceleration Reboot your Pi
If you encounter the display issues, please also execute the following steps:
Open a terminal Run sudo raspi-config Navigate to Advanced Options Navigate to GL Driver Select GL (Full KMS) Reboot your Pi
- For Raspberry Pi Compute Module 3/4
The latest software only supports one camera at this time, CM4 uses CAM1 by default.
If you are running the previous systems (Buster legacy and the system before it), you can refer to the following steps:
For Legacy System
NOTE
The following Raspberry Pi Image System is the legacy system, at present we recommended using the Bullseye system.

Hardware Setup

First Use
1.Clone the file
git clone https://github.com/ArduCAM/RaspberryPi.git

2.Install Python Dependency libraries
sudo apt-get install python-opencv

3.Enable the I2C0 adapter
cd RaspberryPi/Motorized_Focus_Camera chmod +x enable_i2c_vc.sh ./enable_i2c_vc.sh

Then press ‘y’ to reboot.
4.Demo code
4.1 Motorized_Focus_Camera_Preview.py
This demo supports focusing in preview mode. Single focus by keyboard up and down arrow.
cd RaspberryPi/Motorized_Focus_Camera sudo python Motorized_Focus_Camera_Preview.py

4.2 Motorized_Focus_Camera_Snapshot.py
This demo supports focusing and save the image to the local filesystem. You can save the image after each focus. Single focus by keyboard up and down arrow.
cd RaspberryPi/Motorized_Focus_Camera sudo python Motorized_Focus_Camera_Snapshot.py
4.3 Autofocus.py
This demo supports auto focusing in preview mode.
cd RaspberryPi/Motorized_Focus_Camera sudo python Autofocus.py
Note
You can modify the code to get a better image. The helpful links for you to modify code.
Explore more resources:
https://picamera.readthedocs.io/en/release-1.13/recipes1.html?highlight=shutter%20speed#capturing-consistent-images
https://picamera.readthedocs.io/en/release-1.13/api_camera.html#picamera
FAQ/Troubleshooting
The use of the four Raspberry Pi camera applications
FAQ about raspberry pi camera module