Go Down

Topic: OV7670 with both arduino uno and now mega (Read 449651 times) previous topic - next topic


Mr_Arduino and the broader community,

Thank you for posting all of the information and code to enable this project.  Your help is much appreciated.  I am having a tough time understanding the connections.  Is there any chance you can post a detailed photo or a diagram of the wiring between the OV7670 with FIFO and the Arduino Mega? 

I am having a tough time visualizing how to incorporate the 74HC25 chip.

Thanks in advance.


The 74hc125 allows for you to easily to convert the 5v clock signal generated by the AVR processor into a 3.3v signal. What you do is simply power the 74hc125 with 3.3v and plug in the 5v signal into the input and out will come a 3.3v signal. Note that the 74hc125 has a output enable pins. Pull the ones you are using to ground to enable output. As for a schematic I do need to get going on that.



Would you mind use your OV7670 and capture your skin / hand in the YUV/YCbCr format?

Are you getting results similar to these?



No the colors I get from the camera look quite nice especially indoors. Try changing your registers. I have disucessed the registers that I have on github multiple times in this thread. Please refer back to them. Check out these page https://github.com/ComputerNerd/arduino-camera-tft/blob/master/ov7670_regs.h https://github.com/ComputerNerd/arduino-camera-tft/blob/master/twicam.h https://github.com/ComputerNerd/arduino-camera-tft/blob/master/twicam.c


Jul 02, 2014, 09:02 pm Last Edit: Jul 02, 2014, 10:44 pm by TeamAlpha Reason: 1
Dear Mr_arduino,

I am currently working with a group of students trying to get the OV7670 working as a sensor with an Arduino Due or Uno.  How exactly do we drive the XCLK and connect HREF?  And is which code best suits our interests?  We are very confused.  Thanks!  

Edit: We are trying to configure this using i2C configuration


HREF just goes to an arduino PIN if you want to do that. Just don't plug it in if you don't need to use it. I use VREF. As for XCLK generate it with fast PWM and use a buffer to get it from 5v to 3.3v



anyone have success in making the ov7670 output QQVGA (160 by 120) ?

Thanks. What are the proper register settings?

Ive done my research and I tried putting these

yet the signals(href) is not stopping at the 320th data.


I have used qqvga before check out the registers that I used on my github pages.


HREF just goes to an arduino PIN if you want to do that. Just don't plug it in if you don't need to use it. I use VREF. As for XCLK generate it with fast PWM and use a buffer to get it from 5v to 3.3v

Just a few basic follow up questions.  

How do you buffer the the XCLK?   Is it just simple voltage division with a pull-up resistor?  
How do you drive the XCLK using PWM?   What is the connection/code?

Sorry for the redundant questions, thanks!


Jul 04, 2014, 05:18 am Last Edit: Jul 04, 2014, 08:48 am by vvavepacket Reason: 1
Hello, how do I remove the white glare in my face?

Heres my register setting

Write(0xb0,0x84); //adding this improve the color a little bit


Heres the second image

The background looks ok but my body and my shirt is full of brightness, we cant see details (unlike in the back). Any suggestions thanks?


Is this item good? I think there are variations of OV7670 with FIFO buffer


What do you suggest when someone is looking for OV7670 with FIFO?


Alright I will answer both vvavepacket's two questions and TeamAlpha's question. I will be going in reverse order by post.
First of all you can get the same thing for cheaper http://www.ebay.com/itm/640-x-480-VGA-CMOS-AL422-3M-Bits-OV7670-FIFO-Camera-STM32-Driver-Module-I2C-/161333211986?pt=LH_DefaultDomain_0&hash=item2590357352
they both appear to be at-least similar.
To fix the glare you are going to have to first of all make sure that bits 7 and 6 in register 0x40 are set to one by default (according to the datasheet) they are set.
Also make sure register 0x55 is set to 0 (brightness should never be changed using this register)
and that register 0x56 is set to 0x40. (Contrast should not be changed like this).
if you want a different brightness you should instead vary the exposure and/or gain settings. It may be that the ov7670 is picking the wrong exposure and gain settings if that is the case the https://github.com/dalmirdasilva/ArduinoCamera/blob/master/CameraAL422B/datasheet/OV7670%20Implementation%20Guide%20%28V1.0%29.pdf explains auto exposure and auto gain best.
There are some undocumented registers that I have pulled from various places. I just write all those and end up with a nice looking image. I wish I could find out what all the registers do. Is that all the registers that you are writing to the ov7670?
I have attached some pictures I have taken with the ov7670 to show you the quality that can be achieved with better register settings.

@TeamAlpha I have not tried a resistor voltage divider. I have heard that resistor voltage dividers may be noisy so look at the output using an oscilloscope. I just use a buffer IC chip. Also to generate the XCLK clock you need to use PWM. The way you set this up is slightly different depending on which microcontroller you are using. If you could tell me what you have I can further help you with this.


Which should we get, version 1 or version 2 of fifo version?


The difference is minor and is more of a preference issue you can read about the difference here http://wiki.beyondlogic.org/index.php/OV7670_Camera_Module_with_AL422_FIFO_Theory_of_Operation
Also any luck improving the image quality?


Going to try when i get home. I feel sad since i cant get a good capture as you do. Bpught 2 sensors of non fifo version woth same rrsults

Go Up