SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By brijesh
#145232
Hello,

This my attempt at discussing an idea I have and hoping that you will engage in the discussion and give some valuable advice and feedback.

There is lot of interest in the community for using vision in their projects. There has been lot of enthusiasm and activity with VGA CMOS sensor available right here at Sparkfun. But so far there appears to be no vision module that is ready out of the box for some standard application, like color tracking. The closest product I could find was AvrCam (http://www.jrobot.net/Projects/AVRcam.html), but the original developer is no longer selling the product.

The CMUCam4 (http://www.cmucam.org/projects/cmucam4) is interesting, though I am not aware how ready it is out of the box. Plus it is more than $125 and right now available only through distributors from Europe.

With recent release of STM32F4 microcontroller it has become easier than ever to interface with CMOS sensor. The STM32F4 has hardware peripheral to interface with image sensors. This is an exciting development. We have the power of DSP processor with floating point and necessary peripherals to easily interface with external world, like a regular microcontroller.

Would a open source project to develop a low cost vision module based on STM32F4 be of interest to you?
What kind of features and interface options would you like?

I am excited and enthusiastic about this project. Is anybody else out there that is interested as well?

Cheers

Edit:
Few slides about the project: https://docs.google.com/presentation/d/ ... UN_LA/edit
Last edited by brijesh on Wed Jun 06, 2012 11:27 pm, edited 1 time in total.
By Duane Degn
#145285
I've been interested in some sort of machine vision solution for microcontrollers for a while.

I've collected a few links to Propeller (the CMUcam4 uses a Propeller) machine vision projects I've seen.

I tried Hanno's method of using an 8-bit ADC to capture B&W video from a NTSC camera. I even displayed a very low res image capture on my 12 x 10 LED array.

Image

I'm holding the camera in my finger in the top left of the above picture. The image of the word "HI" is being captured my the camera/ADC/Propeller and then displayed on my LED array. It looks better in real life because a little motion makes it a lot easier to see the shapes displayed on the array.

I found the CMUcam4 available in the US for $138.45. It's really not inexpensive, but it's also not excessively expensive. I'll probably purchase one myself. I haven't found the camera it uses for sale on its own.

The limited memory (32K) of the Propeller, makes capturing and displaying a high res image a problem. I've wondered about using external SRAM to store images. I know it's possible to display images with the Prop from external memory, but I haven't been able to figure out a way to capture and display images to/from SRAM with a Prop (I haven't tried very hard yet).

If the memory issue could be solved, the Parallax Laser Range Finder could also be used as a uC camera. The camera used by the LRF is available at Digi-Key. You have to sign a NDA in order to get the datasheet though (dumb policy IMO).

I'm not familiar with the STM32F4 microcontroller so I don't know what benefits using it over a Propeller would have.

I look forward to reading about any progress you make with this.

Duane
By skimask
#145291
Duane Degn wrote:The limited memory (32K) of the Propeller, makes capturing and displaying a high res image a problem. I've wondered about using external SRAM to store images. I know it's possible to display images with the Prop from external memory, but I haven't been able to figure out a way to capture and display images to/from SRAM with a Prop (I haven't tried very hard yet).
Then don't use an SRAM. Use an FRAM...
http://www.ramtron.com/products/nonvola ... erial.aspx
SPI interface, run as fast as I can fire off the data, small, SMD only though.
A bit on the spendy side, but you can request 'samples' of them for $0. I got a few that way.
By brijesh
#145305
Hello Duane,

wow..quite impressive what you did the camera and LED display. Must have taken you quite time go get it all working. My basic idea is to eliminate all that work and develop a module that people can use out of the box. Spend time working on idea rather than no getting the vision working.

As for advantages of STM32F4 vs Propeller
1) 198KB ram vs 32K
2) 198 MHz vs 80MHz
3) Floating point Unit Vs ??
4) Standard C programming vs Spin language
5) Target price $75 vs $138

Most important
5) Camera Interface Peripheral vs have to use Cog and write low level code to capture image.

As mentioned by Skimask, don't need external memory like SRAM or FRAM. Leads to reduced cost.

I am working an schematic will share it once it has some level of information.

Cheers
brijesh
By mng2
#145554
I agree that there is a need for a low cost vision module. Realistically, though, I think the CMUcam4 is going to be hard to beat at this moment in time. But I am interested to see the particulars of your design.
By brijesh
#145604
I agree, CMUCam4 has nice set of features and would be difficult to best it. But believe that STM32F4 processor would give us a ability to do things that are difficult with Propeller. The advantages I mentioned in previous post should give us ability to differentiate and provide a compelling option to CMUCam4.

I have put all my ideas into a presentation.
https://docs.google.com/presentation/d/ ... UN_LA/edit

I have started schematic design. Lot of work still needs to be done but sharing it as it stands today.
https://docs.google.com/open?id=0B9g-44 ... XhUN2liLWM
By brijesh
#145873
Just an update. I have almost completed the schematics and uploaded the latest version.

https://docs.google.com/open?id=0B9g-44 ... XhUN2liLWM

Couple of things.
1) Pin out of various camera module is not the same. Some have pin one on left side, others on the right side.
2) Some module require 1.8V where as others have built in regulator and just need capacitor.

