Arducam Mini OV5642

Hi everyone,

I'm trying to use an Arducam mini board/OV5642 camera to take some photos on a high-altitude balloon. All that I can get from it is gabrage characters back to the serial monitor. There's no SD card slot on the mini shield, and precious little documentation. I've run the example scripts, but am not really getting anything from it.

Does anyone have any tips on getting this going (or alternative, well-supported devices that I could use to take stills/videos and store to an SD card?)?

Product page: www.uctronics.com/mini-arducam-module-camera-shield-w-5-mp-ov5642-for-arduino-uno-mega2560-board.html

Thanks for the help!
jg

forget the serial monitor. The picture is stored to the onboard RAM.
You have to add a SD-card to store photos. (its NOT fast)
I've seen complete 'spy-cams' at less cost and trouble than this

The problem is that there's no SD card port - no idea what the process is to store the images on an SD card (assuming that OpenLog or something like that would work). It does seem like there'd be an easier Arduino camera at this stage in the game.

At high altitude - no radio comm. fast enough to be practical.
Ull need something like: http://www.ebay.com/itm/161366316226?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
.. and a micro SD card
Its possible to store an image 'now and then' .. no video.
.........
as camera i almoste the same.. This may be relevant: http://www.elecfreaks.com/projects/how-to-use-ov7670-camera-module-with-arduino/

knut_ny:
as camera i almoste the same.. This may be relevant: http://www.elecfreaks.com/projects/how-to-use-ov7670-camera-module-with-arduino/

The example linked has a flaw because it use a Serial Camera and not the one linked that's a module that has no serial output.

I have the camera functioning now (yay!), but I'm still in search of the hardware and software setup to send the image to an SD card (OpenLog, etc.). I know how to output serial data to the openlog, where it saves it automatically as a .txt file, but I don't know how to set it up to save the images. I guess that the hardware setup actually isn't an issue: just need 3.3 V, GND, and one digital output pin to the logger.

More SD card questions: most of the other SD card shields/breakouts I've seen use the SPI bus, but the ArduCam does as well. Can it be used for two things?

jg

There is a separate pin to select a device. SD use usually pin 10, don't know Arducam but will be another pin.

Hi,

I've had similar problems with the Arducam Mini OV2640 -- I've got it to save files to an SD card using a mishmatch of codes from all over the webs, but the files it saves are junk data. Any tips as to how you got yours giving proper image data?

As far as I understand the SPI, MOSI and MISO (which is not very far, I have to warn you), they're basically communications channels, so lots of things can use them at once, then to talk to a particular thing you use the specific CS (chip select) line. The ArduCam mini hardware application notes (from the arducam website) show four cameras piggybacking off the same SPI, MOSI and MISO channels, and I've set up my SD card (and TFT) to use the same pins for these channels as the arducam.

So, once you have a microSD card reader, the trick is to generate filenames and save the data. The code I'm using is posted below, the filename structuring comes from the Adafruit Serial Camera Library.

//most promising, i think. saves nonsense data, though.

//http://forum.arduino.cc/index.php?topic=285778.0
// inspired by http://sauerwine.blogspot.fr/2013/07/an-arduino-time-lapse-camera-using.html
// and http://www.arducam.com/how-arducam-use-a-external-trigger-from-a-sensor/

#include <UTFT_SPI.h>
#include <SD.h>
#include <Wire.h>
#include <ArduCAM.h>
#include <SPI.h>
#include "memorysaver.h"
#include <avr/pgmspace.h>
#include <ov2640_regs.h>

#define BMPIMAGEOFFSET 54
#define SD_CS 9 
const int CS1 = 10;

// Constants that define the format of the picture taken
const int bmp_mode = 0;
const int mode = bmp_mode;

