The camera module is powered from a single +3.3V power supply. An external oscillator provide the clock source for camera module XCLK pin. With proper configuration to the camera internal registers via I2C bus, then the camera supply pixel clock (PCLK) and camera data back to the host with synchronize signal like HREF and VSYNC. The OV7670 camera module is a low cost 0.3 mega pixel CMOS color camera module, it can output 640x480 VGA resolution image at 30fps. The OV7670 camera module build in onboard LDO regulator only single 3.3V power needed and can be used in Arduino, STM32,Chipkit, ARM, DSP , FPGA and etc.


  • Optical size 1/6 inch
  • Resolution 640x480 VGA
  • Onboard regulator, only single 3.3V supply needed
  • Mounted with high quality F1.8 / 6mm lens
  • High sensitivity for low-light operation
  • VarioPixel® method for sub-sampling
  • Automatic image control functions including: Automatic
  • Exposure Control (AEC), Automatic Gain Control (AGC), Automatic White Balance (AWB), Automatic
  • Band Filter (ABF), and Automatic Black-Level Calibration (ABLC)
  • Image quality controls including color saturation, hue, gamma, sharpness (edge enhancement), and anti-blooming
  • ISP includes noise reduction and defect correction
  • Supports LED and flash strobe mode
  • Supports scaling
  • Lens shading correction
  • Flicker (50/60 Hz) auto detection
  • Saturation level auto adjust (UV adjust)
  • Edge enhancement level auto adjust
  • De-noise level auto adjust

Step 1: Material Preparation

In this tutorial, you will need :

1. Arduino Uno Board and USB
2. OV7670 Arduino Camera Sensor Module STM32
3.10K resistor X 2
4. 4.7K Resistor X2
5. Breadboard

and you will be using Arduino IDE and Java.

Step 2: Pinout Connection

Connect your circuit as illustrated on the picture above.

Step 3: Java

You have to download this to be able to interface this camera sensor module on your pc.Open the zip file and install to your computer. By default, this will be install to your c drive in your program files folder. As for mine, it is stored in C:\Program Files\Java\jdk1.8.0_74. You can refer picture above.

NOTE : This jdk-8u74-windows-i586.rar file is quite big.

Step 4: Sample Source Code

This sample source code is originally from this link. Download this sample source code, open it on your Arduino IDE, connect your Arduino Uno Board to your computer and upload it. Select the correct board and port before uploading this source code. Refer image above for help.

NOTE : Don't mind that it does not recognize some libraries in the beginning of the file. If it bothers you, comment the whole line out with //

Step 5: Checking Your Port

Find out what USB port your Arduino is connected to, something like COM4 or COM5. You could check it on your Control Panel > Device Manager > Ports (COM & LPT) > right click > Properties > Port Settings > Advanced > COM Port Number > /Select Your Port Number/. You can refer the image above for help. As for mine, it is port COM5.

Step 6: Com_#.rar

Depending on what port number your Arduino is connected to, download the corresponding file. COM1 = com_1.rar , COM2 = com_2.rar and etc. Open your com#.rar on WinRaR, extract/copy the 'code' folder from com_#.rar, go to Local Disk > Program Files > Java > jdk1.8.0_74 > bin and paste it there. you can refer the picture above for a better understanding.

Step 7: C:\out

You have to create a new folder on your c drive / Local Disk (C:). This will be your camera module sensor's taken picture's destination. Name this folder as out (it could be anything though).

Step 8: Extra.rar

1. Download and extract the Extra.rar file below and open it. As you could see, there is src folder, lib folder and "win32com.dll". You have to copy and placed "win32com.dll" in the "C:\Program Files\Java\jdk1.8.0_74\jre\bin" directory.

2. Then, open the lib and you could see the "comm.jar" and "javax.comm.properties" in it. Copy and paste the "comm.jar" in "C:\Program Files\Java\jdk1.8.0_74\jre\lib\ext" and "javax.comm.properties" in the "C:\Program Files\Java\jdk1.8.0_74\jre\lib" directory.

NOTE : it may ask for administrator permission, just proceed anyway.

Step 9: CMD

Open cmd and open the folder wherein the code folder is by writing its address. mine is "C:\Program Files\Java\jdk1.8.0_74\bin". Click enter and it will give u "C:\Program Files\Java\jdk1.8.0_74\bin>". Now, write "java code.SimpleRead". It supposed to be like this---> C:\Program Files\Java\jdk1.8.0_74\bin>java code. SimpleRead. You can refer image for help.

