• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Small camera + LCD project

throbscottle

Well-Known Member
Thread starter #1
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)
 

throbscottle

Well-Known Member
Thread starter #3
Oh why is it that more costs less? It's very frustrating!
I was just looking at ESP32. Looks like an interesting challenge!
I didn't realise a Pi could be so cheap. Maybe I will get one anyway to experiment...
 

gophert

Active Member
#5
I just bought a pi 3+, 7" pi display and camera for under $200. Very happy. The guy setting up our trade show booth was going to have a custom system design for $15000. Pi is a Bargain. I eventually added a 32" HDTV via HDMI but kept the pi touch screen. Still a bargain.
 

dr pepper

Well-Known Member
Most Helpful Member
#6
The OV7670 is cheap but it requires a lot of processor, serial cams are easier to deal with but cost more.
 

throbscottle

Well-Known Member
Thread starter #8
Yeah I realised after, I would need some kind of signal processor for the OV7670 and friends and then it gets complicated.

Rasberry Pi official camera is a lot more than I'd like to spend, compatibles are less than a fiver - using OV5647. So now I know about CSI. So Pi zero + camera need only cost a tenner, so far. SPI screen is easy to connect too. All a bit too easy....
 

throbscottle

Well-Known Member
Thread starter #9
Trouble is, if I use a Pi I might as well use a spare laptop or old PC i have lying around!
 

throbscottle

Well-Known Member
Thread starter #13
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
Most Helpful Member
#14
Another bad idea:
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

Active Member
#15
Another bad idea:
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
#16
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
Most Helpful Member
#17
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
Thread starter #18
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.:rolleyes:
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
Most Helpful Member
#19
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
#20
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.
 

Latest threads

EE World Online Articles

Loading

 
Top