const char bmp_header[54] PROGMEM =
{
      0x42, 0x4D, 0x36, 0x58, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,
      0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// Instanciation of the class ArduCAM
ArduCAM myCAM1(OV2640, CS1);
static int k = 0;

// Used in takePicture() to transfer the buffer of the ArduCAM into a BMP file
// inspired by http://sauerwine.blogspot.fr/2013/07/an-arduino-time-lapse-camera-using.html
void writeBMP(File outFile){
  
  char VH, VL;
  uint8_t temp,temp_last;
  int i, j, posn, nextNum;
  
    //Write the BMP header
  for( i = 0; i < 54; i++)
  {
    char ch = pgm_read_byte(&bmp_header[i]);
    outFile.write((uint8_t*)&ch,1);
  }

  //Read the first dummy byte from FIFO
  temp = myCAM1.read_fifo();
  //Read 320x240x2 byte from FIFO
  for(i = 0; i < 240; i++)
    for(j = 0; j < 320; j++)
    {
      VH = myCAM1.read_fifo();
      VL = myCAM1.read_fifo();
      //RGB565 to RGB555 Conversion
      if (false) {
        VL = (VH << 7) | ((VL & 0xC0) >> 1) | (VL & 0x1f);
        VH = VH >> 1;
      }
      //Write image data to file
      outFile.write(VL);
      outFile.write(VH);
  }
}

// IMAGE FILE GENERATION
// generates a name and returns the opened file
File imageFile(){
	// generates the filename
 char filename[13];
File outFile;

  strcpy(filename, "IMAGE00.BMP");
  for (int i = 0; i < 100; i++) {
    filename[5] = '0' + i/10;
    filename[6] = '0' + i%10;
    // create if does not exist, do not open existing, write, sync after write
    if (! SD.exists(filename)) {
      break;
    }}
   Serial.println(filename); 
   
	// opens the file
	outFile = SD.open(filename,O_WRITE | O_CREAT | O_TRUNC);
	if (! outFile){ 
	Serial.println("open file failed");
	} else {
	Serial.println("File opened sucessfully");
	}

	return outFile;
}

// ========= TAKE PICTURE ========
// simple to use function, which takes a picture
// either in JPEG (bugged) or BMP format in function 
// of the 'mode' constant

void takePicture(){
  Serial.println("Taking picture...");
  File outFile;

  uint8_t start_capture = 0;
  
  myCAM1.write_reg(ARDUCHIP_MODE, 0x00);
  
  // Initialisation
  // Warning : if you use set_format(JPEG) before Init, it will freeze
  myCAM1.set_format(BMP);
  Serial.print("Init ? ");
  myCAM1.InitCAM();
  Serial.println("OK");
  
  
  myCAM1.flush_fifo(); // clean ArduCAM buffer
  myCAM1.clear_fifo_flag(); // start capture
  myCAM1.start_capture();
  Serial.print("Waiting for capture..."); //waiting until capture is done
  while (!(myCAM1.read_reg(ARDUCHIP_TRIG) & CAP_DONE_MASK)) {
   delay(10); 
  }
  Serial.println("OK");
  
  // open a file onto the SD card
  outFile = imageFile();
    
    // writes the content of the ArduCAM buffer into the file, with the right
    // function, defined by the 'mode' value
    Serial.print("Buffering...");
    writeBMP(outFile);
    Serial.println("OK");
    
    // close the file and clean the flags and the buffers
    outFile.close(); 
    Serial.println("Capture finished");
    myCAM1.clear_fifo_flag();
    start_capture = 0;
    myCAM1.InitCAM();
}

// Function that waits for n seconds, writing a countdown on the Serial console
void countdown(int n = 10){
 while (n>0){
    Serial.print(n);
    Serial.println("... ");
    n=n-1;
    delay(1000);
  }
}

// ======== SETUP ========

void setup(){
  uint8_t vid,pid;
  uint8_t temp; 
  #if defined (__AVR__)
    Wire.begin(); 
  #endif
  #if defined(__arm__)
    Wire1.begin(); 
  #endif
  // begins the Serial communication
  Serial.begin(115200);
  Serial.println("ArduCAM Start!");
  pinMode(CS1, OUTPUT);
  SPI.begin();
 
  myCAM1.write_reg(ARDUCHIP_TEST1, 0x55);
  temp = myCAM1.read_reg(ARDUCHIP_TEST1);
  if(temp != 0x55)
  {
  	Serial.println("SPI interface Error!");
  	while(1);
  } 
  else {
  Serial.println("SPI All Good");
  }  
  
  // change MCU mode (?)
  myCAM1.write_reg(ARDUCHIP_MODE, 0x00);
  myCAM1.InitCAM();
  
  // SD card initialisation
  if (!SD.begin(SD_CS)) 
  {
    while (1);		//If failed, stop here
    Serial.println("SD Card Error");
  }
  else
 {   Serial.println("SD Card detected!");
}}



void loop(){
		takePicture();
		delay(20000);
	
}

Hi,

I just dumped good money buying 3 of the OV5642 at $39.95 each from UCTRONICS. They shipped only version B devices.

In short, I'm not able to get anything to work on my MEGA2560.

Reading this forum. It looks like I'm not alone.

Has any one gotten the OV5642 to work? Either version B or C? On any Arduino with a SD card?

Thanks

I don't have any Arducam but maybe the SD problem is related to the pin to select the device. Since the SPI bus is shared among devices you have to pull up only one line, the other must be down. So, I believe that is difficult to read and write to SD at the same time. Maybe you must read the image in little chuncks that will be in Arduino RAM. You read a chunk, switch select line, then write to sd, then repeat. But I don't know if it works.
I don't know if sample code do it better.

Thanks Zoomx,

I have the ArduCam program for running the camera and the SD card.

I'm not an expert but it looks like they are doing exactly as you suggested.

One of the problems I see is that most of their programs require a OV5642 Rev C, while I have a Rev B.

I have written the supplier (UCTRONICS) asking how to order the Rev C shield. No response yet.

I have posted a note under 'Gigs" for hiring someone to help on this project.

Do you know the arducam.com site?
Rev B is here
http://www.arducam.com/tag/arducam-shield-2/
and Rev C here
ArduCAM Mini Released - Arducam
Here the downloads
http://www.arducam.com/download/
V 2.0.0 is for shield Rev B but the example that store a jpeg in SD is for OV2640. I believe that you have to change it for OV5642.
Good luck!

Hi Guys,
for my litte weather station project i'm using two Arducam with mini shield and a cc3000 wifi SD shield to store images to my SD card.
It works fine for me, just two things to look for.
As in the standard sketches form Arducam CS is on pin 10, however the WifiShield uses that, too, so use another one.

I use pin 15 & 17 as they are coms receiving.

So here is my code..be warned I'm a hobby coder... won't win a nice price, but works :wink:

#include <SD.h>
#include <Wire.h>
#include <ArduCAM.h>
#include <SPI.h>
#include "memorysaver.h"


#define SD_CS 4   //SD Card initialisation
const int CS1 = 15;
const int CS2 = 17;

// Instanciation of the class ArduCAM
ArduCAM myCAM1(OV5642, CS1);
ArduCAM myCAM2(OV5642, CS2);
static int k = 0;

// ========= TAKE PICTURE camera 1 ========

void takePicture1(){
  uint8_t start_capture = 0;
  uint8_t temp,temp_last;
  Serial.println("Taking picture cam 1...");
  myCAM1.clear_bit(ARDUCHIP_GPIO, GPIO_POWER_MASK);
  myCAM1.write_reg(ARDUCHIP_MODE, 0x00);
  File outFile;
  
  // Initialisation
  //Change to JPEG capture mode and initialize the OV5642 module  
  myCAM1.set_format(JPEG);
   Serial.print("Init ? ");
  myCAM1.InitCAM();
  Serial.println("OK");
 
  myCAM1.write_reg(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);    //VSYNC is active HIGH //Change to JPEG capture mode and initialize the OV5642 module  
  myCAM1.write_reg(ARDUCHIP_FRAMES,0x00);
  myCAM1.flush_fifo(); // clean ArduCAM buffer
  myCAM1.OV5642_set_JPEG_size(OV5642_2592x1944); 
   
  myCAM1.clear_fifo_flag(); // start capture
  myCAM1.start_capture();
  Serial.print("Waiting for capture cam 1..."); //waiting until capture is done
  while (!(myCAM1.read_reg(ARDUCHIP_TRIG) & CAP_DONE_MASK)) {
   delay(10);
  }
  Serial.println("OK");

 
  // open a file onto the SD card
      outFile = SD.open("Cam1.jpg",O_WRITE | O_CREAT | O_TRUNC); //(O_WRITE | O_CREAT | O_TRUNC) will open the file for write, creating it if it doesn't exist, and truncating it's length to 0 if it does
      if (! outFile){
        Serial.println("open file failed");
      } else {
        Serial.println("File opened sucessfully");
        }

     
    // writes the content of the ArduCAM buffer into the file, with the right
    // function, defined by the 'mode' value
 
    Serial.print("Buffering...");
    while( (temp != 0xD9) | (temp_last != 0xFF) )
     { 
      temp_last = temp;
      temp = myCAM1.read_fifo();
      //Write image data to file
      outFile.write(temp);
     }
    Serial.println("OK");
   
    // close the file and clean the flags and the buffers
    outFile.close();
    Serial.println("Capture finished");
    myCAM1.clear_fifo_flag();
    start_capture = 0;
    myCAM1.flush_fifo();
    myCAM1.set_bit(ARDUCHIP_GPIO, GPIO_POWER_MASK);//enable low power
    //myCAM1.InitCAM();
}

// ========= TAKE PICTURE camera 2 ========

void takePicture2(){
  uint8_t start_capture = 0;
  uint8_t temp,temp_last;
  File outFile;
  Serial.println("Taking picture cam 2...");
  myCAM2.clear_bit(ARDUCHIP_GPIO, GPIO_POWER_MASK);
  myCAM2.write_reg(ARDUCHIP_MODE, 0x00);
 
  // Initialisation
  //Change to JPEG capture mode and initialize the OV5642 module  
  myCAM2.set_format(JPEG);
   Serial.print("Init ? ");
  myCAM2.InitCAM();
  Serial.println("OK");
 
  //myCAM2.write_reg(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);    //VSYNC is active HIGH //Change to JPEG capture mode and initialize the OV5642 module  
  myCAM2.write_reg(ARDUCHIP_FRAMES,0x00);
  myCAM2.flush_fifo(); // clean ArduCAM buffer
  myCAM2.OV5642_set_JPEG_size(OV5642_2592x1944); 
  myCAM2.clear_fifo_flag(); // start capture
  myCAM2.start_capture();
  Serial.print("Waiting for capture cam 2..."); //waiting until capture is done
  while (!(myCAM2.read_reg(ARDUCHIP_TRIG) & CAP_DONE_MASK)) {
   delay(10);
  }
  Serial.println("OK");

 
  // open a file onto the SD card
      outFile = SD.open("Cam2.jpg",O_WRITE | O_CREAT | O_TRUNC);
      if (! outFile){
      Serial.println("open file failed");
      } else {
      Serial.println("File opened sucessfully");
      }

      
    // writes the content of the ArduCAM buffer into the file, with the right
    // function, defined by the 'mode' value

    Serial.print("Buffering...");
    while( (temp != 0xD9) | (temp_last != 0xFF) )
     { 
      temp_last = temp;
      temp = myCAM2.read_fifo();
      //Write image data to file
      outFile.write(temp);
     }
    Serial.println("OK");
   
    // close the file and clean the flags and the buffers
    outFile.close();
    Serial.println("Capture finished");
    myCAM2.clear_fifo_flag();
    start_capture = 0;
    myCAM2.flush_fifo();
    myCAM2.set_bit(ARDUCHIP_GPIO, GPIO_POWER_MASK);//enable low power
    //myCAM2.InitCAM();
}


// ======== SETUP ========

void setup(){
  uint8_t vid,pid;
  uint8_t temp;
  #if defined (__AVR__)
    Wire.begin();
  #endif
  #if defined(__arm__)
    Wire1.begin();
  #endif
  // begins the Serial communication
  Serial.begin(115200);
  Serial.println("ArduCAM Start!");

  pinMode(CS1, OUTPUT);
  //pinMode(CS2, OUTPUT);
  SPI.begin();
 
  myCAM1.write_reg(ARDUCHIP_TEST1, 0x55);
  temp = myCAM1.read_reg(ARDUCHIP_TEST1);
  if(temp != 0x55)
  {
    Serial.println("SPI interface Error on Camera 1!");
    //while(1);
  }
  else {
  Serial.println("SPI All Good for Camera 1");
  myCAM1.set_bit(ARDUCHIP_GPIO, GPIO_POWER_MASK);//enable low power
  } 
  
 myCAM2.write_reg(ARDUCHIP_TEST1, 0x55);
 temp = myCAM2.read_reg(ARDUCHIP_TEST1);
 if(temp != 0x55)
 {
    Serial.println("SPI interface Error on Camera 2!");
    //while(1);
  }
  else {
  Serial.println("SPI All Good for Camera 2");
  myCAM2.set_bit(ARDUCHIP_GPIO, GPIO_POWER_MASK);//enable low power
  } 
  
   // SD card initialisation
  if (!SD.begin(SD_CS))
  {
    while (1);    //If failed, stop here
    Serial.println("SD Card Error");
  }
  else
 {   Serial.println("SD Card detected!");
 }

}
// ====== Main Loop ======


void loop(){
    takePicture1();
    takePicture2();
    Serial.println("waiting...");
    delay(12000);
    Serial.println("done...");
  
}

Hello everyone!
i am newbie to this arduino environment!
Recently i purchased Arducam 5 mp mini i connected the arducam with arduino mega 2560 board and i tried to capture some photos and saw those photos via serial monitor.
i choose continuous shoot mode and captured several photos at the full resolution at a time, but there was a lag between each frames displayed.
Is that the processing issue with the mega board, if thats the issue then can i try it with arduino due?
Since all the GPIO pins of the due can't take more 3.3v will there be a problem if i connect it with the due board!
(Note: i purchased only the Arducam module i didnt purchase any rev c or rev b module )!
Thanks !!

AndreasGabler:
Hi Guys,
for my litte weather station project i'm using two Arducam with mini shield and a cc3000 wifi SD shield to store images to my SD card.
It works fine for me, just two things to look for.
As in the standard sketches form Arducam CS is on pin 10, however the WifiShield uses that, too, so use another one.

I use pin 15 & 17 as they are coms receiving.

So here is my code..be warned I'm a hobby coder... won't win a nice price, but works :wink:

#include <SD.h>

#include <Wire.h>
#include <ArduCAM.h>
#include <SPI.h>
#include "memorysaver.h"

#define SD_CS 4  //SD Card initialisation
const int CS1 = 15;
const int CS2 = 17;

// Instanciation of the class ArduCAM
ArduCAM myCAM1(OV5642, CS1);
ArduCAM myCAM2(OV5642, CS2);
static int k = 0;

// ========= TAKE PICTURE camera 1 ========

void takePicture1(){
  uint8_t start_capture = 0;
  uint8_t temp,temp_last;
  Serial.println("Taking picture cam 1...");
  myCAM1.clear_bit(ARDUCHIP_GPIO, GPIO_POWER_MASK);
  myCAM1.write_reg(ARDUCHIP_MODE, 0x00);
  File outFile;
 
  // Initialisation
  //Change to JPEG capture mode and initialize the OV5642 module 
  myCAM1.set_format(JPEG);
  Serial.print("Init ? ");
  myCAM1.InitCAM();
  Serial.println("OK");

myCAM1.write_reg(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);    //VSYNC is active HIGH //Change to JPEG capture mode and initialize the OV5642 module 
  myCAM1.write_reg(ARDUCHIP_FRAMES,0x00);
  myCAM1.flush_fifo(); // clean ArduCAM buffer
  myCAM1.OV5642_set_JPEG_size(OV5642_2592x1944);
 
  myCAM1.clear_fifo_flag(); // start capture
  myCAM1.start_capture();
  Serial.print("Waiting for capture cam 1..."); //waiting until capture is done
  while (!(myCAM1.read_reg(ARDUCHIP_TRIG) & CAP_DONE_MASK)) {
  delay(10);
  }
  Serial.println("OK");

// open a file onto the SD card
      outFile = SD.open("Cam1.jpg",O_WRITE | O_CREAT | O_TRUNC); //(O_WRITE | O_CREAT | O_TRUNC) will open the file for write, creating it if it doesn't exist, and truncating it's length to 0 if it does
      if (! outFile){
        Serial.println("open file failed");
      } else {
        Serial.println("File opened sucessfully");
        }

// writes the content of the ArduCAM buffer into the file, with the right
    // function, defined by the 'mode' value

Serial.print("Buffering...");
    while( (temp != 0xD9) | (temp_last != 0xFF) )
    {
      temp_last = temp;
      temp = myCAM1.read_fifo();
      //Write image data to file
      outFile.write(temp);
    }
    Serial.println("OK");
 
    // close the file and clean the flags and the buffers
    outFile.close();
    Serial.println("Capture finished");
    myCAM1.clear_fifo_flag();
    start_capture = 0;
    myCAM1.flush_fifo();
    myCAM1.set_bit(ARDUCHIP_GPIO, GPIO_POWER_MASK);//enable low power
    //myCAM1.InitCAM();
}

// ========= TAKE PICTURE camera 2 ========

void takePicture2(){
  uint8_t start_capture = 0;
  uint8_t temp,temp_last;
  File outFile;
  Serial.println("Taking picture cam 2...");
  myCAM2.clear_bit(ARDUCHIP_GPIO, GPIO_POWER_MASK);
  myCAM2.write_reg(ARDUCHIP_MODE, 0x00);

// Initialisation
  //Change to JPEG capture mode and initialize the OV5642 module 
  myCAM2.set_format(JPEG);
  Serial.print("Init ? ");
  myCAM2.InitCAM();
  Serial.println("OK");

//myCAM2.write_reg(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);    //VSYNC is active HIGH //Change to JPEG capture mode and initialize the OV5642 module 
  myCAM2.write_reg(ARDUCHIP_FRAMES,0x00);
  myCAM2.flush_fifo(); // clean ArduCAM buffer
  myCAM2.OV5642_set_JPEG_size(OV5642_2592x1944);
  myCAM2.clear_fifo_flag(); // start capture
  myCAM2.start_capture();
  Serial.print("Waiting for capture cam 2..."); //waiting until capture is done
  while (!(myCAM2.read_reg(ARDUCHIP_TRIG) & CAP_DONE_MASK)) {
  delay(10);
  }
  Serial.println("OK");

// open a file onto the SD card
      outFile = SD.open("Cam2.jpg",O_WRITE | O_CREAT | O_TRUNC);
      if (! outFile){
      Serial.println("open file failed");
      } else {
      Serial.println("File opened sucessfully");
      }

// writes the content of the ArduCAM buffer into the file, with the right
    // function, defined by the 'mode' value

Serial.print("Buffering...");
    while( (temp != 0xD9) | (temp_last != 0xFF) )
    {
      temp_last = temp;
      temp = myCAM2.read_fifo();
      //Write image data to file
      outFile.write(temp);
    }
    Serial.println("OK");
 
    // close the file and clean the flags and the buffers
    outFile.close();
    Serial.println("Capture finished");
    myCAM2.clear_fifo_flag();
    start_capture = 0;
    myCAM2.flush_fifo();
    myCAM2.set_bit(ARDUCHIP_GPIO, GPIO_POWER_MASK);//enable low power
    //myCAM2.InitCAM();
}

// ======== SETUP ========

void setup(){
  uint8_t vid,pid;
  uint8_t temp;
  #if defined (AVR)
    Wire.begin();
  #endif
  #if defined(arm)
    Wire1.begin();
  #endif
  // begins the Serial communication
  Serial.begin(115200);
  Serial.println("ArduCAM Start!");

pinMode(CS1, OUTPUT);
  //pinMode(CS2, OUTPUT);
  SPI.begin();

myCAM1.write_reg(ARDUCHIP_TEST1, 0x55);
  temp = myCAM1.read_reg(ARDUCHIP_TEST1);
  if(temp != 0x55)
  {
    Serial.println("SPI interface Error on Camera 1!");
    //while(1);
  }
  else {
  Serial.println("SPI All Good for Camera 1");
  myCAM1.set_bit(ARDUCHIP_GPIO, GPIO_POWER_MASK);//enable low power
  }
 
myCAM2.write_reg(ARDUCHIP_TEST1, 0x55);
temp = myCAM2.read_reg(ARDUCHIP_TEST1);
if(temp != 0x55)
{
    Serial.println("SPI interface Error on Camera 2!");
    //while(1);
  }
  else {
  Serial.println("SPI All Good for Camera 2");
  myCAM2.set_bit(ARDUCHIP_GPIO, GPIO_POWER_MASK);//enable low power
  }
 
  // SD card initialisation
  if (!SD.begin(SD_CS))
  {
    while (1);    //If failed, stop here
    Serial.println("SD Card Error");
  }
  else
{  Serial.println("SD Card detected!");
}

}
// ====== Main Loop ======

void loop(){
    takePicture1();
    takePicture2();
    Serial.println("waiting...");
    delay(12000);
    Serial.println("done...");
 
}

HI there mate, I would like to know if you have successfully got the correct data for the image. Because i got a distorted image when saving it on SD. thanks

Hi all, can someone tell me why arducam ov 5642 can not be used with arduino nano and if with arduino one. thanks!

Hello there,
could someone give me a detailed spi command datasheet please?
thanks

Hi everyone,

I purchased the new 5MP OV5642 camera and want to connect it to an Arduino MEGA 2560.
I don't have experience in Arduino, so I am a bit lost. As a first step, I would like to make it capturing videos (no need for saving them at this stage).

I didn't have time to look at the codes you posted here, but I was wondering if someone has made this to work and any tips would be welcome.

Thanks,

Pavlos.