Introduction: How to Use OV7670 Camera Module With Arduino?

Here we introduced one OV7670 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-OV0706, 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 OV7670 TTL and UART camera, and you can also download the code from ElecFreaks.

Find source reading here: http://www.elecfreaks.com/7861.html

Step 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. OV7670 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. OV7670 supported motion detection and OSD display function of screen characters and pattern overlay, capable of self-defining detection area and sensitivity.

Step 2: Test OV7670 Camera Module - Needed Tool for Testing

  • Hardware

SD Module

Digital key module

Arduino UNO

Jumper wire

USB cable

OV7670 camera module

  • Software

Camera_VC0706_TEST

Arduino IDE(download it from official website)

Step 3: Hardware Connection

  1. Connect the hardware as the diagram shows.
  2. Physical diagram.

Step 4: Software Use and Code Programming

  1. Firstly download the two files of Camera_OV0706_lib and Camera_OV0706_TEST from the Camera Module Code written by ElecFreaks and then unzip it.
  2. Put the unzipped file of Camera_OV0706_lib into the Arduino IDE folder of Libraries.

  3. Open unzipped file of Camera_OV0706_TEST, and the program the code into UNO. The detailed steps are demonstrated in the pictures.

  4. Click Tools,and then choose the board of Arduino UNO.

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

  6. And then click the button of programming like below in red rectangle, 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 the serial port display the data like demonstrated below, you can press the digital keys to take a photo.

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

Until now, the module testing has been completed. Thanks for reading.

Comments

author
PrajwithU (author)2017-05-22

In my ov7670 cam there is no Rx & Tx pins.

author
eltharin (author)PrajwithU2017-08-15

How many pin do ou have?

22 or 18?

author
PriyankaM21 (author)2017-04-04

check out:

complete tutorial, 100 % working

author
NehaC17 (author)PriyankaM212017-06-26

Dear Sir

I am having trouble with OV7670 camera with fifo and i want to display picture using it on laptop using arduino uno.

Kindly help me by providing connection and codes for OV7670 camera with arduino.

Its very important.

email- nutanneha@gmail.com

author
Anky_Ard (author)2016-11-22

The instructions and code seem to be for VC0706 camera and not OV7670. The article mentions OV7670, the code has lib and test folders named after OV0706 and the source code has header file for camera VC0706. This is very confusing.

OV7670 does not have tx rx pins while VC0706 does.

author

The instructions and code seem to be for VC0706 camera and not OV7670. ?????

sir did u test that , is that codes will differ for VC0706 and OV7670

author

please help me to overcome this problem, if u have solution please mail me

vishwanathreddy1503@gmail.com

author
chang1997 (author)Anky_Ard2017-03-15

hello do you have any idea to use the ov7670 for arduino ?

ill be very appreciated if you can email me :chang-97@hotmail.com

author
Priyanshu roy (author)2017-03-31

How can I use old mobile camera as a camera module I have a Nokia camera please anyone tell me about this 14 pin camera

images.jpg
author
jilvir (author)2017-03-15

Hi... I try it and there is an error in compiling the code... say something with the board... can you help? thanks...

author
mohameda739 (author)2017-03-11

Arduino: 1.8.1 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Program Files (x86)\Arduino\libraries\camera_VC0706\camera_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:\Program Files (x86)\Arduino\libraries\camera_VC0706\camera_VC0706.cpp:10:0:

C:\Program Files (x86)\Arduino\libraries\camera_VC0706\camera_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);

^

Multiple libraries were found for "SD.h"

Used: C:\Users\user\Documents\Arduino\libraries\SD

Not used: C:\Program Files (x86)\Arduino\libraries\SD

exit status 1

Error compiling for board Arduino/Genuino Uno.

This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.

author
aristarco.cortes (author)2015-05-05

This camera is not the OV7670 model. It is actually the OV0706 model. It is very Confusing

author

Yeap. I think it's written for vc0706 not OV0706. OV has more pins not just 4 pins.

author
VanessaM78 (author)2016-09-28

Hi I want to ask if there's an available DIY system it's actually a comination of

Burglar Alarm using Arduino and PIR Sensor- with SMS Alarm using GSM Module and Camera
author
Bay Yolal (author)2016-06-15

Title is OV7670 but instructions are for OV0706. If I am not wrong, your instructable title is wrong. I am confused.

author
FredR19 (author)2016-06-14

wrong camera model in description. makes me loose time (only comments seem to guide users to better tutorials about the proper model from title)

author
raykam1 (author)2016-05-23

Hi. I have 3 questions.

Can I use arduino micro or nano for this project?If yes how?

can I use a micro sd module for this project? if yes how?

and I want to use a micro switch push button like Microswitch665 or another small key. is itpossible? how?

