# OV7670 Without FIFO Very Simple Framecapture With Arduino, Black/white

123,416

70

165

Published

## Introduction: OV7670 Without FIFO Very Simple Framecapture With Arduino, Black/white

This instructable is for all the people struggling to just take a picture/grab a frame with their OV7670 without FIFO. I made this purely as an introduction. I do not yet posses the necessary coding skills to make a really great description. This was made to hopefully save some people a lot of the hours I used researching the OV7670 wanting to see if it worked.

All the coding provided is copied from these links:

http://forum.arduino.cc/index.php?topic=159557.0 (From a really cool guy but obviously not a fan of the arduino IDE or windows)

http://embeddedprogrammer.blogspot.dk/2012/07/hack... (Provides a lot of usefull information for understanding how the OV7670 works)

http://privateblog.info/arduino-uno-i-kamera-ov767... (is in russian, but with google translate you can actually extract some useful information)

Other useful documents are captured in the rar file.

## Step 1: Identify Your Camera

This might be a little redundant but before you get down to the nitty-gritty make sure that the camera you bought is the one without FIFO. I bought mine from http://www.dx.com/p/jtron-ov7670-300kp-vga-camera-.... If your pins mention fifo or you do not have 18 pins for exits this is not the tutorial for you! Btw, if you are thinking about buying the OV7670 and you don't do coding let me save you some time. Spend a more little money and go for one that is better supported by the community for non-coders.

## Step 2: Connecting the Pieces

The OV7670 is not rated for voltages above 3.0v. Hence the voltage divider for the XCLK. Futhermore the OV7670 does not provide higher voltages than 3.0 which is a little low to be sure the arduino reads the input as high (it starts at 3.0v). Therefore we connect pull-up resistors.

## Step 3: Upload Sketch to Arduino

The sketch is borrowed from this link:

https://github.com/ComputerNerd/ov7670-no-ram-ardu...

and put together in the ino file I uploaded (From_Computernerd).

Just insert the ino file in the Arduino IDE and upload it. 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 4: Different Option to "grab" Picture

If you only care about making the OV7670 work, proceed to the next step.

This is just to inform people of some of the different options to retrieve the pictures from the Arduino. I tried using the framegrabber from ComputerNerd:

https://github.com/ComputerNerd/simpleFrameGrabber

It seems to be written in UNIX/Linux. Hence I tried downloading the MinGW, which should be able to run the code. After adding several packages in MinGW I had to stop because MinGW does not contain the termios.h library which is used in the code.

Another option to run GNU in windows is Cygwin. In Cygwin you also install packages with different libraries. I tried running the code installing new packages whenever Cygwin told me a library was missing. In the end I was able to compile an exe file but it wouldn't run because allegedly cygjpeg-8.dll and cygSDL-1-2-0.dll was missing even though I had installed both packages.

Finally abandoning all hope of running the "original" framegrabber I found a russian website where a guy had made his own framegrabber in java instead.

## Step 5: 1. Half.

-Create a new folder on your c drive called out, like c:\out. This is where the pictures will end up.

