$10 camera module for your next FPGA project

Here is [Voelker] showing off his FPGA-based camera hardware. He picked up an ov7670 camera on eBay for about $10 and set to work pulling pixels and processing the images. He’s now able to grab thirty frames per second and push them to his own Java display application. He’s using the Papilio board and if you want to give this a try yourself you might be able to snag a free breakout board (wing) for the unit.

[Voelker’s] approach is to grab each frame, and get it ready for quick serial transmission. The incoming frames are at 640×480 resolution. He scales that down to 80×60 and transmitted at 3M baud. The hardware resources used are actually quite light-weight. He wrote his own modules for transfer and photo processing using very little RAM for downscaling and one 128 byte buffer for data transmission. It sounds like he plans to use the camera to view and detect a line to create his own line-following robot.

Wondering where you’ve seen the ov7670 module before? It’s the part used on the TRAKR robot.

Comments

  1. hboy007 says:

    recently bought a bunch of Samsung AU-85 camera modules (containing a Biomorphic Bi8921 2MP sensor with on-chip jpeg compressor), they can produce up to 12 fps at 1600x1200px. Nice to see someone actually uses this stuff.

  2. Joe Pitz says:

    Looks like the pcb’s were long gone as of yesterday’s post.

    Looks like a ploy to get everyone visit the site and have to pay for a board.

    • Jack Gassett says:

      Hello Joe,

      I can certainly see how it might seem that way. But I actually sent out the last PCB about 4 hours ago. As soon as I sent out the last board I changed the original blog post to say there are no more boards. It’s not a ploy to sell more boards because I don’t HAVE more boards to sell. 🙂 I was giving away boards from a small order of 10 boards I got from Seeed’s Fusion service. We designed the boards months ago and ordered a test batch so I had them sitting around on my desk. When voelker posted his code I was actually surprised that it was for the same module we had been looking at and I figured I’d give away the extra boards since I only need two of them on hand. 🙂 Maybe with more work and verification we will be able to offer boards for sale. But for now all I can offer is the Open Source EAGLE files if anyone wants them. They are on github at:
      https://github.com/GadgetFactory/Papilio-Wings/tree/master/BPW5032%2016-bit-OV7670%20mini%20Camera%20wing

      Anyway, I hope you understand that the boards were not offered with any ulterior motive. I’m just glad to see voelker get exposure for his work and that some people get a free PCB too.

      Jack.

  3. Hackerspacer says:

    I may be wrong here but why are we taking hardware that can do 640×480 and downsampling it considerably to use it to follow a line? Why don’t we throw more processing power at it and capture at 40+ megapixels and then perform sophisticated image analysis software algorithms on it to allow a robot to do far more than simply follow a line? Perhaps bipedal motion, more complex kinesthetic applications – that sort of thing?

    Is it the cost of hardware (both physical and monetary) that is holding us back? $25 arduinos and cheap cameras are amazing, sure, but do we need things like multi core ARM boards for $35 (raspberry pi I am looking at you) that can be aggregated together to perform some serious numbers crunching before we see somewhat of a revolution in hardware / software / robotics? What does it take?

    • andres ortiz says:

      because you walk before you run

    • colecago says:

      My guess is downscaling it for the serial transmission. With 60×80, 30 fps, 12bit color, you have 1728000 bits per second and that doesn’t include framing bits, error corrections, location bytes etc.

    • Senso says:

      So, have you ever done any image processing to know how intensive is that?
      Usingan IGEPv2:
      http://www.igep.es/index.php?option=com_content&view=article&id=46&Itemid=55
      That is way more powerfull than a RaspberryPi(really stop all that hype crap about this, its cheap because it is slower than an android from the last decade…) and I could only do 15 fps when segmentating a 640×480 image in 6 or 7 colors.

      • Voelker says:

        The reason i started using the papilio is because i try to perform basic vision processing on the beagleboard and i was only getting 10~15 fps. With an fpga you can pipeline your vision processing at the pixel level (or 8×8 block) and thus reach far better performance. It may be more difficult due to development complexity, but the goal of this project is to provide a library of operator you can connect to form your processing pipeline (like you would with opencv).
        One of the thing i also plan to do, is to connect the papilio to the beaglebone (through the GPMC port) to perform more memory hungry tasks.

      • nmz787 says:

        Senso, I’ve used similar products with an OMAP or DaVinci processor for image processing, and can easily do 50-60 fps with a few megapixel camera… sobel filtering, thresholding, floating-point math

    • Daid says:

      The PI is sponsored by broadcom. It’s almost impossible to produce an ARM board for that price, with enough ram/flash to run a full blown linux setup.
      Drop the linux requirement, and you are down to microcontroller prices: http://www.watterott.com/en/STM32VL-Discovery
      But you are also down to microcontroller speeds/ram/flash.

      • Senso says:

        There are already Cortex M4 ARM’s running at almost 200Mhz, and at more than 200MIPS, add some ram, and with no OS you can also do some pretty interesting thing, and the M4’s have FPU so, doing floating point is as fast as fixed point(1 or 2 clock cycles).

  4. marcus says:

    for those who wanna to buy his 1st ov7670 ..

    ov7670 is cheap (if u think US$10 is nothing) but not that easy to use.

    if u use it as a toy, (i.e. not care about the color, not care about the white balance..etc) then it is OK to use it.

    the doc are outdated, miss leading ..

  5. marcus says:

    for those who wanna to buy his 1st ov7670 ..

    ov7670 is cheap (if u think US$10 is nothing) but not that easy to use.

    if u use it as a toy, (i.e. not care about the color, not care about the white balance..etc) then it is OK to use it.

    the doc are outdated, miss leading ..

    good luck!!

  6. Voelker says:

    Hi,

    i’am downsampling the image just to send it to the PC. The max speed of the UART is 3Mbaud and transferring full frame @ 30hz Y channel only would require 72mbit/s. By downsampling to 80×60 the bandwith is reduced to 1.152Mbit/s. The only purpose of down sampling is to have a preview for debugging. The frame processing i intend to do inside the fpga will be performed on a full frame. I have nearly completed a convolution operator i plan to use for sobel filtering (first step to edge detection).
    For those who want to try, you can find some ov7670 module that include the 3.3v voltage regulator and can communicate at 3.3v. This kind of module fits directly into the papilio header, you just need to connect the power rail your way (i’am using some stripboard).

  7. roliver says:

    Using 7670 + FIFO Buffer module at the moment in a project. It is, without a shadow of a doubt, the most awkward thing I have EVER had to use. From confusing datasheets and revisions to a hacked up I2C bus that they call SCCB, I really couldn’t recommend it.

  8. Voelker says:

    Hi,

    i did not read the full datasheet in the first place. I juste looked a the signal timing. All the register configuration was performed using values taken from ov7670.c in the linux kernel. The SCCB bus looks fine to me, no problem with it so far …
    I understand that the ov7670 is not the best sensor but it’s cheap.
    The best sensor for my application would be the MT9V034 from aptina (global shutter, HDR) , but i cannot find a (cheap) module for it.

  9. hechao says:

    I got the camera module here for only around $9, looks pretty good. http://www.electrodragon.com/?product=ov7670-camera-module-breakout-board-power-cable

  10. desaster says:

    Finally managed to get my ov7670 working using a microcontroller and the non-FIFO version of the camera. A small writeup here:

    http://qrfnfgre.wordpress.com/2012/05/07/ov7670-camera-sensor-success/

    Maybe someone finds this useful one day.

Speak Your Mind

*

Related Hacks in Microcontrollers

  • Morse Code interpreter
  • One wire reads the keypad from the APRS radio mic
  • Level conversion with plenty of options
  • Music visualization generator with a Propeller
  • Metal detection using an inductor instead of a clock crystal.