Multi Camera Adapter Module for Raspberry Pi

Featured

Introduction

Raspberry Pi multi camera adapter module is designed for connecting more than one camera to a single CSI camera port on Raspberry Pi board. One adapter board can connect 4 cameras and user can stack up maxim 4 adapter boards that means up to 16 cameras on a single Raspberry Pi board. Continue reading “Multi Camera Adapter Module for Raspberry Pi” »

ArduCAM Mini Released

Featured


ArduCAM Mini is optimized version of ArduCAM shield Rev.C, and is a high definition SPI camera, which reduce the complexity of the camera control interface. It integrates 2MP or 5MP CMOS image sensor OV2640/OV5642, and provides miniature size, as well as the easy to use hardware interface and open source code library. The ArduCAM mini can be used in any platforms like Arduino, Raspberry Pi, Maple, Chipkit, Beaglebone black, as long as they have SPI and I2C interface and can be well mated with standard Arduino boards. ArduCAM mini not only offers the capability to add a camera interface which doesn’t have in some low cost microcontrollers, but also provides the capability to add multiple cameras to a single microcontroller.

Features

  • 2MP or 5MP image sensor OV2640 / OV5642
  • M12 mount or CS mount lens holder with changeable lens options
  • IR sensitive with proper lens combination
  • I2C interface for the sensor configuration
  • SPI interface for camera commands and data stream
  • All IO ports are 5V/3.3V tolerant
  • Support JPEG compression mode, single and multiple shoot mode, one time capture multiple read operation, burst read operation, low power mode and etc.
  • 3~10fps video output at low resolution
  • Well mated with standard Arduino boards
  • Provide open source code library for Arduino, STM32, Chipkit, Raspberry Pi, BeagleBone Black
  • Small form of factor

Key Specification

Key Specification 2MP 5MP
Image Sensor OV2640 OV5642
Active array size 1600×1200 2592×1944
Shutter rolling shutter rolling shutter
Lens 1/4 inch 1/4 inch
SPI speed 8MHz 8MHz
Frame buffer Size 384KB 512KB
Board Size 34 x 24 mm 34 x 24 mm
Weight 20g 25g
Temperature -10℃~+55℃ -10℃~+55℃
Power Consumption Normal :5V/70mALow power mode: 5V/20mA Normal :5V/390mALow power mode: 5V/20mA

Pin Definition

Table 1 ArduCAM Mini Pin Definition

Pin No. PIN NAME TYPE DESCRIPTION
1 CS Input SPI slave chip select input
2 MOSI Input SPI master output slave input
3 MISO Output SPI master input slave output
4 SCLK Input SPI serial clock
5 GND Ground Power ground
6 +5V POWER 5V Power supply
7 SDA Bi-directional Two-Wire Serial Interface Data I/O
8 SCL Input Two-Wire Serial Interface Clock

Block Diagram

Figure 2 shows the block diagram of ArduCAM mini shield which is composed by lens, image sensor and an ArduChip. The lens is changeable and can be mounted by S-mount (M12x0.5) or CS-mount lens holder. The ArduChip uses ArduCAM proprietary third generation camera controller technology which handles the complex camera, memory and user interface hardware timing and provides a user friendly SPI interface.

ArduCAM_mini-6

 

 

 

 

 

Functions

  • Single Capture Mode

Single capture mode is the default capture mode of the camera. After issuing a capture command via SPI port, the ArduCAM will wait for a new frame and buffer the one entire image data to the frame buffer, and then assert the completion flag bit in the register. User only needs to poll the flag bit from the register to check out if the capture is done.

  • Multiple Capture Mode

Multiple capture mode is advanced capture mode. By setting the number of frames in the capture register, the ArduCAM will capture consequent frames after issuing capture command. Note that number of frames should be set properly and make sure do not exceed the maximum memory space.

  • JPEG Compression