-Download and install java SDK 32bit (don't install the 64 bit version even if your system is 64 bit) I've tested this with version 8u74.(I've included it as a rar-file because it wouldn't let me upload the exe-file)

-Find out what USB port your Arduino is connected to, something like COM3 or COM4. Check pictures to understand how.

-Depending on what port number your Arduino is connected to, download the corresponding file: COM1 = com_1.rar etc.

## Step 6: 2. Half.

-Go to the "bin" folder, where you installed the Java SDK. By default it should be C:\Program Files (x86)\Java\jdk1.8.0_74\bin.

-Unpack your corresponding com_#.rar files in the directory. Check picture for help. (it might ask for adm. permission)

-Download and extract the Extra.rar file. The "win32com.dll" is placed in the "...\jdk1.8.0_74\jre\bin" direktory.

the "comm.jar" in "...\jdk1.8.0_74\jre\lib\ext" and the "javax.comm.properties" in the "...\jdk1.8.0_74\jre\lib" directory.

-Open cmd

-Open the folder wherein the code is (mine is): cd C:\Program Files (x86)\Java\jdk1.8.0_74\bin

Enjoy! (It isn't much but at least you got it working)

## Step 7: Troubleshooting and Pictures

-If your cmd does not "FIND" images try switching the USB of the arduino from a USB2.0 to a USB3.0 (blue socket) or vice versa.

-If your cmd does not "FIND" images or if you recieve SCRAMBLED pictures, you need to edit the ino file. Edit the line: wrReg(0x11, 12);

try changng the 12 to 11 or 10 or 9 or 13. Upload it to the arduino and run the cmd code again.

Good luck!

## 24 People Made This Project!

• ### shariq azim made it!

• See 15 more that made it

## Recommendations

• ### Arduino Class

69,686 Enrolled

• ### Make it Move Contest

We have a be nice policy.

## 3 Questions

0

Hello, I tryed to change the resolution, but i wasn't successful. Can anyone tell me how to change resolution to the lowest value? 40x30 would be just fine. Thx

0

Hello,

I've tried doing every step exactly like it is written.
but it didn't work, can you help me? i really need this for my project.
Thank you

0

Hello everyone! I have a question... How I disable all automatics funcions (night mode, gamma control, white balance... etc) on the program code? I don't need a sharp image, I need the value of each pixel in the most "crude" form possible, a pixel tonality (white scale) in number. I already have this function by the way (the value pixel ranges from 0 to 254), but this automatics adjusts are messing up my results. Can anyone help me? Thanks!

I have bouth a OV7670 camera module.

I have installed the code and ran it again and it is still "looking for image". What can I do?

I have tried the connections to SIOC-A4/A5 or SIOD to A5/A4 and no connection to HREF. I have been trying it for last 3 weeks but in vain. Do help me out to complete the module...

3 replies

Have you solved it? I have the same problem... always "Looking for image"

Hello, i also have the same problem.

The cmd prompt stops at "Looking for image".
How do i get past this?

Thanks

no idea

I meet the same problem too

the cmd is stop in "Looking for image"

and my ov7670 is without FIFO too

My arduino upload files in port4 and I use your port4 files too"

What can I do?

this project is important to me

plz help me!!!

11 replies

Hello, I'm presently experiencing the same issue.
My cmd prompt stops at "Looking for image".
i followed the steps as detailed in the report...did the SIOD/SIOC swap with A4/A5 pins, disconnected HREF. Still no improvement.

Thanks.

I have the same problem as you and how can you fix it?I have done an important project as you, can you please help me?

hey, i done it

I think the problem is because the wiring

plz check the schematic sir

I AM SO HAPPY

"HERF" don't need to connect

and then "SIOC" ->A4 NOT A5

"SIOD:->A5 NOT A4

"XCLKF" ->D11 directly (Don't use any Resistance)

PLZ TRY THIS

AND I can capture now

And the Uno L red light keeps flashing and I am wondering if it is noraml.Did you have the same situation before?

in my case, switching a4 and a5 did trick

Thanks for ur detailed explanations,though it still doesn't work.May I ask u one more question, what value of resistors u use to connect with the SIOC and SIOD?

10k

let try this schematic.

and SIOD,SIOC connect with 3.3v

Really thanks for your help.I can take pictures now. But it seems the resolution is too low which cannot be acceptable.How can you tune he resolution?

if you keep stop in "looking for image"

Switch SIOC>D4 /SIOD>D5 OR SIOC>D5/SIOC>D4

I am done now.

plz check the wiring.

A4>SIOD

A5>SIOC

XCLK>D11 directly (don't use any resistance)

and don't connect HREF

Just try it

I am not following the top of schematic

Hi

I wouldn't recommend this as the OV7670 is can only take around 3v on its inputs. Although it "may" work at 5v it probably wont last long.

thanks

Does smb know how to make pics colorful?

Bigg Thanks Instructables to you. It workedddd. Thankssssss

Hello,

I've tried doing every step exactly like it is written. but it didn't work, can you help me? i really need this for my project. Thank you

To figure out the correct value for register 0x11 use this on the loop and find the best image

void loop(){

while (1){

uint8_t x=63;

do {

wrReg(0x11, x);

_delay_ms(1000);

captureImg(320, 240);

}while(--x);

}

}