micro switch push button:

http://www.ebay.com/itm/20-Pcs-6x6x12mm-Momentary-...

I want to make a micro camera using this items.

I have many ideas in my mind and I want to make them. please help me.

thanks. :)

author
Gunterman5 (author)2016-04-15

Is there a way to salvage a camera module from a dash cam and use that?

author
purusho95 (author)2016-03-18

Hi sir

This is purushothaman doing Mechanical engineering final year project ,

I request you to help me to do the QR code scanner using the OV7670 through the Arduino Uno Sir

Can you ?

Please Comment as soon as possible.

author
SamH12 (author)2015-03-25

This camera is not the OV7670 model. It is actually the OV0706 model. Could someone please fix this to prevent confusion and so people can actually use the instructabe.

Thanks.

author
nodoubtman (author)SamH122016-03-17

YEAH

author
razan khory (author)SamH122015-04-12

hello,

Do you have any idea of how to connect ov7670 camera with arduino mega !!! plz let me know if you know how to connect it :(

author
HassanS6 (author)2015-11-04
author
CristóbalT (author)HassanS62016-01-25

No...

author
MrRedBeard (author)2015-12-22

Awesome just what I was looking for. I'll be prototyping with the camera this weekend.

author
MrRedBeard (author)MrRedBeard2015-12-22

This will never work because the OV7670 is not serial (no tx, rx). Or am I missing something?

author
CristóbalT (author)MrRedBeard2016-01-25

You're rigth. The module VC0706 has a TX/Rx.

author
Merl1n007 (author)2015-12-15

Instruction is good, but this version of camera is expensive for many fans.

Here an instruction in russian with examples for chipper version:

http://privateblog.info/arduino-uno-i-kamera-ov7670-primer-ispolzovaniya/

author
diego mauricioM (author)2015-08-21

I sleep no longer thinking of the solution ... I need your valuable assistance

author
diego mauricioM (author)2015-08-20

Please your help is generating the error "camera not found",

when called cam.begin ... I could not continue ... any idea that does not recognize the camera .. the connection is supposedly simple

arduino camera

3v3 3v3

GND GND

2 D0

3 D1

it does not work

author
ckrmustafa (author)2015-08-18

There is no pin that named as TX and RX on OV7670

author
LashaP (author)2015-07-20

Does anyone have any success about OV7670 via unoR3 or mega? (with SD card)

author
NeilK3 (author)2015-06-05

I agree that these instructions are for the wrong camera ... it is for the VC0706 and not the OV7670. I suggest that one flags the article with the Instructables team for correction.

author
JoeH9 (author)2015-04-24

ok, so the bottom line is: there is no way to connect an ov7670 camera to a mega 2560 r3 and make it capture or transmit a single frame, much less stream video over usb and display on a pc. Or it is a very well kept secret.

author
aristarco.cortes (author)JoeH92015-05-05

Hi, I have the same problem. You can find the pinout for Mega here https://www.arduino.cc/en/Hacking/PinMapping2560

pins 50 to 53 are MISO, MOSI, SCK, RST

RX and Tx are pin 0 and 1

What I dont know is wich pins are Tx and RX in the camera :D

author
UmerB (author)2015-04-21

where to buy ov0706 camera module...

author
beto.garza3 (author)2015-01-05

where is the tx and rx on the ov7076 camera?

author
Akin Yildiz (author)2014-12-19

the very first link, the link for the camera module doesn't have RX / TX pins.. it has 18pins instead..?!?!

i've been waiting for someone to use this camera module with an arduino.. this setup doesn't connect.!

author
CopperMasud (author)Akin Yildiz2015-02-02

let me know if you find something please///////

author
Akin Yildiz (author)CopperMasud2015-02-11

check this out, someone hacked it already... https://www.instructables.com/id/Arduino-keychain-c...

.

i have just recieved my cameras, i will be making my own post soon hopefully

author
Akin Yildiz (author)CopperMasud2015-02-02

hello copper;

i have found this camera for only $7 http://www.banggood.com/it/Mini-DVR-808-Car-Key-Ch...

ordered, still not arrived. i'm hoping to be able to somehow hack and control it with an arduino. it has a built in SD card and USB port. microphone as well.. someone needs to offer already a $5 simple arduino camera. this is just crazy.. good luck, will let you know if i figure something out. or you can help me control it maybe?

author
poliluca (author)2015-01-31

Well,
If it is would not be possible to get the connections, it should be considered to take the section away, to avoid people wisting time on it.

Thank you anyway to ElecFreaks for the try

About This Instructable

400,699views

244favorites

More by ElecFreaks:How to make an Auto-Mecanum VehicleHow to make an Auto-Omni vehicleArduino Compatible Multi-Function Car
Add instructable to: