Continue to Site

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.

  • 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.

webcam and microcontroller

Status
Not open for further replies.

beginner2

New Member
hi all....some question to ask here..

can i connect a digital webcam to a 8051 microcontroller?
the digital webcam will be mounted on a control car (which a PC is used to control the movement of the car by issuing commands to the 8051 uC) so that it is moveable and able to gather some environment informations.

the signal from the 8051uC will be send through fiber optics link so that the image capture by the webcam can be shown on the PC through a RS232 interface.

so is it possible that i connect the webcam to a 8051uC?
thanks all
 
beginner2 said:
hi all....some question to ask here..

can i connect a digital webcam to a 8051 microcontroller?
the digital webcam will be mounted on a control car (which a PC is used to control the movement of the car by issuing commands to the 8051 uC) so that it is moveable and able to gather some environment informations.

the signal from the 8051uC will be send through fiber optics link so that the image capture by the webcam can be shown on the PC through a RS232 interface.

so is it possible that i connect the webcam to a 8051uC?
thanks all

A start:

1) get a webcam that supports USB.
2) get an 8051 that supports USB. I think cypress makes some..check it out.
3) build an RS232 port on the 8051. Use this for commands.. its slow.
4) Bring image data from cam back to the PC via USB. Much faster, you'll be thankful for it later.
5) Write/mod USB driver, write an app for the PC that sends RS-232 commands to the 8051 for movement and captures the webcam data.
6) write 8051 code that works with above.

side note: 8051 may not have enough processing power to dowhat you want with elegance. Consider more powerful processors like 8033x mototrola series/coldfire or Texas Instuments DSP/ucontrollers or go all out and put a large gate array (FPGA) out there..you can get USB & '232 reference designs.

This project is very feasible.
 
Optikon said:
A start:

1) get a webcam that supports USB.
2) get an 8051 that supports USB. I think cypress makes some..check it out.
3) build an RS232 port on the 8051. Use this for commands.. its slow.
4) Bring image data from cam back to the PC via USB. Much faster, you'll be thankful for it later.
5) Write/mod USB driver, write an app for the PC that sends RS-232 commands to the 8051 for movement and captures the webcam data.
6) write 8051 code that works with above.

side note: 8051 may not have enough processing power to dowhat you want with elegance. Consider more powerful processors like 8033x mototrola series/coldfire or Texas Instuments DSP/ucontrollers or go all out and put a large gate array (FPGA) out there..you can get USB & '232 reference designs.

This project is very feasible.

3) sorry sir. what do u mean by build a RS232 port on the 8051?(do u mean that i have to build a circuit which accept TTL signal from the RS232?)
4) i understand that USB will be much faster. however, the transmission link i have to use is the fiber optic link. so what can i do with this?
5) assembly language will be written to command the uC and capture the image using the webcam. again sorry sir, what is the purpose of writing the USB driver and what the USB driver code looks like?

i might create some trouble here by asking many Qs. sorry about that because i m new to designing and hardware and software.

again thanks for help.
 
beginner2 said:
i might create some trouble here by asking many Qs. sorry about that because i m new to designing and hardware and software.
again thanks for help.

No problem and that's what this forum for. Just be patience and I bet Optikon would provide you with all the answers soon.
 
thanks for support.
really hope some experts in this forum can bring me some pointers towards this design.
sincere thanks
 
beginner2 said:
Optikon said:
A start:

1) get a webcam that supports USB.
2) get an 8051 that supports USB. I think cypress makes some..check it out.
3) build an RS232 port on the 8051. Use this for commands.. its slow.
4) Bring image data from cam back to the PC via USB. Much faster, you'll be thankful for it later.
5) Write/mod USB driver, write an app for the PC that sends RS-232 commands to the 8051 for movement and captures the webcam data.
6) write 8051 code that works with above.

side note: 8051 may not have enough processing power to dowhat you want with elegance. Consider more powerful processors like 8033x mototrola series/coldfire or Texas Instuments DSP/ucontrollers or go all out and put a large gate array (FPGA) out there..you can get USB & '232 reference designs.

This project is very feasible.

3) sorry sir. what do u mean by build a RS232 port on the 8051?(do u mean that i have to build a circuit which accept TTL signal from the RS232?)
4) i understand that USB will be much faster. however, the transmission link i have to use is the fiber optic link. so what can i do with this?
5) assembly language will be written to command the uC and capture the image using the webcam. again sorry sir, what is the purpose of writing the USB driver and what the USB driver code looks like?

i might create some trouble here by asking many Qs. sorry about that because i m new to designing and hardware and software.

again thanks for help.

Well your 8051 circuit will probably be running on 5V or 3.3V. Depending on your PC's serial port, this is a likely incompatible voltage level. So you will need to add some hardware on the 8051 side to be able to use RS-232 on your PC's serial port.

Read this:
**broken link removed**
maxim also has the parts you need to build it.

I dont know about your fiber optic link. Is the fiber link just optical image or is it a data link? If its for data, its overkill for the design. If it is image only, you still need to get it into a PC. If you have a tranceivers, then that interface is already done for you. I dont know your situation.

Whatever uses USB will need a USB device driver attached to it. If you expect the PC to understand how to communicate with your hardware (8051 in this case) it will need a device driver. Some USB designs can make use of existing generic drivers, some not. It will depend on your OS and the details of your 8051 design. In any case, whatever reference design comes with 8051, will also show you what you need to do fo rthe driver. In the worst cases, you have to write your own. Sometimes this is a good thing sometimes not depending on your programming skill level and time available.
 
basically this is the block diagram that i have proposed.
 

Attachments

  • untitled_742.jpg
    untitled_742.jpg
    16.5 KB · Views: 2,222
basically this is the block diagram that i have proposed.

**broken link removed**

1) the rs232 interface i m using MAX232 IC
2) for the optical transceiver, for the optical transmitter, i design a LED drive circuit to drive the HFBR1524 and for the receiver. HFBR2524 and an amplifier circuit is used.


conceptually till now, i think i have no problem on all the circuits,except the 8051 and the webcam.
what i suggested for my project so far is at the PC side, user would be able to see the "live video" capture by the webcam. if i would to capture the image, i will send command from the PC using VB GUI to the 8051, and the 8051 is able to communicate with the webcam for appropriate operation.(for sure this will need the assembly language to be written)

i still cannot get the full picture regrading how am i able to interface the webcam to the 8051 so that i can communicate between PC and webcam through the fiber optics link. the "live video" i need is just a monochrome video and so for the image.

if i would to build an USB interface between the 8051 and the webcam, it will be time consuming and taken a great amount of my budget i guess.

so i dunno what shud i do in order for me to able to see the "live video" through the GUI ...
any other alternative or suggestions?
i really running out of idea as i m just a beginner and i believe i m a noob here.

hope i didn't confused brother and sister here

precious suggestion and advise is anticapated.
thank you.
 
i gone through some googling and found out cypress uC which support USB.

however those IC onli support USB and PS/2 and doesn't support serial interface. if in this case, if i use this IC, wouldn't that i will be unable to receive the signal from the PC since the interface at the PC is using RS232 interface?

have been researching and squeezing my mind for whole day and i m now very confused and running out of idea.
hope experts here can help ti give some suggestion and pointers.
 
if i changet he digital webcam to an analog webcam, so i must change my 8051 uC to AVR uC rite?

so what is the different between 8051 and AVR?
can i still use the same assembly language for AVR uC?
 
beginner2 said:
if i changet he digital webcam to an analog webcam, so i must change my 8051 uC to AVR uC rite?

I don't see why?. However, I'm doubtful about the ability of either to digitise an analogue video signal in real time?.
 
beginner2 said:
basically this is the block diagram that i have proposed.

Does the 8051 process anything from the video feed? I mean, does it need to make some decisions based on what the captured images contain?

If yes, I think you are overestimating the 8051 processing power...

If no, why connect the camera to the 8051 at all?

Why not connect the camera directly to the PC through USB? This is a lot easier than trying to interface a USB device to an uC and convert the video signal to something that'll be able to go through a RS-232 bottleneck.
 
Joel Rainville said:
Does the 8051 process anything from the video feed? I mean, does it need to make some decisions based on what the captured images contain?

instruction will be send from PC to the camera either to capture the image at the surrounding.
so i need to connect the camera through the 8051 so that i can control the webcam through PC.
 
beginner2 said:
Joel Rainville said:
Does the 8051 process anything from the video feed? I mean, does it need to make some decisions based on what the captured images contain?

instruction will be send from PC to the camera either to capture the image at the surrounding.
so i need to connect the camera through the 8051 so that i can control the webcam through PC.

Why not connect the camera directly to the PC through USB then? The PC sends the "instructions" directly to the camera, and the video comes back straight through the USB link instead of having to shrink itself in order to fit the RS-232 bottleneck.

With the webcam block removed, your block diagram is excellent. But when you add the webcam connected to the 8051, it just makes no sense. Why do you want to do that?

Video through a serial link? Interfacing a USB device to a standard 8 bit microcontroller? That's crazy.

Most USB enabled microcontrollers are designed to act as USB devices connected to a PC that has a USB controller. It will not accept input from another USB device for you to process.

What you are looking for is a microcontroller with an onboard USB controller. But then, that just takes care of about 25% of your problem. What protocol does the camera use to send video and how is the video going to make it through that serial link?
 
Joel is absolutelly right.
Before you get involved with any type of data transmition, check the bandwidth (eg 320x240 x30fps = 2.3Mb/sec or about 2250kbps just for video).
I've seen that some RS232 ports support up to some 900kbps but this is still way below requirement even for choppy 15fps.
You can try to use dialup connection and see what kind of streaming video you can get from CNN for example. Then you can try to create your own codec... Not fun... Another thing is that anything USB is hardly "remote" - it is usually for 3-4m max. (10-12ft).
If you want to watch what is going on with your RC toy, check following links:

$250 for color wireless camera
**broken link removed**

$800 high res glases
**broken link removed**

$120 receiver
**broken link removed**
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top