Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to connect a camera and WiFi module using a PIC

Status
Not open for further replies.

orienz

Newbie level 4
Joined
Jan 28, 2012
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,346
Hello guys,

First I wanna say congratulations on great community here and great forum. I read lots of threads that helped me a lot with some problems. This is my first post. I would also like to mention that i am a total beginner so if I say something stupid please forgive me. I am trying to learn stuff.

Here is my question:

We are trying to remotely (over TCP) turn on a small motor that will drive a mechanical part of the machine that is not really important here. Now I wanted to use one of the PIC16F series controllers (preferrably PIC16F886) to do this. I found many WiFi modules with UART interface and implementing this would be pretty simple. I was thinking to talk to the remote server by sending ASCII commands to WiFi module (which already has TCP/IP stack built in and handles everything connection-wise). I would turn the motor on/off through some kind of MOSFET driver or something.

However we want to expand our project by connecting a simple JPEG snapshot Camera that also has UART interface. My question is now how do I handle connecting two modules? Do I need a chip with two UART interfaces or something? Will PIC16F series be able to buffer images from Camera and send them to WiFi module? This is a VERY small camera with like 1 picture per 2 seconds frame rate or something. Resolution is also very small but it suits us pretty ok since it does not have to be anything advanced.

Thank you for your inputs!
 

Re: WiFi module question

For your project, please share the resolution of the camera, actually resolution will give the size of JPEG picture file. PIC16 will be OK for that but the communication will be not too fast, For example, Sending 10KB JPEG file may take 2 to 10 sec (depends upon baud rate). the best choice is to use 1 FPGA alone or with a combination with PIC16 or PIC18 upon your ease.
 

Re: WiFi module question

Maybe change PIC24F series microcontroller; They have 2 UART.
Or use a SPI to UART IC, so that you can use the SPI available in your 16F series.

Best Regards,
siongboon
 

Re: WiFi module question

Hey guys,

Thanks for answers! The resolution will probably be no bigger than 640x480. I have very little experience working with PIC16F series controllers and NO experience working with anything else (1st year engineering student).
I just did some re-search on second suggestion and actually found this camera: CMOS Camera - 640x480 - SparkFun Electronics. It apparently uses I2C interface. So i could hook this up to say 16F886 and WiFi module using UART. Correct?

I don't want feed from camera to be sent ALL the time, only when I get the signal to turn the motor on. Then I will start sending data from Camera to the server through WiFi module for the specific period of time.

Am I on the right path here? How hard is it to do something like this? I just want to be pointed to the right direction so I am not chasing a ghost here ;)

Thank you very much guys!

---------- Post added at 18:54 ---------- Previous post was at 18:37 ----------

I still didn't buy any components so any suggestions on components would be greatly appreciated.
 

Re: WiFi module question

I am surprise that you are only 1st year engineering student, from the question that you have posted.
You seems to have quite some experience in engineering.

I am confident that you are on the right path.


Hey guys,

Thanks for answers! The resolution will probably be no bigger than 640x480. I have very little experience working with PIC16F series controllers and NO experience working with anything else (1st year engineering student).
I just did some re-search on second suggestion and actually found this camera: CMOS Camera - 640x480 - SparkFun Electronics. It apparently uses I2C interface. So i could hook this up to say 16F886 and WiFi module using UART. Correct?

I don't want feed from camera to be sent ALL the time, only when I get the signal to turn the motor on. Then I will start sending data from Camera to the server through WiFi module for the specific period of time.

Am I on the right path here? How hard is it to do something like this? I just want to be pointed to the right direction so I am not chasing a ghost here ;)

Thank you very much guys!

---------- Post added at 18:54 ---------- Previous post was at 18:37 ----------

I still didn't buy any components so any suggestions on components would be greatly appreciated.
 

Re: WiFi module question

Yes sure you are on a right path
 

Re: WiFi module question

it doesnt bother if you have one or 2 uart. you can always emulate the other uart with software only.
if this second uart is not too restrictive with timing, it should be ok
look at the help file on mikroe basic or c compilers for the uart function, there are examples of these 2 serial communications with one hardware uart
also, the i2c is actually counted like a uart in a pic.
btw I think a pic 16fis quite lite for such project, the pic 18 should be better.
 

Re: WiFi module question

Ok, I think I will definitely have to reconsider controller choice. I will probably go with 18F series. I also noticed a few of 18F models have dual UARTs. What is the major difference when moving from 16F to 18F? What do I have to think about?
I am just scared that learning this will take too much time. Hope you guys will help me with some coding later on ;-)
 

Re: WiFi module question

there are not many differences between them
only the pic18 has more things in them than the pic16
as we can make bigger programs in them, I program pic18 with high level like basic or c
small pic12 or pic16 are in pure assembler (and somewhat more complicated to program if you need complex math or so)

pic18 have access to multiples uart, to ethernet network,
but intrinsequely they are very close.
 

Re: WiFi module question

Hey again guys,

Did lots of re-search. I found one very interesting thing: MikroElektronika - EasyPIC PRO v7 - Board for high pin-count 8-bit PIC devices program and debug

I am thinking to invest in this. Do you think PIC18F87K22 will be able to handle my little project? FPS from Camera doesn't really have to be anything insane. I would be satisfied with 1fps! I just don't want camera to hang pic controller or wifi module because it's very important that motor is turned on/off asap!

Thank you for a great forum guys.

---------- Post added at 17:23 ---------- Previous post was at 17:07 ----------

Well I have one question for you guys.

PIC18F87K22 got 3,862 bytes of RAM. This is obviously not enough to store any kind of image from the camera. Can I just receive from one UART and immediately write to the other one? Without storing anything big in RAM. For example i hook up WiFi module on one UART interface and Camera on another one...then PIC sends command to take a picture and while i receive image data i just re-direct it to WiFi module so it can send it further to the internet server?

Thank you.
 


Re: WiFi module question

i am not looking to store or manipulate image data. I am just transfering it via wifi module. I don't know if I feel comfortable moving to whole new architecture in such a short time :(
I could probably do it and write some codes but the whole meaning of a project is to get familiar with some basic stuff. I am not trying to impress anyone, just learn ;)

Still question is...if i just want to re-direct data from one UART interface to the other..will pic18f be able to do it? Would I need same baud rate on both? will amount of data be relevant? Can i multi-task somehow while i am doing this so i don't miss other signals coming in from wifi module?

Thank you!
 

Re: WiFi module question

in fact, only be aware that a 3Mb jpeg picture will need some 7 minutes to transfert at 57kbps...
and that the pic18 may be slower than that...
I was just saying that you can buy a mudule cheaper than your dev card, that will do the trick
and if you use pic24 or pic32 it will go faster anyway.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top