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.

CCD video transmission (wireless/PIC microcontroller)

Status
Not open for further replies.

fanaticelectro

New Member
CMOS image transmission (XBee/PIC microcontroller)

Hello all. I'm currently planning a project where I will be transmitting video from a CCD/CMOS camera, wirelessly to a computer where it is to be displayed. I'm planning on using the Sparkfun camera module ( SparkFun Electronics - CMOS Camera Module - 640x480 ). I was thinking of using an XBee RF module to transmit the signal, which claims to have a 250kbps data rate (hoping it will be fine for ~5fps video, but not sure). But if that is not enough, I will likely need to go the wifi route.

Anyway, my search for others with similar projects has not been too successful, and I was wondering if anyone can help as it is my first time a doing camera/wireless transfer project. I will likely use a PIC microcontroller to interface with the camera/wifi (my main concern at this point is interfacing the wifi, both on the processor side and on the receiver/computer side which will need to output the video feed), but again this is something that I can not find aid for online. If anyone can help, that'd be great.
 
Last edited:
Hey, thanks for replying. Yeah I was thinking it's unlikely as well if no compression is involved, so I will need to go with the wifi route then, right?

Also, would something like a PIC16Fxxx processor be able to handle this task? I'm thinking of first doing the camera interfacing and communication, then the wifi seperately using a simpler setup, then combining both. But so far, I haven't found any resources with good information on doing these things. If you know of any or can help in some way, i'd appreciate it. Thanks again.
 
Last edited:
Well, how are you reading the signal?
Say you're running the PIC at 10MIPs. Now how long does it take for just a program loop? We'd need to decrement a >8-bit counter for where we are on a row, test, branch. I can't estimate properly how many cycles this will take per pixel without knowing what it has to do, but... surely more than 10 cycles. That PIC could only process 1Mpixel/sec, about 3 frames/sec, but honestly that 10cycles/pixel was WAY generous. 10x slower would probably be realistic.

And more important, what format is the CMOS imager data stream? If it's analog voltages, the ADC speed may well be the limiting factor. PIC's ADC for lower-end chips is not really fast.
 
Thanks for the reply. That makes sense, although if I use a PIC18 which allows for 16MIPS, that may give a bit more leeway.

Does one even need a microcontroller interface if the goal is to simply send the image through wifi to a computer?
 
I know i can get a $30 imager chip from DigiKey that puts out 1080P at 15FPS... of course it clocks 12 bit pixels at 96MHz...
 
Last edited:
Not be funny, but for around $30, you can get wireless video/audio transmitters, with remote repeater for you home entertainment center, so you can watch TV in any room in your house... I've got two working on my video security, one for a camera in the backyard (too lazy to run another cable), the other sends the output of my DVR to my electronics room. Video capture cards are cheap these days for your computer, even have USB versions...

Just seems like you are going to a lot of work, and really on the edge of what a PIC can handle (AVR might be a better choice :) ), but money wise, much cheaper and reliable off the shelf.

Philips Wireless A/V transmitter 2.4 GHz, SRU4000/17
**broken link removed**
Strange, these were cheaper a year ago, but mine were from a surplus store... Shop around.
 
Last edited:
Hello all, thanks for the replies. Sorry to say, but I want to built this system myself and do not want to buy a commercial product.

At this point, I've found a decent camera module that does JPEG compression and communicated using UART, which should be nice.

I have some questions, though:

1. I am planning on using a PIC18 (haven't decided on the exact one yet) running @ 10-16MIPs. I've also read about the PIC24, which appears to use some internal 'PLL' mode to run at very high speeds, ~40 MIPS (I read this on page 121 here https://www.electro-tech-online.com/custompdfs/2010/05/70293D.pdf but if anyone can understand/explain, please let me know. I just need to ensure that it is safe and there are no major disadvantages to using the PLL mode).

2. I will also be using XBee modules for transferring the data wirelessly. Thus, I have settled away from the video idea, and will instead be aiming for about 2FPS MAX. Something I FORGOT to mention last time was that this system will have other sensors/actuators on board, such that the image capture may need to be occur at the same time as an actuator being driven or a sensor being checked. I'm hoping the UART interface of my chosen camera module will make this easier, but I'm not sure.

3. I've heard of PIC uCs with something along the lines of embedded wifi being sold by Microchip? I researched this but didn't find conclusive answers (just this **broken link removed**). Anyone ever heard of this?



Thanks again guys!
 
Last edited:
Well the Microchip MRF modules:
MRF24J40MA-I/RM Microchip Technology RF Transceiver
Are generally faster and cheaper than XBee.

The "internal PLL mode" is just a clock generation method. Don't worry about it. The 24F is spec'ed for 40MIPs, and will run reliably at 40MIPs. The 24F is a TOTALLY different core than the 12F-18F, it's a different design effort that reused nothing of the 12F-18F technology. There is a library specifically for running the MRF on PICs. AFAIK, there's a 24F one. I know for sure there's a 33F one.

Check what speed the PIC's UART can run. It's notably slower than the clock speed.

The 33F series has a DSP core, and it's MUCH faster for running math. If you're not trying to do any work on the video though- which would be difficult seeing as it's JPEG-compressed- then this isn't important. You'd just be forwarding data from one peripheral to another.

In fact, the DMA channels can be used to transfer data between peripherals directly, without even involving the core. In some circumstances, you can literally Sleep the core indefinitely while the peripherals talk to one another. All this is off though if the data requires any manipulation.
 
Is programming the PIC24 vastly different from the PIC12-18 series? I'm comfortable with programming PIC16, and was hoping whatever PIC I choose to use in the end has a similar setup.

Let's say I decide to go with a PIC18. I calculated the max baud rate to be 375 000 using page 275 of https://www.electro-tech-online.com/custompdfs/2010/05/39778d.pdf . In doing so, I assumed that n=SPBRGHx:SPBRGx was 1, which when put into Fosc / (64 * (n+1)) gave me the answer. However, I'm not exactly sure what this means. I think you're implying that the UART may be a bigger bottleneck than the processing power of the PIC, but can I directly compare the baud rate to the MIPs of a PIC?


Also, regarding the MRF24J40MA, it seems it would save me $20 to implement it instead of the XBee. However, it uses SPI instead of the XBee's UART. My research indicates that SPI is faster and simpler than I2C, but I haven't come across any conclusive answers for a comparison with UART. Are there any disadvantages to using the MRF24J40MA instead of XBee? Is there a reason it's cheaper (e.g. it needs more advanced circuitry to be implemented in my project)? Can I just buy that module without the dev kit and be able to set up and use it fairly quickly?

Finally, what do you think about this https://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en547511 ? It's one of the cheapest WiFi modules I've come across, and seems to have a similar interface to the XBee. Microship apparently provides their own TCP/IP Stack, but do you think it will be worth the while to upgrade to Wifi or will the camera and PIC essentially be the main bottlenecks?

Thanks
 
Last edited:
Not be funny, but for around $30, you can get wireless video/audio transmitters, with remote repeater for you home entertainment center, so you can watch TV in any room in your house... I've got two working on my video security, one for a camera in the backyard (too lazy to run another cable), the other sends the output of my DVR to my electronics room. Video capture cards are cheap these days for your computer, even have USB versions...

https://www.electro-tech-online.com/custompdfs/2010/05/sru4000_17_dfu_aen-9.pdf

that would be composite video, which means SDTV or effectively 480I. There are two problems there... 1) the OP asked for asked for a Xbee link, and 2) the OP though he was going to do it with a 20MHz PIC micro
 
https://www.electro-tech-online.com/custompdfs/2010/05/sru4000_17_dfu_aen-10.pdf

that would be composite video, which means SDTV or effectively 480I. There are two problems there... 1) the OP asked for asked for a Xbee link, and 2) the OP though he was going to do it with a 20MHz PIC micro

He said he wanted to send video to the computer wirelessly, I just supplied a cheap simple solution. He really didn't go into much detail as to what he hope to achieve. Some people want a quick and simple solution, others enjoy the challenge and don't mind the headaches and expense. Personally, I go for the quick and cheap solution, as I just want the function, with the least work. Guess I'm not much of a 'geek', since I have no desire to over-complicate a project, to gain the admiration of others. To each their own methods, words are cheap, just threw a few together, maybe to help...
 
You need to do a proof of concept. Wire two computers together with a null modem cable on the serial ports. Set the baud rate for 115k and write programs to send video from one to the other.
115k is a really small pipe for video, this is the maximum XBee goes and there's a good chance that's best case. MiWi is probably no better.
If you can't make the above work you have zero chance of making the PIC version work.
 
HarveyH42,

sorry about that, I should have specified more details in my original post. My overall idea is to create a robot which follows a path as defined by the user on GUI. Of course, the robot will have other sensors (IR at the very least) as well as the capability to add on more sensors in the future to the system. My original idea (prior to proper research) was to have a live, high FPS video feed on the monitor, but I soon realized that was impossible with a PIC. Now, my plan is to implement a 1-2 FPS system using my JPEG UART camera module.

blueroomelectronics,

That's a good idea and I will give it a try, but are you suggesting that the math won't match the real world result? Because I know that the camera I am buying will produce JPEGs of less than 30kB size at 320x240, and ~15kB or less at 160x120. Assuming we're transferring at 115kbps = 14.37kBps, that's ~1FPS. That is, unless, something else bottlenecks the situation (either camera UART or the XBee data rate).

Edit:

I've found something that is similar to what I want to achieve : **broken link removed**
They're using an XBee Pro system to transfer images to their GUI.Their processor is based on ARM7, which is more powerful than PIC as I understand, but they're also doing image processing and other cool features which are beyond the basics that I want to implement in my system.

Anyway, I thought this was a good find.

Edit2:

Another site, with a similar setup http://diydrones.com/profiles/blogs/secrets-of-the-c328. C328 camera (another model I was considering, $10 more expensive than my current one but seems to have same features, maybe the compression is better?), and what seems like non-Pro XBee modules (which run @ 85kbps rather than 115.2kbps). Their benchmarks:

JPEG, 128 byte package size
XBees + local microchip generating ACKs

640x480=10 seconds per frame
320x240=5 seconds per frame
160x128=0.7 seconds per frame
 
Last edited:
He said he wanted to send video to the computer wirelessly, I just supplied a cheap simple solution. He really didn't go into much detail as to what he hope to achieve. Some people want a quick and simple solution, others enjoy the challenge and don't mind the headaches and expense. Personally, I go for the quick and cheap solution, as I just want the function, with the least work. Guess I'm not much of a 'geek', since I have no desire to over-complicate a project, to gain the admiration of others. To each their own methods, words are cheap, just threw a few together, maybe to help...

I can understand that... I was going on the assumption from his post that he already had a sensor that he wanted to use at 250Kbps and did not question the reasoning, only stated the inevitable outcome.
 
Last edited:
pic - wireless

hi everyone, i am working on a project and i need ur help. i need a code (wirtten in pic basic language) to transmit data (8-bits) wireless from a microcontroller to another microcontroller using the TX and RX pin
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top