mabdrabo
mabdrabo

Reputation: 1060

Arduino camera module video to Android screen

I'm trying to connect a camera module to my Arduino Mega, connect my Mega to my Android phone (through Bluetooth or other) and send the live view of the camera to the mobile phone.

I saw a video online that showed this for still images -- an image captured by the camera module on the Arduino was sent to Android and the output image was viewed after a couple of seconds (the time to send image by Bluetooth).

Is this doable with live video instead of image? If yes, how? If no, what are some some workarounds?

Upvotes: 2

Views: 8857

Answers (3)

Kanaris007
Kanaris007

Reputation: 314

It's not possible. You can try my example. It takes 15 seconds to transmit 320x240 image to Android phone via bluetooth 4.0. http://privateblog.by/peredacha-kartinki-s-ov7670-cherez-arduino-uno-na-android-telefon/

Upvotes: 2

mabdrabo
mabdrabo

Reputation: 1060

here's how i managed to solve my problem, i got my old wildfire installed IP Webcam, set-up a wifi hotspot from my nexus4, connected to it from the wildfire, took the wildfire's ip and put it in the nexus4's web viewer.

Upvotes: 0

Neil Lamoureux
Neil Lamoureux

Reputation: 809

I don't think you can do live video - the serial bandwidth on the Arduino isn't very high. It maxes out at 115200 bits per second. To get bytes per second, you divide by 10 (8 + 2 bits overhead typically), which gives you 11.5 kilobytes per second.

A frame of 640 x 480 video is 640 x 480 x 3 (one byte for each color component RGB) is about 1000  kilobytes roughly. JPEG cameras use M-JPEG, which gives you a compression of about 20:1 (see Wikipedia article), so this might compress to about 1000K / 20 = 50K. So the camera needs to transmit 50K at 11.5 kilobytes per second, so it will take at least four seconds to transmit one frame. Then it needs to transmit that over Bluetooth or some other serial communication, taking at least another four seconds, so eight seconds total. You might be able to do this faster in parallel to get it to four seconds total, but I doubt it since the Mega chip only runs at 16 MHz, so it can only process 16 kilobytes per second at best in a highly idealized world.

In the video it looks like it takes about 10 seconds for the image to get from the camera to the phone, which matches the eight second estimate fairly well.

You could try smaller images - say 320 x 240, with grayscale (if the camera can do that). That reduces the number of bytes by a factor of 12, so you might get 1.5 frames per second.

Perhaps a better solution is to use a Raspberry Pi, which has a 1 GHz processor, and USB 2.0 top speed 280 Mbits/s which is over a thousand times faster than the 115200 bit/s.

Upvotes: 4

Related Questions