Cameras for Raspberry Pi

  1. Home
  2. Docs
  3. Cameras for Raspberry Pi
  4. Native Raspberry Pi Cameras
  5. 5MP OV5647 Motorized Focus Camera Modules

5MP OV5647 Motorized Focus Camera Modules

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.

B0176

B0121

SKUCaseCamera Board Size
B017625×24 mm
B0121×40×40 mm

Common Specs

Image Sensor

Sensor ModelOV5647
Shutter TypeRolling Shutter
Active Pixels2592×1944
Resolution5MP
Image Sensor FormatType 1/4″
Pixel Size1.4μm×1.4μm
OV5647 Block Diagram
OV5647 Block Diagram

OV5647 Full Datasheet

Refer here:

https://www.arducam.com/downloads/modules/RaspberryPi_camera/OV5647DS.pdf

Lens Assembly

SKUB0176B0121
InterchangeabilityNoNo
Focus Distance4 cm to infinity4 cm to infinity
Focus TypeMotorized FocusMotorized Focus
Field of View(FoV)54°H×44°V54°H×41°V
IR SensitivityVisible LightVisible Light

Camera Board

B016725×24 mm
B012140×40 mm
Mechanical Dimension OV5647
B0167 Mechanical Dimension

Connector & Cable

Connector InterfaceMIPI CSI-2 15-pin 2-lane
Ribbon Cable Length150mm

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.

SPRK default preset name web 1920 – 1
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

Demos Function

Arducam has release three demos Motorized_Focus_Camera_Preview.py, Motorized_Focus_Camera_Snapshot.py and Autofocus.py

  • Before running this demo, you have to install Python Dependency libraries.
sudo apt-get upgrade
sudo apt install -y python3-kms++ python3-libcamera
sudo apt install -y python3-pyqt5 python3-prctl libatlas-base-dev ffmpeg
sudo pip3 install numpy --upgrade
sudo pip3 install picamera2 opencv-python
Download library
git clone https://github.com/ArduCAM/RaspberryPi.git
Enable i2c
cd /home/pi/RaspberryPi/Motorized_Focus_Camera
sudo chmod +x enable_i2c_vc.sh
./enable_i2c_vc.sh 

Press Y to reboot

Motorized_Focus_Camera_Preview.py
  • This demo supports focusing in preview mode, You can see the focus visually
  • Single focus by keyboard up and down
  • Run this demo is very easy , just input the “python3 Motorized_Focus_Camera_Preview.py” in the terminal.
AutofocusTest.py
  • This demo supports auto focusing in preview mode, You can see the focus visually
  • Run the demo by inputing the “python3 AutofocusTest.py” in the terminal.

Usage:

Python demo

cd RaspberryPi/Motorized_Focus_Camera/python/
  • FocuserExample.py Example of manual focus
python FocuserExample.py -i 10

Screenshot:

screenshot.png


  • AutofocusTest.py Example of autofocus
    Click the ‘F’ button to achieve auto focus, click the ‘Q’ button to exit and save the picture
python3 AutofocusTest.py -i 10

C demo

cd RaspberryPi/Motorized_Focus_Camera/C/
make install
make 
./manualFocus

Was this article helpful to you? Yes 2 No