# Small camera + LCD project

Status
Not open for further replies.

#### throbscottle

##### Well-Known Member
I want to learn how to interface a simple RGB camera chip, eg OV7670 and small LCD screen maybe 3" , the kind of things you see on eBay in modules of various flavours, and control the camera through it's SCCM interface. The ultimate idea is to add a cross-hair overlay and be able to move it around.
Cost is really important, it has to be as cheap as possible. Time is unlimited, mortality permitting.
How hard is it to do?
What are the most appropriate video format and LCD interface to use?
What's the best MCU to use? I've only done anything with PICs so far.
(I know I could do it all with a Rasberry PI more easily but it seems very excessive for this)

#### ronsimpson

##### Well-Known Member
The Pi 0 is $5. There is a Pi 0w.$10 with built in wifi.

#### ronsimpson

##### Well-Known Member
Trouble is, if I use a Pi I might as well use a spare laptop or old PC i have lying around!
My trouble is with windows it gets slower with age until it will not run. I converted an old computer to Linux. Now I have a PC and a Pi that look the same, same speed.

#### throbscottle

##### Well-Known Member
What makes you think I'd use windows?
Anyway, my mental stumbling block is the fact of using a full blown computer (even a very old one or a very small and cheap new one) to just drive a camera and display (overlay notwithstanding). It just seems terribly wasteful - kind of taking a sledgehammer to kill a gnat.
TBH connecting a VGA camera directly to a monitor would do 90% of what I want - I actually thought about fitting a mechanical cross-hair over the screen! It's just for targetting a drill.
I do actually have an old spare standard monitor but it's way too big to use in the shed, and since small displays are quite expensive is why I started looking at connecting a small TFT. And then it gets complicated...

#### ronsimpson

##### Well-Known Member
I have wireless/wired cameras. I can see them on my phone via the house network. The phone does not have to be "working" as a phone. It needs to be smart enough to get on the house network.
($30 to$60 wifi camera + old smart phone)

I am full of bad ideas. Want ten more?

#### gophert

##### Well-Known Member
I have wireless/wired cameras. I can see them on my phone via the house network. The phone does not have to be "working" as a phone. It needs to be smart enough to get on the house network.
($30 to$60 wifi camera + old smart phone)

I am full of bad ideas. Want ten more?
I "liked" the idea, not your categorization that it is a "bad idea".

#### dougy83

##### Well-Known Member
IIRC, those cheap CMOS camera modules are provided with a clock signal, and they give back HSYNC, VSYNC and 8-bit pixel data, at a rate that's some quotient of the clock. This should be easy to handle with an uC; a decent uC clock rate will help with higher frame rates, e.g. 72MHz ARM STM32F103C8T8 (https://www.ebay.com.au/itm/173720172153) should be able to handle 30 fps without issue. Control is by IIC, IIRC. I interfaced to a CMOS camera IC salvaged from a webcam back in 2003, and it was not difficult.

A bunch of the small LCD modules (e.g. 128x160) can show 60 fps if you can feed in a 15 MHz SPI data signal, and match the camera frame rate with ~8MHz SPI.

#### ronsimpson

##### Well-Known Member
It's just for targetting a drill.
Now I know what you want to do.
I went to the used computer store and got a assortment of "USB cameras" and connected one to a old lap-top. Camera=$5.00 It bothered me to no end that the computer was doing one job. computer=monitor Next I changed to an old Pi. ------------ Then I spent$25 on a USB microscope. I got one that looks like this one but came with a stand that goes up/down. It focuses very close if needed. It has a built in light to shine on the subject.

----edited-----might be this one

#### throbscottle

##### Well-Known Member
I actually have a USB microscope! I got it for inspecting boards...
It did occur to me I could use it for this too. Actually it would be the ideal simple to use camera. Tsk, much too easy! Meh! I could even combine it with a small cheap tablet! Except I don't want to do that, I only like to make life difficult for myself.
I think my desire to experiment and learn something is far greater than my need for the finished article!

Dougy83 - I will see if I can find out how to do it! I'm pretty ignorant of what kinds of micro are out there. That board is a bit more expensive over here. It's getting interesting now. I have no idea what other types of micro would be up to doing the same job.
The cheap modules are sold as having a VGA output, but the data sheet says RGB and it's friends.
One thing that's baffling me with the uC route, doesn't each frame need to be buffered? In which case how are you doing it? The micro you linked to doesn't look to have enough memory for that!
Digital video is something I know almost nothing about.

#### ronsimpson

##### Well-Known Member
The micro you linked to doesn't look to have enough memory for that!
There are different types of video ..... 3 to 5 mhz dot clock is common for low rez video. Each clock presents three bytes, so data is more like 9 to 15mhz. Then you need to send it back out at about the same rate. You might be ar 30million bytes per second. ARM computers do not have fast I/O , I have used DMA to get the speed up.

Depending on what you are doing, I have used two full frames of buffer, one frame, and some times as little as two lines. (Using a FPGA)

#### dougy83

##### Well-Known Member
One thing that's baffling me with the uC route, doesn't each frame need to be buffered? In which case how are you doing it? The micro you linked to doesn't look to have enough memory for that!
Digital video is something I know almost nothing about.
Here's a 2.8" LCD: https://www.ebay.com.au/itm/182951909051 Its controller has 178kB of video ram, so you just stream from the camera to the display. I'm not sure what happens w.r.t. display scanning rate vs. update rate; i.e. will there be display artifacts?
The cheap 1.8" displays also have built in display ram.
Digital video is something I know almost nothing about.
It's just raw pixel data being sent for each frame. It's basically the same as the old analogue CRTs: VSYNC+HSYNC+DATA, except that DATA is digital.

The cheap modules are sold as having a VGA output, but the data sheet says RGB and it's friends.
I think you'll find that VGA is referring to the image dimension in pixels; VGA is 640x480, CIF is 352x288, QCIF 176x144, etc.

Status
Not open for further replies.