All post of ElecFreaksHack HackUser Guide

VC0706 Camera Module DIY Guide

By December 18, 2014 38 Comments
camera 0706 A

Here we introduced one VC0706 camera module just purchased online, 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 chip-VC0706, 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. This is a detailed DIY guide for the VC0706 TTL and UART camera, and you can also download the code from ElecFreaks.

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 reatime 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. VC0706 camera module

software:

1. Camera_VC0706_TEST

2. Arduino IDE(download it from official website)

Step 2 Hardware connection

1. Connect the hardware as below:

camera 0706 B

2. Here below is the physical diagram:

camera 0706 C

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.

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.

camera 0706 D

4. Click Tools,and then choose the board of Arduino uno like below

camera 0706 E

5. Click Tools / Serial Port,and then choose the corresponding COM number.
camera 0706 F

6. And then click the button of programming like below in red rectangle,program the code into the UNO board until done uploading appears.

F

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

camera 0706 I

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

camera 0706 G

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

camera 0706 H

10. Until now, the module testing has been completed.

VN:F [1.9.13_1145]
Rating: 6.3/10 (21 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 2 votes)
VC0706 Camera Module DIY Guide, 6.3 out of 10 based on 21 ratings
dany

Author dany

More posts by dany

Join the discussion 38 Comments

  • vinay says:

    what does digital key module do?

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • manoj says:

    i have done this & working fine but if i dont open the serial terminal it will not take photos why so????????

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • domotique says:

    My brother suggested I might like this blog. He was once entirely right.
    This publish actually made my day. You can not imagine simply how much time
    I had spent for this info! Thank you!

    [Reply]

    clark Reply:

    Hi dear, i am so glad that you like our posts. You can keep on following us, and i am sure we will bring you more and more wonderful blogs. Just waiting to be suprised!

    [Reply]

    VN:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • Frank says:

    Hi,
    I am Frank from Fuzhou Siaon Optoelectronic Technology Co., Ltd.
    We have developed a series of M12 lenses used in security monitoring,cctv camera,action camera, UAV ,etc.
    Detail please visit our website http://www.siaon.com.
    Looking forward to your reply.

    Regards
    Frank

    [Reply]

    clark Reply:

    Dear Frank, i have seen your website and found that you have good products. But right now we don’t need your products. Maybe next time we can cooperate once we have needs for your products.

    [Reply]

    VN:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • Tom says:

    I am getting the following error when trying to compile, was wondering if anyone had solved this?

    C:UsersThomasDocumentsArduinolibrariescamera_VC0706camera_VC0706.cpp:63:9: error: prototype for ‘uint8_t camera_VC0706::setMotionStatus(uint8_t, uint8_t, uint8_t)’ does not match any in class ‘camera_VC0706’

    uint8_t camera_VC0706:: setMotionStatus(uint8_t x, uint8_t d1, uint8_t d2) {

    ^

    In file included from C:UsersThomasDocumentsArduinolibrariescamera_VC0706camera_VC0706.cpp:10:0:

    C:UsersThomasDocumentsArduinolibrariescamera_VC0706camera_VC0706.h:78:11: error: candidate is: boolean camera_VC0706::setMotionStatus(uint8_t, uint8_t, uint8_t)

    boolean setMotionStatus(uint8_t x, uint8_t d1, uint8_t d2);

    ^

    exit status 1
    Error compiling for board Arduino/Genuino Uno.

    [Reply]

    Heisenberg Blue Reply:

    Did you get the answer?

    [Reply]

    Tom Reply:

    I didn’t find a definitive answer, I kept trying and switched the TX and RX inputs to 2 and 3 rather than 0 and 1. That didnt work for a couple of attempts but then it suddenly worked all fine!
    I hope that helps

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)

    Márcio Moraes Reply:

    I solved. Go to the cpp file line 63 and change the return type from uint8_t to boolean

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • priyanshu says:

    How can I connect Nokia 14 pin camera to arduino

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • Muhammed Gökkılıç says:

    Hi… I bought VC0706 camera and SD Card Module. This camera has 6 input. How can I connect them to arduino? Can you help me?

    [Reply]

    arda eko Reply:

    just use Tx Rx vc0706

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • Alexis Avila says:

    Do you i could help to resolve this error please?
    I do not know how to resolve it, is not whether it is the library or the type of developer who used.

    C:UsersalexiDocumentsArduinolibrariescamera_VC0706camera_VC0706.cpp:63:9: error: prototype for ‘uint8_t camera_VC0706::setMotionStatus(uint8_t, uint8_t, uint8_t)’ does not match any in class ‘camera_VC0706’
    uint8_t camera_VC0706::setMotionStatus(uint8_t x, uint8_t d1, uint8_t d2) {
    ^
    In file included from C:UsersalexiDocumentsArduinolibrariescamera_VC0706camera_VC0706.cpp:10:0:
    C:UsersalexiDocumentsArduinolibrariescamera_VC0706camera_VC0706.h:78:11: error: candidate is: boolean camera_VC0706::setMotionStatus(uint8_t, uint8_t, uint8_t)
    boolean setMotionStatus(uint8_t x, uint8_t d1, uint8_t d2);
    ^

    [Reply]

    Tom Reply:

    Did you ever get a solution for this? Im getting the same error

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)

    Saurabh Yadav Reply:

    hello sir, if you find any solution to this bug please tell me at email id- syadav8126@gmail.com. i will be very thankful to you.

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • pavan says:

    guys im getting an error in the code..please help me out

    Arduino: 1.6.8 (Windows 10), Board: “Arduino Yún”

    E:Arduinolibrariescamera_VC0706camera_VC0706.cpp:63:9: error: prototype for ‘uint8_t camera_VC0706::setMotionStatus(uint8_t, uint8_t, uint8_t)’ does not match any in class ‘camera_VC0706’

    uint8_t camera_VC0706::setMotionStatus(uint8_t x, uint8_t d1, uint8_t d2) {

    ^

    In file included from E:Arduinolibrariescamera_VC0706camera_VC0706.cpp:10:0:

    E:Arduinolibrariescamera_VC0706camera_VC0706.h:78:11: error: candidate is: boolean camera_VC0706::setMotionStatus(uint8_t, uint8_t, uint8_t)

    boolean setMotionStatus(uint8_t x, uint8_t d1, uint8_t d2);

    ^

    E:Arduinolibrariescamera_VC0706camera_VC0706.cpp: In member function ‘void camera_VC0706::OSD(uint8_t, uint8_t, char*)’:

    E:Arduinolibrariescamera_VC0706camera_VC0706.cpp:151:32: warning: narrowing conversion of ‘strlen(((const char*)str))’ from ‘size_t {aka unsigned int}’ to ‘uint8_t {aka unsigned char}’ inside { } [-Wnarrowing]

    uint8_t args[17] = {strlen(str), strlen(str)-1, (y & 0xF) | ((x & 0x3) << 4)};

    ^

    E:Arduinolibrariescamera_VC0706camera_VC0706.cpp:151:46: warning: narrowing conversion of '(strlen(((const char*)str)) + 65535u)' from 'size_t {aka unsigned int}' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]

    uint8_t args[17] = {strlen(str), strlen(str)-1, (y & 0xF) | ((x & 0x3) << 4)};

    ^

    E:Arduinolibrariescamera_VC0706camera_VC0706.cpp:151:60: warning: narrowing conversion of '((((int)y) & 15) | ((((int)x) & 3) << 4))' from 'int' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]

    uint8_t args[17] = {strlen(str), strlen(str)-1, (y & 0xF) | ((x & 0x3) <> 8)’ from ‘uint16_t {aka unsigned int}’ to ‘uint8_t {aka unsigned char}’ inside { } [-Wnarrowing]

    uint8_t args[] = {0x08, wz >> 8, wz,

    ^

    E:Arduinolibrariescamera_VC0706camera_VC0706.cpp:189:19: warning: narrowing conversion of ‘wz’ from ‘uint16_t {aka unsigned int}’ to ‘uint8_t {aka unsigned char}’ inside { } [-Wnarrowing]

    };

    ^

    E:Arduinolibrariescamera_VC0706camera_VC0706.cpp:186:23: warning: narrowing conversion of ‘(hz >> 8)’ from ‘uint16_t {aka unsigned int}’ to ‘uint8_t {aka unsigned char}’ inside { } [-Wnarrowing]

    hz >> 8, wz,

    ^

    E:Arduinolibrariescamera_VC0706camera_VC0706.cpp:189:19: warning: narrowing conversion of ‘wz’ from ‘uint16_t {aka unsigned int}’ to ‘uint8_t {aka unsigned char}’ inside { } [-Wnarrowing]

    };

    ^

    E:Arduinolibrariescamera_VC0706camera_VC0706.cpp:187:23: warning: narrowing conversion of ‘(pan >> 8)’ from ‘uint16_t {aka unsigned int}’ to ‘uint8_t {aka unsigned char}’ inside { } [-Wnarrowing]

    pan>>8, pan,

    ^

    E:Arduinolibrariescamera_VC0706camera_VC0706.cpp:189:19: warning: narrowing conversion of ‘pan’ from ‘uint16_t {aka unsigned int}’ to ‘uint8_t {aka unsigned char}’ inside { } [-Wnarrowing]

    };

    ^

    E:Arduinolibrariescamera_VC0706camera_VC0706.cpp:188:24: warning: narrowing conversion of ‘(tilt >> 8)’ from ‘uint16_t {aka unsigned int}’ to ‘uint8_t {aka unsigned char}’ inside { } [-Wnarrowing]

    tilt>>8, tilt

    ^

    E:Arduinolibrariescamera_VC0706camera_VC0706.cpp:189:19: warning: narrowing conversion of ’tilt’ from ‘uint16_t {aka unsigned int}’ to ‘uint8_t {aka unsigned char}’ inside { } [-Wnarrowing]

    };

    ^

    E:Arduinolibrariescamera_VC0706camera_VC0706.cpp: In member function ‘uint8_t* camera_VC0706::readPicture(uint8_t)’:

    E:Arduinolibrariescamera_VC0706camera_VC0706.cpp:278:35: warning: narrowing conversion of ‘(((camera_VC0706*)this)->camera_VC0706::frameptr >> 8)’ from ‘uint16_t {aka unsigned int}’ to ‘uint8_t {aka unsigned char}’ inside { } [-Wnarrowing]

    0, 0, frameptr >> 8, frameptr & 0xFF,

    ^

    E:Arduinolibrariescamera_VC0706camera_VC0706.cpp:278:50: warning: narrowing conversion of ‘(((camera_VC0706*)this)->camera_VC0706::frameptr & 255u)’ from ‘uint16_t {aka unsigned int}’ to ‘uint8_t {aka unsigned char}’ inside { } [-Wnarrowing]

    0, 0, frameptr >> 8, frameptr & 0xFF,

    ^

    exit status 1

    Error compiling for board Arduino Yún.

    This report would have more information with

    “Show verbose output during compilation”

    option enabled in File -> Preferences.

    [Reply]

    Franco Gentili Reply:

    I have the same error. Did you fix it?

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 5.0/5 (1 vote cast)
    VA:F [1.9.13_1145]
    Rating: +1 (from 1 vote)

    Alexis Avila Reply:

    I have almost the same error, what solved already?, It seems is in the library but not how to fix it.

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 5.0/5 (1 vote cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 2 votes)
  • sohail iqbal says:

    when connect with UNO or MEGA says”no camera found ” any solution for this kind of error”

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • zainab says:

    can we use the provided code for 0V7670 camera module? we are using uno.

    [Reply]

    ElecFreaks Reply:

    hello,this module is not OV7670,this is Serial camera,OV7670 can’t suppot UNO

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • sarath says:

    does it really need to connect rx(2) and tx(3) pins …or can we use any other digital pins of arduino
    thanks in advance

    [Reply]

    ElecFreaks Reply:

    Thanks for your interest. This product does need rx(2) and tx(3) pins. Therefore can not replace to other digital pins. Any other technical inquiry, feel free to contact us at

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • Nate Crosby says:

    Hi, I have an OV7670 camera module, and I’m trying to follow this test.
    The above schematics show you using:
    RX, TX, VCC, GND

    However as seen in my image, my OV7670 camera module does have these pins. It has:
    3V3, GND, SIOC, SIOD, VSYNC, HREF, PCLK, XCLK, D7, D6, D5, D1, D3, D2, D1, D0, RESET, PWDN.

    Could anyone help me by telling me how i would need to connect my camera up?
    Thanks for your time and help!
    Nate.

    [Reply]

    ElecFreaks Studioo Reply:

    Hi Nate,

    For this demo actually is serial camera, should be 0706. Sorry for the mistake.

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)

    mimichen Reply:

    Hi,Dany.I have the same problem with Nate Crosby,the OV7670 camera module are different from yours.Which pins should we use to take the place of Rx,Tx..

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • Serenay says:

    Hi , I have mega and connected like that: 3.3 to before 3.3 later 5V , gnd to gnd, tx to D2 and rx to D3.
    But it doesn’t work. It says “camera not found” “failed to snap!” image writing to… When I control the SD it seems like photoes are taken because there are lots of JPEG files, but actually it only creates files doesnt take photo. I couldnt find the problem.

    [Reply]

    ElecFreaks Studioo Reply:

    Hi Serenay,
    For this demo actually is serial camera, should be 0706. Sorry for the mistake.

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • Serenay says:

    Hi Dany, I have mega and connected like that: 3.3 to before 3.3 later 5V , gnd to gnd, tx to D2 and rx to D3.
    But it doesn’t work. It says “camera not found” “failed to snap!” image writing to… When I control the SD it seems like photoes are taken because there are lots of JPEG files, but actually it only creates files doesnt take photo. I couldnt find the problem.

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • Patrick Fairclough says:

    Hi Dany, There are no RX and TX pins on the OV7670. I agree with Kalle, the camera that is used for this is the 0706. The OV7670 runs on 3V not 5V (Arduino is 5V). The 0706 is a serial TTL camera and is the one you need to specify in the hardware link.

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • anggi says:

    which pin tx and rx in Camera modul 7670 ?

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • Kalle Eskelinen says:

    That is 0706 no 7670. You should change that link. You see that in arduino serial screen also

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • vmr5072 says:

    hey guys! when I run a program it says “camera_VC076 does not name a type”, in this case what do I have to do to fix it?

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • Mohit Varma says:

    can we control on-off operations of camera OV7670 using arduino uno board by programming??
    please reply asap.

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • Fajar Abdurrahman says:

    wich are tx and rx pin in ov7670?? are they A2 and A3? how about vcc? is it AVDD? thx 🙂

    [Reply]

    ElecFreaks Reply:

    Hi Fajar, tx and rx pin in ov7670 should connect to D3, D2 in UNO. VCC in ov7670 should connect to 5V in UNO, not AVDD.

    [Reply]

    Heisenberg Blue Reply:

    uint8_t camera_VC0706::setMotionStatus(uint8_t x, uint8_t d1, uint8_t d2) {
    What’s the solution for error on line 63 of camera_VC0706.cpp?

    [Reply]

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)

Leave a Reply