Go Down

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


Thanks, that's very helpful. I'd thought that the D0..D7 signals would need shifting and so lots of converters would be needed, but that's simplified things a lot. Still waiting for my camera to turn up.


The connections will be mostly the same but it could be abit different as I do not own the one with the fifo I am not sure but I think instead of PCLK you use RCLK and and RCLK is output you strobe that to get data. Check you this for more info about the fifo version http://wiki.beyondlogic.org/index.php/OV7670_Camera_Module_with_AL422_FIFO_Theory_of_Operation Also you could try a resistor divider but I have heard that they are too slow you may need a buffer/level-shiftier. Also this would not require the ram as you have the fifo.

I think there has been a misunderstanding. My camera is without fifo...


I think there has been a misunderstanding. My camera is without fifo...

So is mine so will need the same connections as I use and the external sram. Also the reason d0-d7 not need shifting is the arduino will never drive those pins so it is up to you to make sure that those pins are always set to input on the arduino.


Hi, i have the ov7670 camera, an arduino uno rev 3 and ST M27C512-12F1 Eprom. Is it possible to take pictures with these components? and if so, how do i connect them together. i have seen that you used the spi ram, can i replace that with the eprom??
Please assist me on how to connect the arduino, camera and the eprom together to give me a picture.


This is the old school eprom with UV erase. There are several reason why this would not work. First of all how are you going to erase it in a reasonable time. Even if you had a UV led driven by the arduino it would still take awhile to erase and UV is bad for your eyes so you would need to cover it with something. Also you would not have enough pins are the eprom is parallel. Also how fast are the write speed will it even accept data fast enough. Another problem is that you would wear it out fast. Eproms only have a certain amount of writes (They do have unlimited reads though). Also this Eprom has only 64kb of memory you would have to break the frame up even more which would reduce performance even more. In short the Eprom would not work for this purpose save it for repairing a bios or make your own NES cartridge or do something fun with it but not in a camera. Just buy or sample the 23LC1024 it is kinda cheap at $2.59 if you only order one at digi-key and you will not regret it. It is even in dip package. The dip package one is called 23LC1024-I/P by the way


Clearly getting the eprom was a wrong move. My other option(or idea, but might not be a very good one) is to connect the camera to a SIM5216E 3g shield. the datasheet indicates that its possible to connect the camera pins on the shield but the pins are marked 'NC'.
this is the shield i have ftp://imall.iteadstudio.com/Shield/IM121026002/DS_IM121026002_3G_Shield.pdf
this is its schematic ftp://imall.iteadstudio.com/Shield/IM121026002/SCH_IM121026002_3G_Shield.pdf
Could i connect the camera to the shield instead of using the arduino directly?


May 12, 2013, 01:10 am Last Edit: May 12, 2013, 01:13 am by hlankoande Reason: 1
Hello Mr_arduino
I have planed to use the OV7670 camera module to capture picture with arduino mega 2560 R3. I m using it to drive à robot and get few data from robot.
I m using arduino programming IDE to write code.
The code you gave is compiled with another compiler and as I do not have deep kwnowledge on this it is à liltle bit hard for me.
Is it possible to give us(I guess I m not alone in that case) a hello world example to capture picture and store it in an array( in order to save it in SD card or send it other serial) written with arduino IDE.
Thanks à lot in advance.


hye...i wanna ask if this camera is same with JPEG TTL CMOS camera???


I made some code for the arduino mega awhile ago check it out it uses the arduino ide
It is no were near the jpeg TTL camera. The Jpeg TTL CMOS camera is way easier to use but cost more money.



I have the same problem with OV7670 v2 + Mega R3, a lack of experience stops me to get those things work together..
Mr_arduino it would be really great if could share the code and wiring with us?

Thank you.


I think the 74HC245 would work just fine also a unidirectional one would work too. Pretty much any buffer that is fast enough to handle a 16mhz signal and can accept 3.3v as a supply voltage which the 74HC245 can. ... Only the clock signal needs to go though the buffer as that is an input and the sd card if you are using it.  From twi just disable internal pullup resistors and have them to 3.3v instead of 5v...

Hello, I'm trying too to get the ov7670 communicate with Arduino UNO.

I read this post a week ago, I bought some 74HC245 but I realized they are not fully bidirectional, you have to choose the direction using a pin. So they can't be used with SIO_D and SIO_C, as far as I know. As I'm reading this post again, I guess A5 and A4 pins, using the code supplied, will output 3.3V instead of 5V (assuming internal pullup is OFF). Am I right?


It said in the post it does not matter if they are bidirectional or not. Also you do not need a buffer for i2c if you disable the internal pull-up and make sure that you have the pull-up resistor to 3.3v.


Mr_Arduino, thank you for your response.
I managed to connect SIO_C and SIO_D, I also changed atmega fuses to get the CLKOUT at pin 8. Yet, I don't have extra RAM chip and right now the only thing I want to do is checking if the ov7670 is responding.

  • What's the simplest way to know? Let's say using and oscilloscope.

  • Is it possible to capture an image from the sensor right into the SD (without a RAM)?

Thank you again!


First verify that CLKOUT is correct connected to the buffer and the output from the buffer does not exceed 3.3v and is correctly connected to XCLK then verify that with an osciloscope (you should see a square wave) after that see if SIO_C and SIO_D work it may just be a quick burst but that is normal. Then see if you get a most square wave from PCLK there should be a very brief burst where PCLK stops every so often. This is because by default the ov7670 outputs unwanted dummy pixels that serve no good we don't want those dummy pixels. If PCLK never stops it may not be communicating properly but the part where it stops may be too fast to see I can not remember off the top of my head.


Thank you!

I'm doing better now. Yet it isn't working. I had a communication problem between Arduino and the sensor. Now that's working and I'm able to configure the sensor. I'm having a somewhat coherent reading. I read 512 bytes blocks from the sensor, but I get blocks of zeroes every two or three blocks.

I'm configuring a 3MHz PCLK but I guess it's too fast for arduino. What do you think?

Go Up