I am planning on using this module, unless you guys have a better suggestion.
http://www.ebay.com/itm/640-x-480-CMOS- ... 627wt_1163
By gclaudiu
#145976
Hi there! I tried this path and is too expensive mostly because of dedicated board, IDE and programmer (used LPCxpresso board). For a mass production may make sense but for a small batch is too expensive. I end up using AVR micro controllers and AVR Studio instead. My custom board use either Atmega8 or Atmega328 and is able to communicate with the OV7670 FIFO module available on ebay quite cheap from China (15$+ maybe?) this way any micro controller that can handle 1 external interrupt and have 10 IO pins available (2 SCCB + 4 command + 4 data) can do the job.

While Atmega chips are not that cheap (5$ maybe compared with only 1$ for some ARM Cortex chips), can still bring down the cost of the components to bellow 20$ for a module that will be able to communicate with a standard OV7670 camera module (7$ maybe?), do a basic color segmentation (1 blob) and dump the details over serial port at 30 FPS. Using a more complex algorithm that will allow detection of 16 blobs of the same or different colors can be done at 10 to 15 FPS by skipping 1 or 2 frames for each frame captured. I guess writing it in assembler will make it even faster.

Back to the discussion, I'll not consider Propeller for such project as you will need to be able to track at least 2 external interrupts (VSYNC, HREF and maybe PCLK?) and Propeller can not make it. Using any ARM micro controller will make things much easier. There is no need for such large amount of memory for a simple color segmentation, processing the information at the end of the line will only require enough memory to store a single line and space to store an array that contains information for each blob, so even 1-2 Kb RAM is enough unless you want to implement complex motion detection and navigation algorithms which does not seems to be the scope of this project in the first place.

Anyway, for 140$ only the cost of the board will set your project to a very high price, if you look around there are other options available bellow 200$, maybe a bit limited, but let's be frank, color segmentation is very limited anyway... Good luck with your project!
By brijesh
#146147
Hello
gclaudiu wrote: I end up using AVR micro controllers and AVR Studio instead. My custom board use either Atmega8 or Atmega328 and is able to communicate with the OV7670 FIFO module
That is nice project to use AVR along with OV7670 and fifo. I agree, for color segmentation you can work with very less ram.

The $140 price you mention is the price of CMUCam4. I am targeting the price to half of that. I am almost done with the schematics, in couple of days I will have final BOM and can get a better estimate of the price. I do not expect the BOM to be more than $30, which implies a retail price between $75-$90. Maybe we can squeeze more savings and make even less expensive.
By brijesh
#146714
layout.jpg
Here is an update. Made some progress on PCB layout. I have attached a image of the layout as it stands today. The board size is around 6x5cm. Hope to finish it in a week or two.
You do not have the required permissions to view the files attached to this post.
By Duane Degn
#147065
I'm watching this project with much interest.

Thanks for the updates.

BTW, I've heard a rumor(from a good source) SparkFun plans on selling the CMUCam4. Even with SparkFun selling the CMUCam4, I think there's still a market for other robot vision solutions.

Good luck,

Duane
By brijesh
#147096
Yes,
The CMUCam4 project does mention Sparkfun in credits. I am not sure what is holding up from it being available on Sparkfun yet. I guess Sparkfun is redoing the board to reduce the cost or something.

Anyway that gives some time to develop this module. I am almost done with layout. Pesky thing called "day job" has gotten in the way for the past two weeks. I should be free this weekend to finish layout.

Brijesh
By brijesh
#147385
A big update. I have completed the PCB layout, generated the BOM and have an initial idea of total cost of components. But first, here is what the board will look like.
PCB 3d view 1.jpg
PCB 3d view 2.jpg
The big square border around the camera module is a place holder for additional lens. The camera comes with fixed focus length of 30cm. The thought is to add external lens and play with viewing angle and focal length. The two LED's on top and bottom of camera are for illumination. They are high power LED's. Now your robot can see in the dark. ;-)

Here is updated schematics, with layout and BOM. Sparkfun forum does not allow me attach pdf file, so get it from link below.
https://docs.google.com/file/d/0B9g-44w ... liLWM/edit

The total cost of components is coming up to be $37. This does not include shipping & handling charges by Digikey, PCB vendor, etc. The most expensive items are
1) PCB board: $12.53 (This price is per unit when you build 10 boards)
2) STM32 processor: $10.99
3) Camera Module $6.54

I am planning to build 10 boards in the initial build, out of which 5 are spoken for. The other 5 are up for grabs at $40 a piece. Basically it is cost of components. I am assembling the boards at home so assembly charges are zero. :-)

I am placing the order for PCB and components on Monday, July 15th. We should have PCB fabricated and ready for assembly by Aug 1st. Hopefully we will have a working board by 2nd week of August.

There is still a day for last minute additions and updates. If you have a suggestion please share.

Cheers
You do not have the required permissions to view the files attached to this post.
User avatar
By Ross Robotics
#147671
Also interested in your module. Can the camera be detached from the PCB? If so I am definitely interested. Send me a PM if this can be done as I would be interested in purchasing one.