Dark Light

VGA Camera Module with Arduino UNO Leave a comment

Here we introduced one VGA camera module, including the communication of camera module and Arduino UNO, the using ways to take photo via camera module, and so on. This is an Arduino camera module, adopted the Surveillance cameras digital image processing, specially designed for image acquisition and processing application, based on TTL communication interface, very convenient to connect with Arduino controller, able to read image and data via UART serial port, and then perform some image processing.

Part 1   General description

This camera module can perform image processing such as AWB (auto white balance), AE (automatic exposure) and AGC (automatic gain control), for the video signal coming from CMOS sensor. What’s more, in fusion of other advanced technology such as image enhancement processing under low illumination, and image noise intelligent forecast and suppress, this module would output high quality digital video signals by standard CCIR656 interface. VC0706 built-in JPEG decoder supported real time encoding for collected image, and external controller can easily read the M – JPEG video streams, achieving the camera design of double stream. VC0706 supported motion detection and OSD display function of screen characters and pattern overlay, capable of self-defining detection area and sensitivity.

Part 2  Test VC0706 camera module

·         Step 1   Needed tool for testing

  • Hardware:
  1. SD Module
  2. Digital key module
  3. Arduino UNO
  4. Jumper wire
  5. USB cable
  6. VGA camera module

·         Step 2 Hardware connection

1. connect the hardware as below:


2. below is the physical diagram:



Step 3  Software use and code programming

  1. Firstly download the two files of Camera_VC0706_lib and Camera_VC0706_TEST from the Camera Module Code written by ElecFreaks and then unzip it. you also can fine the code at the end of this experiment. 
  2. Put the unzipped file of Camera_VC0706_lib into the Arduino IDE folder of Libraries.
  3. Open  unzipped file of Camera_VC0706_TEST, and the program the code into UNO. The detailed steps are demonstrated as below.


4. click Tools, and then choose the board Arduino UNO. exp_has_5

5. Click Tools / Serial Port. and then choose the corresponding COM number. 


6. And then click the button of Programming like Below in red rectangles, program the code into the UNO board until done uploading appears. 


7. Finally, open the monitoring serial port as below in red rectangle. 


8. When Serial port display the data like demonstrated below, you can press the digital keys to take photo. 


9. If photo was taken correctly, the serial port would be displayed as below. 


Arduino Code

#include <camera_VC0706.h>
#include <SD.h>
#include <SoftwareSerial.h>
#define chipSelect 10
#if ARDUINO >= 100
SoftwareSerial cameraconnection = SoftwareSerial(2, 3);
NewSoftSerial cameraconnection = NewSoftSerial(2, 3);
camera_VC0706 cam = camera_VC0706(&cameraconnection);
void setup() {
#if !defined(SOFTWARE_SPI)
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
if(chipSelect != 53) pinMode(53, OUTPUT); // SS on Mega
if(chipSelect != 10) pinMode(10, OUTPUT); // SS on Uno, etc.
Serial.println(“VC0706 Camera test”);
if (!SD.begin(chipSelect)) {
Serial.println(“Card failed, or not present”);
if (cam.begin()) {
Serial.println(“Camera Found:”);
} else {
Serial.println(“No camera found?”);
char *reply = cam.getVersion();
if (reply == 0) {
Serial.print(“Failed to get version”);
} else {
uint8_t imgsize = cam.getImageSize();
Serial.print(“Image size: “);
if (imgsize == VC0706_640x480) Serial.println(“640×480”);
if (imgsize == VC0706_320x240) Serial.println(“320×240”);
if (imgsize == VC0706_160x120) Serial.println(“160×120”);
Serial.println(“Get ready !”);
void loop() {
if(digitalRead(7)== 0) {
if(digitalRead(7)== 0) {
if (! cam.takePicture())
Serial.println(“Failed to snap!”);
Serial.println(“Picture taken!”);
char filename[13];
strcpy(filename, “IMAGE00.JPG”);
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)) {
File imgFile = SD.open(filename, FILE_WRITE);
uint16_t jpglen = cam.frameLength();
Serial.print(jpglen, DEC);
Serial.println(” byte image”);
Serial.print(“Writing image to “);
while (jpglen > 0) {
uint8_t *buffer;
uint8_t bytesToRead = min(32, jpglen);
buffer = cam.readPicture(bytesToRead);
imgFile.write(buffer, bytesToRead);
jpglen -= bytesToRead;

The items used in this experiment
المواد المستخدمة في التجربة يمكنكم اضافتها الى سلة مشترياتكم مباشرة من هنا

Leave a Reply

Your email address will not be published. Required fields are marked *