Step 10: Result

You can see the picture taken from your OV7670 Camera Module Sensor in your our folder in c drive.

Step 11: Troubleshooting

1. If your cmd cannot find images, try switching the USB of the arduino from a USB2.0 to a USB3.0 (blue socket) or vice versa.

2 If you receive scrambles pictures, you need to edit the sample source code. Edit line: wrReg(0x11, 12); try changing the 12 to 11/10/9/13. Upload it to the arduino and run the cmd code again.

<p>what's the problem , and how to solve it</p>
<p>can i use it on arduino mega 2560 board? thanks in advance</p>
<p>of course you can use Arduino Mega 2560, charge the code on the board and make the same wiring, import the libraries as usual and that's all... </p>
<p>Hiii. I am doing future expansion of this type of project, so i have to use Arduino MEGA, so can you suggest me what &amp;all are needed to be modified in above steps? Is there any need to change in circuit?</p>
<p>Hi, I'm struggling with receive scrambles pictures. I had tried edit<br> line: wrReg(0x11, 12), but i still get scrambles pictures. Do you have <br>any solutions?</p><p>Thanks</p>
<p>I have also this problem.</p><p>How can we solve this problem</p><p>Thanks</p>
<p>how to solve this problem??? </p>
<p>I have also same issue ,</p><p>May anybody solve this problem??</p>
<p>Great instructable, thnx! The images are BW - any tips on how to get colour?</p><p>thnx</p><p>billd</p>
<p>Hi <a href="https://www.instructables.com/member/BillD120" rel="nofollow">BillD120</a>! did you just follow the step? did you also use arduino uno or mega?<a href="https://www.instructables.com/member/BillD120" rel="nofollow"><br></a><br> </p>
<p>Hey did you sort the issue?..If yes then please share the solution since I am getting the Similar problem..</p>
<p>Hey BillD120, considering that you used ov7670 and Not vc0706 camera, can you help me in improving my image quality. Since my image from OV7670 is not intact </p>
<p>hi <a href="https://www.instructables.com/member/BillD120" rel="nofollow">BillD120</a>,</p><p>did you figure out how to get color images?</p><p>thanks</p>
<p>Hi, no. I haven't had any feedback from the original post, have not been experimenting since. Good lukc!</p><p>billd</p>
<p>OK, I thought a little graphic might help myself.... maybe not?</p>
<p>if someone can help me pls, when i upload the code to the arduino mega this error comes out &quot;<br><br>test_camera_ov7670:572: error: &lsquo;void captureImg(uint16_t, uint16_t)&rsquo; was<br> declared &lsquo;extern&rsquo; and later &lsquo;static&rsquo; [-fpermissive] &quot;. Pls help me <br>solve this problem .</p>
How do i use this camera if i am using mega instead of uno
<p>cmd does not find img</p><p>plz help</p>
<p>Did you ever solve this? Mine does exactly same.</p>
<p>can i get com7.rar</p>
<p>can i get COM6.rar?</p>
<p>Hello mybotic, you tutorial seems to work absolutely fine but my image quality is not good, my image is not intact, I have attached it for reference. What should I change (baud rate) in the code or i should attach a FIFO buffer in the code?</p>
<p>I have edited wrReg(0x11, 12); to Edit line: wrReg(0x11, 13); in order to get this image, any other setting gives lines/blurs the image<br></p>
<p>the image will not be found </p><p>searching for image in cmd</p>
<p>I have the same problem. When I run it, it stops blinking for a second and then resumes blinking.</p>
<p>I also have the same problem with <a href="https://www.instructables.com/member/rennythomas260394" rel="nofollow">rennythomas260394</a>. How will i fix this?<br>Is this applicable in arduino mega? Thanks.</p>
<p>Complimenti per la chiarezza del progetto che ho trovato molto interessante e funzionale. Vorrei chiederti la cortesia, se Ti &egrave; possibile, di aggiungere al progetto un lettore di sd card al fine di salvare sulle scheda sd le foto scattate.</p><p>Grazie </p><p>Franco</p>
<p>Finalmente delle istruzioni dettagliate e funzionanti.</p><p>Complimenti.</p><p>Grazie.</p><p>Franco</p><p>Franco</p>

About This Instructable




More by mybotic:Tutorial for 2.8" Arduino TFT LCD Touchscreen Module (Colour Screen) How to Use I2C Serial LCD 20X4 (Yellow Backlight) How to Use Arduino I2C Serial LCD 16x2 (Yellow Backlight) 
Add instructable to: