Introduction
Arducam 5MP OV5647 Motorized Focus Camera Modules are designed for you to control the focus via software, so you can see closer and see where you want to see.
To learn more about autofocus with Raspberry Pi camera modules, we recommend you read Raspberry Pi Camera Autofocus: The Complete Guide.
Models in this Series
There are two cameras in this series. The main difference between them is the camera board size. They are the same in terms of software operation.
SKU | Case | Camera Board Size |
B0176 | √ | 25×24 mm |
B0121 | × | 40×40 mm |
Common Specs
Image Sensor
Sensor Model | OV5647 |
Shutter Type | Rolling Shutter |
Active Pixels | 2592×1944 |
Resolution | 5MP |
Image Sensor Format | Type 1/4″ |
Pixel Size | 1.4μm×1.4μm |

OV5647 Full Datasheet
Refer here:
https://www.arducam.com/downloads/modules/RaspberryPi_camera/OV5647DS.pdf
Lens Assembly
SKU | B0176 | B0121 |
Interchangeability | No | No |
Focus Distance | 4 cm to infinity | 4 cm to infinity |
Focus Type | Motorized Focus | Motorized Focus |
Field of View(FoV) | 54°H×44°V | 54°H×41°V |
IR Sensitivity | Visible Light | Visible Light |
Camera Board
B0167 | 25×24 mm |
B0121 | 40×40 mm |

Connector & Cable
Connector Interface | MIPI CSI-2 15-pin 2-lane |
Ribbon Cable Length | 150mm |
Quick Start Guide
Hardware Setup
Ensure your Raspberry Pi is turned off.
1.Locate the camera port (CSI)
For Raspberry Pi Model A & B, it’s between the HDMI and audio port of the Raspberry Pi board.

2.Gently pull up on the edges of the connector’s plastic clip and avoid pulling it off
3.Insert the ribbon cable
Make sure the metal contacts are facing the HDMI connectors. Do not bend the flex cable, and make sure it’s firmly inserted.
4.Push the plastic clip down
Do it while holding the flex cable still, until the connector’s clip is back in place.
Software Setup
Preparation
- Start up your Raspberry Pi.
- Go to the main menu and open the Raspberry Pi Configuration tool.
- Select the Interfaces tab and ensure that the camera is enabled:
- Reboot your Raspberry Pi.
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