1. Home
  2. Docs
  3. Cameras for Raspberry Pi
  4. Synchronized Stereo Camera HAT
  5. Sync Stereo Camera HAT User Manual

Sync Stereo Camera HAT User Manual

1.Introduction

Now Arducam released a stereo camera HAT for Raspberry Pi which allows you to connect two 5MP OV5647 or two 8MP IMX219 pi cameras to a single standard pi board, and takes images or video at the same time, even more, important they are fully synchronized.

The highlight of this stereo camera HAT is that it incorporates Arducam proprietary ArduChip solution, and extends the usage of the single pi camera port, it cheats the Raspberry pi as if only one camera connected. It supports Raspistill command for preview and Raspivid command for video capture/processing with Rpi default camera driver for its 5MP and 8MP cameras.

It also supports other Arducam Raspberry Pi cameras and a proprietary camera driver that works up to two 16MP. With the shared oscillator and I2C broadcasting, the two cameras are fully synchronized in the nano-second level. With the latest new coming Pi 4 hardware, Arducam makes more camera applications possible for Raspberry Pi.

Figure 1. Synchronized Stereo Camera HAT Photos

2. Features & Key Specifications

  • Support all series Raspberry Pi boards, Pi HAT board style
  • Two MIPI camera inputs and one MIPI camera output
  • Support 1, 2 and 4 lane MIPI cameras input up-to 800Mbps/lane
  • Support 2 lane MIPI output
  • Support Raspistill (preview) and Raspivid (processing) commands for 5MP/8MP pi cameras with half-resolution combine
  • Support Arducam RPI cameras up to 16MP with proprietary camera driver with full resolution combine
  • Support camera side-by-side combine, channel 0 and channel 1 software switching on the fly
  • Support digital pan in half resolution combine, programmable pan speed control
  • Board size: 65 x 56 mm
  • Weight: 16 g
  • Contact us for other platform support

Note:

Oscillator sharing requires extra cables, soldering skill needed or please use Arducam bundle kit

3. Applications

  • Stereo Vision
  • 360 Camera
  • Advanced Surveillance Camera

4. Assembly Instruction

4.1 Step 1

You need to modify your current Raspberry Pi V1.3 or V2 camera board with a soldering iron and hot air gun. This step can be skipped if you are using Arducam 5MP or 8MP stereo camera board like the Figure2 shows.

Arducam-Stereo-Camera-Board-doc
Figure 2. Arducam Stereo Camera Board

For 8MP V2 Pi Camera

Removing the resistor and crypto IC marked in a circle from one of the camera board and using jumping wires soldered to the pads as shown in Figure 3, twist the jumping wires will improve the signal quality.

8MP-V2-Pi-Camera-Rework-Instruction-doc
Figure 3. 8MP V2 Pi Camera Rework Instruction

For 5MP V1.3 Pi Camera

Removing the oscillator IC marked in a circle from one of the camera board and using jumping wires soldered to the pads as shown in Figure 4, twist the jumping wires will improve the signal quality.

5MP V1.3 Pi Camera Rework Instruction
Figure 4. 5MP V1.3 Pi Camera Rework Instruction

4.2 Step 2

Attach the 22pin-15pin ribbon cable to the stereo camera HAT (22pin end) and Raspberry Pi CSI port (15pin end).

Connect the 15pin-22pin ribbon cable
Figure 5. Connect the 15pin-22pin ribbon cable

4.3 Step 3

Plug the stereo camera HAT on top of the Raspberry Pi, align the HAT Pin1 to RPI’s Pin1, then using the screws to fasten the HAT.

Figure 6. Connect the HAT to RPi Board

4.4 STEP 4

Attach the two camera 22pin ribbon cable to the stereo camera HAT.

connect 2 camera doc
Figure 7. Connect two cameras

5. Quick Start Guide

5.1 Activate the I2C bus

If you are using a 5MP Camera, you need to activate the I2C bus first, then run an additional script to ensure that the stereo camera runs for a long time.

Launch the terminal window and run the following commands,

sudo nano /boot/config.txt


Add the following statement to the configuration file,

dtparam=i2c_vc=on

Then input Ctrl+XYEnter to save and exit the file.

Note: You only need to enable the I2C bus once.

activate the i2c bus
Activate the I2C bus

5.2 Using Raspistill Command

Run the following command from the terminal window to preview two camera feed at the same time.

raspistill -t 0 -p 800,100,1024,768

If the 5MP Camera is used, launch another terminal window to run the following commands (Not required for 8MP camera).

i2cset -y 0 0x36 0x48 0x0400 w
Figure-8-Preview-using-raspistill-command
Figure-8. Preview using raspistill command
preview with raspistill

Note

The stereo camera HAT doesn’t work with raspistill to take photos. Other software is required to take photos.

5.3 Using Raspivid Command

Run the following command from the terminal window,

raspivid -p 800,100,1024,768 -o video.h264 -t 20000

If the 5MP Camera is used, launch another terminal window to run the following commands(Not required for 8MP camera).

i2cset -y 0 0x36 0x48 0x0400 w
 Figure 9.  Record using raspistill command
Figure 9. Record using raspistill command

Then playback the recorded .h264 video file from the VLC player or similar.

Figure 10  Record using raspivid command
Figure 10. Record using raspivid command

Note

Play .h264 video file with VLC player on Raspberry Pi may be a little stuck.

5.4 Advanced Controls