The JPEG compression function is implemented in the image sensor. With proper register settings to the sensor, user can get different resolution with JPEG image stream output. It is recommended to use JPEG output to get higher resolution than RGB mode, due to the limitation of frame buffer.

  • Normal Read and Burst Read Operation

Normal read operation reads each image data by sending a read command in one SPI read operation cycle. While burst read operation only need to send a read command then read multiple image data in one SPI read operation cycle. It is recommended to use burst read operation to get better throughput performance.

  • Rewind Read Operation

Sometimes user wants to read the same frame of image data multiple times for processing, the rewind read operation is designed for this purpose. By resetting the read pointer to the beginning of the image data, user can read the same image data from the start point again.

  • Low Power Mode

Some battery power device need save power when in the idle status, the ArduCAM offers the low power mode to reduce power consumption, by shutdown the sensor and memory circuits.

  • Image Sensor Control

Image sensor control function is implemented in the image sensor. By setting proper set of register settings, user can control the exposure, white balance, brightness, contrast, color saturation and etc.

Use Guide and Reference Manual

ArduCAM_Mini_2MP_Camera_Shield_DS

ArduCAM_Mini_2MP_Camera_Shield_Hardware_Application_Note

ArduCAM_Mini_5MP_Camera_Shield_DS

ArduCAM_Mini_5MP_Camera_Shield_Hardware_Application_Note

ArduCAM_Camera_Shield_Software_Application_Note

Video Demonstration

ArduCAM Now Support Rasbperry Beaglebone Black STM32 and More

Featured

ArduCAM team now are working on different famous open hardware platform, and successfully port the ArduCAM library to Raspberry Pi, Beaglebone Black and STM32 boards. Also we moved our library to github for better maintenance.

New Low Cost OV5647 Mini Camera Module for Raspberry Pi Now Available

Featured

  • Introduction

In order to meet the increasing need of Raspberry Pi compatible camera modules. The ArduCAM team now released ultra low cost add-on mini camera module for Raspberry Pi series boards which is fully compatible with official one. Continue reading “New Low Cost OV5647 Mini Camera Module for Raspberry Pi Now Available” »

New Spy Camera for Raspberry Pi

Featured

  • Introduction

In order to meet the increasing need of Raspberry Pi compatible camera modules. The ArduCAM team now released another add-on spy camera module for Raspberry Pi series boards which is fully compatible with official one.

The board itself is tiny, at around 300mm x 16mm. The neck width of the camera module is 6mm, this highlight making it perfect for endoscope, spy surveillance or other applications where size and image quality are important. Continue reading “New Spy Camera for Raspberry Pi” »

Rev.C OV5647 Camera for Raspberry Pi Improves the Optical Performance

Featured

  • Introduction

In order to meet the increasing need of Raspberry Pi compatible camera modules. The ArduCAM team now released a revision C add-on camera module for Raspberry Pi which is fully compatible with official one. It optimizes the optical performance than the previous Pi cameras, and give user a much clear and sharp image. Also it provides the FREX and STROBE signals which can be used for multi-camera synchronize capture with proper camera driver firmware. Continue reading “Rev.C OV5647 Camera for Raspberry Pi Improves the Optical Performance” »

How to use ArduCAM shield on Arduino Yun

Featured

In this demonstration we introduce how to use ArduCAM shield on Arduino Yun board. And view captured photos remotely via WIFI connection.

To complete this demonstration, you need the following items:

  • Arduino Yun board
  • ArduCAM Rev.C shield
  • OV2640 camera module
  • A Micro SD/TF card
  • Long pin single row female socket

Also you need the following software packages:

  • ArduCAM library
  • Arduino IDE 1.5.8 BETA
  • SmarTTY

Yun_demo-1

 

 

 

 

 

 

 

Continue reading “How to use ArduCAM shield on Arduino Yun” »

ArduCAM host application demonstration

Featured

