Version 1

    Hi,

    Im in desperate need of some help for a project I am doing.

     

    I have managed to get to servos controlled by a joystick and attached them to a pan/tilt arm,

     

    But need to get a camera module (this one: VGA OV7670)

     

    to relay its footage to a LCD TFT Display.

     

    (this one: 2.2" 18-bit color TFT LCD display with microSD card breakout - ILI9340)

     

    Im really don't know what I'm doing with it and would love some help/guidance on it!


    I've looked all over the internet for help but really can't  get my head around it, I'f anyone was able to provide me with the coding and circuit details for this it would be so helpful!

     

    I can't thank you enough if your able to help,

     

    Nate.


    balearicdynamics can you help this gentleman? Thanks, Clem


    Hi Nate,

     

    I took a look to the camera you plan to use but frankly I have not clear what do you aim to reach. Please can you give me more details about the whole project (or at least the part of the camera)?

     

    • The footage should be processed in someway of the microcontroller is only used to move the device with the servos?
    • you wan to monitore the Live signal of the camera or record the footage somewhere then play it on the LCD ?

    Thank you


    Hi Enrico,

    Thanks for taking time to help me out,

     

    • I plan to use one thumb joystick, which when moved, moves a pan/tilt bracket that is driven by two servos. - I have successfully managed to do this part.
    • Attached to the pan/tilt bracket I want my camera module, which will relay live video footage from the camera module to the LCD screen.

     

    I am using:

    • Arduino Uno
    • 2.2" 18-bit color TFT LCD display with microSD card breakout - ILI9340 (Adafruit)
    • VGA OV7670 Camer Module Lens CMOS 640x480 SCCB Compatible W/ I2C Interface

     

    Does this help with the understanding anymore?

     

    Thanks again,

    Nate


    Nat,

    in this moment I don't see your last replay to me that I have been notified by email. But what I mean is: what is the connection block of the components? Please can you write down (also on trash paper ) a scheme idea where the signals should go? The camera you mention in theory should be connected to Arduino, as well as the LCD but you want that Arduino driver the signals form camera to lcd? Or whatever else? Just for my better understanding of this part - and for a general clarification - I think it will be a good idea to write down a block diagram to be sure we are on the same page.

     

    Thank you.


    Thank you Enrico.


    Enrico,

    I'll resend what I sent before in case you didn't receive the reply I sent:

    "

    • I plan to use one thumb joystick, which when moved, moves a pan/tilt bracket that is driven by two servos. - I have successfully managed to do this part.
    • Attached to the pan/tilt bracket I want my camera module, which will relay live video footage from the camera module to the LCD screen.

    I am using:

    • Arduino Uno
    • 2.2" 18-bit color TFT LCD display with microSD card breakout - ILI9340 (Adafruit)
    • VGA OV7670 Camer Module Lens CMOS 640x480 SCCB Compatible W/ I2C Interface

    "

    I have tried to draw up a sketch of what components I have. I don't know if I would need to connect the camera to the LCD screen, or if the information would be carried another way?

    img026.jpg

    Also here is a diagram for just the servos being controlled by the joystick that I have managed to do:

    Arduino Sketch - JoyStick_bb.jpg

     

    Also incase you need to know about either of the parts:

     

    Thank you again,

    Nate


    thank you. As I am back to home I replay in a decent way


    Take a look at this post at the arduino forum Interfacing arduino with ov7670


    Ok, thanks Enrico,

     

    I will do Dimitrios!


    Hello Nate, sorry for the delay.

     

    Well I have read in detail the information about the camera you are using and also the link of Dimitrios is useful. As for what I see, the camera can be connected to the Arduino. From you scheme (really useful, the old good paper sometimes saves the situation) I see that - correct in my opinion - you are making an Arduino-centric  project. The camera can be connected and through the serial it is possible to acquire images. Take a look to the following link: OV7670 Camera Module DIY Guide Here are explained the details and - more important - also a library and an example.

     

    My suggestion is to "disassemble" the global project and start setting the camera, testing and checking if the image data (with or without Arduino digital processing) can be saved on the SD card. Then we can analyse the visualisation part (that I think can be done too). Let me know if you have problems following the camera module guide and keep me updated.

     

    Good luck


    Hi Enrico!

     

    • I have tried to download the example code from the OV7670 Camera Module DIY Guide (Its downloaded by clicking on the 'code' hyperlink in the first paragraph). However, I can't open it using Arduino, I've tried to search for software to open it with but haven't had any luck? and I being stupid? haha. It is a .rar file and I'm not sure how to import that library?
    • Also having looked at the drawing for connecting the camera I have a problem..

    Screen Shot 2015-04-09 at 18.36.45.png

    My camera module has the outputs:

    11091335_10152913090494608_1028855006_n.jpg

    I am therefore confused as to what i would need to connect up.

    • Another thing. I didn't want to use the SD card at all. my idea was to just send the live camera footage straight to the LCD screen, would that be possible?

    Thanks again for all your time! Its much appreciated.

    Nate.


    i cant open the .rar because i have to install a program (Debian here) but this may help u http://www.elecfreaks.com/7861.html please tell us what files are inside the .rar . It is very easy to import a library. Go to your arduino folder -> Libraries and copy paste the library folder from your .rar 


    Hello,

     

    no problem, you can download unrar for free almost everywhere on the Internet. Anyway, I have unzipped, unrared and recreated the zip file. Let me know if this works...

     

    The download link is here : http://ge.tt/251hU9E2?c

     

    Good luck


    Hi!

    Thanks Enrico and Dimitrios!

    I have successfully imported those libraries!

     

    • Have you any idea what connections i would need to use to follow this http://www.elecfreaks.com/7861.html
    • Here is my OV7670 Camera and my LCD Screen ( the LCD Screen has a built in mircoSDcard so can i use that as the SDcard and forget about the screen for the test)?

     

    Thanks!

    Nate


    I just saw this thread, but I can't see any (reasonable) way to stream live video using the components you have - not even at 1fps most likely!

    Better to ditch the camera and LCD display since it is not possible, and replace with a composite output cam and a composite input TFT display and bypass the Arduino entirely.


    Nate, I don't agree 100% with shabaz about the idea to abandon Arduino but I think that you are trying to go much than the limits of the microcontroller (20MHz, 8bit ) The option to send "something" with a certain frequency to the display maybe meaningful, but all depends what is the frequency of your frames. Sure you can't broadcast a direct "live" to the scree. What is the exact goal of the entire project ?

     

    In past I have worked with the Nokia 3 inches LCD color display connected with Arduino. It was nice and it was working but the refresh frequency was of the order of tenth of seconds, very far from 15 or 25 frames per second. What I think maybe possible, with serious difficulties, is a time-lapse acquisition and a live image processing, where the raw data from the camera are processed by the micro-contorller despite its visualisation.

     

    Let me know some details, if possible.


    Can this camera work with the raspberry pi??


    Hi again,

    The project is just a personal one, where by i need something working to some standard. Im a student and have to create an Arduino based product. It doest need to be of an exact live feed that the LCD displays, it could have a refresh rate of tenths of seconds, as its just a personal project.

     

    I am sadly not very wise in this area (Arduino) so i didn't know what was and what wasn't possible with these components, I would be more than happy if I were able to get an image every half second or so, of the camera and for that to display onto the LCD Screen.

     

    Thanks,

    Nate


    Frankly, as for my experience with arduino I think that accepting this kind of frequency it is possible to send something to the screen. And found some real world application too (low frequency image grabbing, image processing for contour extraction or some other simple yet useful application.

     

    Anyway I suggest to follow the steps one at a time: before connect the camera and get some image etc. Then when the camera is ok and the sketch is working, we can discuss about the display.


    Ok, I will try and break it down into smaller tasks and complete one by one.

    A question about connecting the camera module though:

    Screen Shot 2015-04-09 at 18.36.45.png

    However my OV7670 camera module has ports as seen in my image:

    11091335_10152913090494608_1028855006_n.jpg

    If you could give me some guidance that would be great,

    Thanks again balearicdynamics !

    Nate


    Ah. The diagram expects a UART (TX<=>RX) whereas the camera is raw data. Normally you would need a controller to take raw and convert to UART. Two options:

    • Get a circuit board that handles reading raw mode. This is preferable and doable.
    • Connect the board to Uno with as many as 12 pins or more (picture not clear) and program at the bit level. If you search you may be able to find a library which would save time.

    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.

    camera 0706 A

    Clem


    Sneaky #$%#% showing module with UART and selling one without. It is important to compare the pictures and see the details before hitting the buy button.

    Clem


    Clem, I have looked at the diagram. What I see is that there is a scheme connecting two different dvices: The pins 122, 12 etc are related to the SPI (essentially the same pins used to program the AVR328p without the bootloader. This has nothing to do with the camera, as for as I know. It is used - I have already used in past - to connect the memory card.

     

    Instead the camera should be simply powered and connected to the pins 0 & 1, alias the serial connection: what is this device is a serial camera so it works via the UART on the board. Don't you agree ?


    Hello again

     

    The shit of the thread respect the camera you have is that they bought too the camera controller, that is the piece of electronics able to convert from RAW to serial connection. Where did you bought the camera ? Maybe they have also the controller mentioned in the thread ... If you can buy it for few $ I think this will be the better solution in absolute.


    Hello,

     

    I kind of understand, so I need to purchase a component that converts RAW data from the camera to serial connection? It there a name for this component?

    I bought my camera module from eBay http://www.ebay.co.uk/itm/181597821467?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

     

    Sorry for my lack of knowledge!

    Nate


    Just some more in-depth investigation through the Internet ....

     

    First the Arduino article is IDENTICAL to the original published by the producers. you find it here: Camera_OV7670 module DIY Guide |

    I suppose that nothing has been added, including no one test. The same mistake to speak of the camera connected via UART and showing and selling the device with the RAW Bus is repeated exactly as-is

     

    The camera is sold (where I suppose you bought) here OV7670 Camera Module [EF10021] - $16.50 : ElecFreaks Store and they sell the camera exactly with the same specification you show in your image, explicitly declaring that support RAW bus in several formats: RGB, YUV and so on. I disagree the sites that didn't put a technical information datasheet but this is. So, up to now you have what you bought and the article miss a fundamental step: the bus to serial converter.

     

    Some informations on the method but not something more detailed and clear as a circuit scheme can be found here: ov7670 camera sensor success! | desaster's blog Interesting that disasterblog publish also the link in github where he uploaded the software, unfortunately written in Python but useful to take a look to the logic (https://github.com/desaster/ov7670test)

     

    I have found - that is what I will adopt if I were you, because the solution seems me more robust than the serial connection granting the better possible frame speed - someone with a similar problem than yours. The suggested solution and discussion thread can be found here: http://arduino.stackexchange.com/questions/6647/ov7670-sd-card-arduino

     

    At this point from stackexchange you find the link to - FINALLY!!! - a decent project with photos, examples and probably something that can be done by you with a breadboard and no more complex converters or electronics etc. So, take a look to this link (and the others found on stackexchange) : http://nicolasfley.fast-page.org/?page_id=35

     

    Insisting to use the serial (Tx/Rx UART) streaming instead, take a look to the following two links: https://youtu.be/i2dv3xAUYN8 and https://thinksmallthings.wordpress.com/projects/camera-tracking-system/

     

    Let me know if you find something useful.


    Complete information worthy of a blog. Thanks Enrico.

    Clem


    Clem, I really hope will be useful to the guy.


    Thank you these links seem very promising!

    I'll look in depth at them tomorrow and contact you if I have any queries,

    Thank you so much!

    Nate.


    Hi Enrico!

     

    Looking into this link you sent: OV7670 + fifo | A french student website

    And he links a successful code: https://github.com/arndtjenssen/ov7670

    From looking into this setup, am i correct in thinking I need to purchase one of these: AVR ATmega1284p

     

    Thanks!

    Nate


    Hello I take a look in depth and as the author mentions that applied something to change the standard Arduino to work with 1284p - that is as a matter of fact a bit more advanced microcontroller than the 328p - I suppose it can work the same with the standard Arduino, if you already have.

     

    If you find problems like needing more pins than those available let me know. I know that processor and I worked with one but at the actual date it seems me that Arduino with 328p can work as well. The only problem, repeat, is if are needed more pins than what expected. In this case we find a way to solve (I already have an idea but not yet tested so for now ignore this). Let me know the progress and we see what's happen.

     

    Ciao


    Hello,

    So looking at his breadboard diagram:

    "Breadboard diagram (black text: OV7670 wiring, blue text:TFT wiring): ov7670_breadboard.pdf ATmega1284p wiring: ov7670_ports.h"

    Screen Shot 2015-04-11 at 17.51.56.png

    This is with the ATmega1284p. So if i don't need this, how do i connect up my camera and SD card?

    Thanks again,

    Nate


    balearicdynamics


    Hey Nate !

     

    thanks for the mention Today is a hard day (it's Sunday but hard day anyway...) I am on the move but I have read the last. I will put the hands on it tomorrow, I should check a couple of things...


    Hi balearicdynamics I am still trying to make progress on my Arduino project, and will be picking up tomorrow morning these two items I bought:

     

    • ATMEGA1284P-PUATMEGA1284P-PU8 bit AVR Microcontroller 20MHz 128 kB 4 kB Flash 16 kB RAM I2C 40-Pin PDIP
    • ATMEGA328P-PUATMEGA328P-PU8 bit AVR Microcontroller 20MHz 1 kB 32 kB Flash 2 kB RAM I2C 28-Pin PDIP


    I am trying to follow the blog you sent me to:OV7670 + fifo | A french student website


    Can you help me understand this image:

    schema_arduino_FIFO_OV7670-2.png

    What is the voltage bridge? Is it a physical thing?

    Also he's using a OV7670 camera with FIFO, however mine doesn't have this I believe. Is there a way around this?

    Thanks, Nate.


    I have also just found this forum which seems interesting OV7670 - Without FIFO - Reading Snapshot from Arduino

    In this i have just found

    " I wrote email to Shenzhen LC Technology Co., Ltd. who is the producer of my ov7670. They provided me some materials which I also can't process due to poor comments in the code/documentation, usage of LCD, SD card, etc which I'm not planning to use.

    Documents are here: https://www.dropbox.com/s/2xv0bn9lepqmsjy/OV7670%20module.rar "



    Hello Nate,

     

    sorry for this missing but I was trying to complete a couple of other things ... I took a look to the circuit in the image. To be honest I am always more convinced that the fact that the reference was for a different micro than 328p just because it is what the guy had. Consider the following:

    1. Better solutions are always simple including the possibility to use what is already in your hands. You have an arduino Uno or a board based on the 328p, right ? So iin your case the first thing I will try is to use it.
    2. follow the logic: 1284 and 328p a similar, same family and works at the same speed (20 MHz); there is not an incredible usage of the board pins to really justify the usage of a bigger (not so more powerful) processor, at least to manage the camera (but at the moment I think that it is possible to manage all the components you wan to put together with a normal 328p)
    3. The camera in the schema - you have the same - is connected through the SPI pins to the microcontroller. And it is what you can do with Arduino.
    4. If I am not wrong the voltage bridge (the word "bridge" makes confusion but this is not a bridge component, I think) is the set of 4 resistors that in theory will align the power shared to the camera from Arduino. Maybe that creates problems, and this may depend (very probable I think) by the not perfectly calculated resistors values, the fact that probably it is using a breadboard that is not properly a circuit and has its own limits and many other parameters). For now, don't matter, focus one problem at a time and try this connection. Nothing explode, the worst case is that it does not work at all. But most of the progresses are based on deductions from errors and issues.

    I suggest you to try this schema applied to the arduino pins and see what's happen.


    Hi, you say that the camera in the schema is connected through the SPI pins to the micro controller, however his pins aren't the same as mine, so I am confused by that.

    Here are my pins:

    11091335_10152913090494608_1028855006_n.jpg

    I can not understand what pins are needed, Thanks for your help.

    Nate


    Hi Nate,

     

    Your camera (the one in the photo) has no buffer, and requires all pins connected as you suspect I think. Basically a couple of the pins are used to program the camera (over a serial interface) to select resolution etc., and the remainder pins form a parallel bus that send the raw video data output. Your code needs to sample the data on some clock edge (i.e. pins like PCLK, and the SYNC pins). This happens are a fairly high speed so initially you'll want to select a low-res image (e.g. QCIF, if the camera supports it). Also a fair amount of storage is needed (i.e. x resolution times y resolution bytes per frame for an 8-bit (256 color) image).

    For these reasons I'd still suggest a composite camera and composite TFT if you don't need to store or manipulate the image. If you do need to store or manipulate the image, an RPI and associated camera would be pretty good.


    This document was generated from the following discussion: Trying to use a camera module to show footage to a lcd tft screen