The stereo camera HAT support channel selection and digital pan. It requires to write onboard ArduChip registers through the I2C bus on Raspberry Pi. So the user needs to active the I2C bus first(please refer to chapter 5.1 or the following methods).

Clone the GitHub repository from https://github.com/ArduCAM/MIPI_Camera.git and run the script ./enable_i2c_vc.sh, a reboot is required.

For more information about the ArduChip registers, please refer to chapter 7.

Before issuing any control command, you have to launch preview or video using raspistill or raspivid command first, then launch another terminal window to run the following commands.

5.4.1 Switch to CAM0, Single Mode

Run command i2cset -y 0 0x24 0x24 0x01 to switch from stereo mode to single mode CAM0 feed.

Figure 11  Single mode CAM0
Figure 11. Single mode CAM0

5.4.2 Switch to CAM1, Single Mode

Run command i2cset -y 0 0x24 0x24 0x02 to switch from stereo mode to single mode CAM1 feed.

Figure 12  Single mode CAM1
Figure 12. Single mode CAM1

5.4.3 Digital Pan Mode

Run command i2cset -y 0 0x24 0x24 0x02 to switch to digital pan mode, each camera feed will pan back and forth to get an entire field of view of the camera.

Run the command i2cset -y 0 0x24 0x25 0x20 to change the pan speed, the speed value 0x20 can be modified from 0x01~0x60.

5.4.4 Full Combine Mode

Full resolution combine mode doesn’t work with raspistill and raspivid mode, it requires Arducam MIPI camera driver from GitHub: https://github.com/ArduCAM/MIPI_Camera/tree/master

launch the terminal window to run the following commands.

a) Download and install the SDK library
git clone https://github.com/ArduCAM/MIPI_Camera.git
MIPI camera git clone
MIPI camera git clone
cd MIPI_Camera/RPI/
make install 
mipi camera lib make install
MIPI camera lib make install
b) Compile the Examples
make clean && make
mipi camera make clean compile
MIPI camera make clean compile
c) Run the Examples

The list_format command is used to check all resolution the sensor you are using supports.

./list_format 
mipi camera list format
List the supported format

The mode containing Used for Arducam Synchronized stereo camera HAT in the prompt can support Full Combine Mode.

Select mode 5 as an example,

./arducamstill -t 0 -m 5
select the mode 5 list format as an example
mipi camera mode 5 format selected

6. Pin Definition

Table 1 MIPI CAM 0 and MIPI CAM 1 Input Ports
Pin No. PIN NAME TYPE DESCRIPTION
1 DGND Ground Power ground
2 CAM_D0_N Output MIPI data lane0 negative output
3 CAM_D0_P Output MIPI data lane0 positive output
4 DGND Ground Power ground
5 CAM_D1_N Output MIPI data lane1 negative output
6 CAM_D1_P Output MIPI data lane1 positive output
7 DGND Ground Power ground
8 CAM_C_N Output MIPI clock negative output
9 CAM_C_P Output MIPI clock positive output
10 DGND Ground Power ground
11 POWER_EN Input Camera module power enable active high
12 LED_EN Input Enable LED
13 SCL Input Two-Wire Serial Interface Clock
14 SDA Bi-directional Two-Wire Serial Interface Data I/O
15 +3.3V POWER 3.3v Power supply
Table 2 MIPI Camera Output to Raspberry Pi CSI Port
Pin No. PIN NAME TYPE DESCRIPTION
1 DGND Ground Power ground
2 CAM_D0_N Output MIPI data lane0 negative output
3 CAM_D0_P Output MIPI data lane0 positive output
4 DGND Ground Power ground
5 CAM_D1_N Output MIPI data lane1 negative output
6 CAM_D1_P Output MIPI data lane1 positive output
7 DGND Ground Power ground
8 CAM_C_N Output MIPI clock negative output
9 CAM_C_P Output MIPI clock positive output
10 DGND Ground Power ground
11 POWER_EN Input Camera module power enable active high
12 LED_EN Input Enable LED
13 SCL Input Two-Wire Serial Interface Clock
14 SDA Bi-directional Two-Wire Serial Interface Data I/O
15 +3.3V POWER 3.3v Power supply
Table 3 2×3 Pin Header Port to Raspberry Pi
Pin No. PIN NAME TYPE DESCRIPTION
1 3V3 Power 3.3V power from Raspberry Pi
2 5V Power 5V power from Raspberry Pi
3 SDA INOUT SDA pin from Raspberry Pi
4 5V Power 5V power from Raspberry Pi
5 SCL INOUT SCL pin from Raspberry Pi
6 GND Ground Power Ground

7. ArduChip Registers

ArduChip is the Arducam proprietary solution to control all the hardware internal logic to do the image capture and merge timing controls. There are set of register which allow users to switch to different mode according to their application. The stereo camera HAT acts like a standard I2C slave device, its registers are accessed from the Raspberry Pi Camera CSI port with I2C-0 bus and default 7-bit I2C slave address is 0x24.

Table 4 Stereo Camera HAT Register Table
Register
Address
Register
Type
Description default
0x24 read-write bit[7:0],display mode
0x00: half resolution combine
0x01: Single channel A
0x02: Single channel B
0x03: full resolution combine
0x10: half resolution combine (Digital pan mode)
0x00
0x25 read-write bit[7:0],Digital pan speed control in half resolution combine mode
Value range: 0x01~0x60
0x10

8 Mechanical Dimension

Figure 12 Mechanical Drawing

Was this article helpful to you? Yes 1 No