This post introduces how to use ArduCAM host application to take high resolution time elapse image with ArduCAM shield. We need the following items to complete this demonstration:

  • Arduino UNO board
  • ArduCAM-F or ArduCAM-LF shield
  • OV5642 camera module with fisheye lens
  • Arduino example sketch ArduCAM_SPI_OV5642_FIFO_UART.ino
  • ArduCAM host application

ArduCAM host application is an Windows application which runs in your Windows computer. It is written in Microsoft C# .NET, precompiled execute program can be download from here, source project files can be download from here. Please note that it requires Microsoft .NET Framework 3.5 version to run.

The example sketch ArduCAM_SPI_OV5642_FIFO_UART.ino receives commands from ArduCAM host application then send back image data when capture is done. The ArduCAM host side save the received image binary data into a JPEG file.

With basic knowledge about example and ArduCAM host application, now let’s connect ArduCAM shield to UNO board, attach the OV5642 camera module, then downloading the example sketch ArduCAM_SPI_OV5642_FIFO_UART.ino . ArduCAM_Host_ug ArduCAM_Host

 

 

 

 

 

 

Continue reading “ArduCAM host application demonstration” »

RaspCAM A Raspberry Pi Based Camera

Featured

Recently ArduCAM team designed a simple-point-and-shoot digital camera for Raspberry Pi B+ board, it integrates both LCD touch screen and 5MP Raspberry Pi camera board into a single shield. It is well mated with Raspberry Pi B+ board, combined the WIFI dongle user can optionally transfer the captured photos to anywhere else. The RaspCAM features changeable lens options, user can replace the lens with fisheye or telescope lens according to their applications.

Feature

  • Well mate with Raspberry Pi B+ board
  • 2.8/ 3.2 inch TFT LCD with touch screen
  • 5MP CMOS camera module
  • M12x0.5 or CS mount lens and lens holder
  • Support kinds of lens options
  • Opensource Raspberry Camera software

Continue reading “RaspCAM A Raspberry Pi Based Camera” »

ArduCAM Shield Rev.C Now Released

Featured

With the great success of ArduCAM shield Rev.B, we received hundreds of comments and feedbacks from ArduCAM users. The ArduCAM team now released a more powerful ArduCAM shield Rev.C with past few months’ hard work. The new features list as follows:

  • Support camera modules: OV7660 OV7670 OV7675 OV7725 OV2640 OV3640 OV5642 MT9D111
  • Incorporating standard SPI slave interface
  • Reduced IOs consumption, only 4 IOs for SPI, 2 IOs for I2C and 1 IO for SD are required
  • All IOs are 5V and 3.3V tolerant
  • Support all Arduino families including Arduino DUE
  • Can be easily ported to any platforms which have SPI port like Raspberry Pi, BeagleBoard, BeagleBone, pcDuino and etc
  • Support 1080p still JPEG image capture
  • Provide low power mode, reduce power consumption and prolong battery life
  • Well mate with Arudino UNO R3, MEGA2560 R3, Leonardo R3 and DUE boards

SPI interface which is widely used in most micro-controllers and peripherals sensors. SPI is a synchronous serial data protocol used by microcontrollers for communicating with one or more peripheral devices quickly over short distances. With the advantage of SPI bus, the ArduCAM shield Rev.C reduced the IO consumption, achieve higher bus speed than the Rev.B. By using Arduino standard SPI and I2C pin out, the Rev.C can well mate with Arduino mainstream boards like UNO R3, Mega2560 R3 and DUE etc. A brief comparison between Rev.C and Rev.B :

Feature Rev.C Rev.B
IO consumption 7 19
Bus speed 8Mbps < 1MB/s
Low power mode Support Not support
Dedicate SPI/I2C interface Yes No

ArduCAM shield Rev.C not only work with Arduino boards, it now can be ported to any platform easily because it use standard SPI bus. We now are busy with Raspberry Pi and helix_4 porting. The helix_4 FPGA module is an efficient, low cost Altera FPGA System on Module designed to give design teams the best possible FPGA development experience, for more information please visit thin-layer-embedded.com. ArduCAM shield Rev.C also provide low power feature for battery powered device. When it is in idle, user can shut down the LCD back light OFF and disable FIFO and etc to reduce power consumption, and prolong battery.

RGB565 Format and Issues

The image sensors supports kinds of output formats like Raw RGB Bayer, YUV, JPEG, RGB565, RGB555, RGB444 and etc. In preview mode RGB output is preferred and it can be changed to other format when capture mode. In ArduCAM shield the LCD screen only support RGB565 data format, so when we do preview on the screen, we have to configure the sensors to RGB565 output format. Then the ArduCAM shield will display the image directly from the sensor to LCD screen without intervention of the Arduino board.

In this case the pixel data from the image sensors is ordered as RGB565 format, which means one pixel is composed by two consecutive bytes, the first byte is R[4:0]G[5:3] and the second byte is G[2:0]B[4:0]. The following picture show the RGB565 output timing and data ordering.

RGB565_timing

If the two bytes are disordered when saving to file, the color will be wrong. The same shoot but with different byte order the saved image will be different.

normal_image

 

 

 

disorder_image

 

 

 

 

 

 

 

 

 

Sometimes we don’t know the order of the consecutive bytes at the beginning of the horizon signal HREF(Line_valid). To work around this issue ArduCAM example sketches try to read the first dummy byte from the FIFO to adjust the byte order before saving to a file.

  //Write the BMP header
  for( i = 0; i < BMPIMAGEOFFSET; i++)
  {
    char ch = pgm_read_byte(&bmp_header[i]);
    buf[k++] = ch;
  }
  outFile.write(buf,k);
  //Read first dummy byte
  //myCAM.read_fifo();

  k = 0;
  //Read 320x240x2 byte from FIFO
  //Save as RGB565 bmp format
  for(i = 0; i < 240; i++)
    for(j = 0; j < 320; j++)
  {
      VH = myCAM.read_fifo();
      VL = myCAM.read_fifo();
      buf[k++] = VL;
      buf[k++] = VH;
      //Write image data to bufer if not full
      if(k >= 256)
      {
        //Write 256 bytes image data to file from buffer
        outFile.write(buf,256);
        k = 0;
      }
  }

 

How to use ArduCAM with Arduino DUE board

User frequently reported that the ArduCAM shield doesn’t work with DUE board, and it is now a known issue.

We figured out that in the Due board the default SD library speed is much faster than ArduCAM shield. The current ArduCAM shield SPI timing only supports less than 10Mbps.  So if you want to work ArduCAM and DUE board together, the SPI should be configured with the lower speed.

To work around this issue, you have to modify the SD library below.
1. Please add the last line to \libraries\SD\utility\Sd2Card.h like follows.
/** Set SCK to max rate of F_CPU/2. See Sd2Card::setSckRate(). */
uint8_t const SPI_FULL_SPEED = 0;
/** Set SCK rate to F_CPU/4. See Sd2Card::setSckRate(). */
uint8_t const SPI_HALF_SPEED = 1;
/** Set SCK rate to F_CPU/8. Sd2Card::setSckRate(). */
uint8_t const SPI_QUARTER_SPEED = 2;
uint8_t const SPI_ARDUCAM_SPEED = 3;

 

2. Please change the SDClass::begin() function in the \libraries\SD\SD.cpp file like follows:
boolean SDClass::begin(uint8_t csPin) {
/*
 
Performs the initialisation required by the sdfatlib library.
 
Return true if initialization succeeds, false otherwise.
 
*/
//return card.init( SPI_FULL_SPEED, csPin) &&
//return card.init(SPI_HALF_SPEED, csPin) &&
//return card.init(SPI_QUARTER_SPEED, csPin) &&
return card.init(SPI_ARDUCAM_SPEED, csPin) &&
volume.init(card) &&
root.openRoot(volume);
}