Audio/Video via serial

Is it possible to (easily) transmit (stream) audio (from a microphone) or video (from a camera) from the arduino to a computer via serial?

my goal is to connect a microphone and camera to an arduino then process the audio/video signals on the computer via data transmitted over serial (bluetooth)

Audio maybe. Are there any Bluetooth Video devices? Have you ever wondered why?

Putting an Arduino in the middle is pretty pointless. It'll immediately become the bottleneck.

Bcarroll:
my goal is to connect a microphone and camera to an arduino then process the audio/video signals on the computer via data transmitted over serial (bluetooth)

Connect, how?

What function does the Arduino serve in all this?

Are you basically trying to reinvent a wireless webcam?

Wireless webcam is probably a good way to describe what I want to accomplish. My initial thought was to connect a microphone and/or camera to one of the pins on the arduino. When a command is received (serialRead), the arduino will start reading data from the microphone or camera (probably not at the same time) and send the data back (serialWrite), where another device (PC, cellphone,etc) will use a program to decode and output the audio or video data.

I am thinking still pictures might work, but full motion video is probably not going to work due to the speed limitation of serial data transfer.

I am thinking still pictures might work, but full motion video is probably not going to work due to the speed limitation of serial data transfer.

Full motion video is possible, if you are willing to settle for 30 frames per hour, instead of the usual 30 frames per second.

Even audio is going to be difficult, because the time taken to digitize the signal is not fast enough to permit voice quality data to be collected, let alone transmitted. Forget anything of higher fidelity.

I don't know how fast the Arduino can transmit/receive data, but I'm sure some the the experts here know. (Of course, if the microcontroller is processing the data, that's another question...)

With audio/video, the data rate (bitrate) is related to format and quality. If you don't need good quality, you can get away with lots of compression and low bitrates. And of course, if you don't need real-time audio/video you can use a low bitrate and take all day to transmit/transfer a high-quality file. :wink:

Here are some typical audio/video bitrates:

  • CDs are 1411kbps (uncompressed PCM, 44.1 kHz, 16-bit, stereo)
  • MP3s are between 32kbps and 320kbps. 128kbps is probably the minimum for hi-fi sound, depending on how picky you are.
  • DVDs can have a maximum combined audio/video bitrate of just over 10,000kbps. 6000-7000kbps is more-typical.
  • DivX is (I think) typically around 700 - 1000kbps, audio & video combined.
  • WMV is (I think) typically around 350-500 kbps, audio & video combined.

And from Wikipedia, here are the Bluetooth data rates:

  • Version 1.x = 723.1 kbps.
  • Verison 2.0 = 2100kbps.

A more advanced Arduino might. There are clones that do USB serial at USB speed on a USB chip. With SPI you can get megabytes per second transferred and that's on a bus. SD is SPI, maybe the camera is too? Only the camera is the Master, SD is the Slave. Can the Arduino keep up with the camera as an SD-chip adapter? Will the camera slow down for slow SD chips? I think even the Arduino is faster than SD Class 2.

OTOH there is also an Arduino shield for TV. Different route.

The short answer is NO. Audio in "relatively simple" format (MP3) is 128kbps. That's the limit of serial (57600 always works, 115200 may fail). Video is typ. a few Mbps, so, it won't work. Some people did generate video from an Arduino using 2 output pins and resistors (one for sync, one for b/w) but is was a very low resolution signal.

So, exit "Serial" for . To close this on a positive remark however, since there is a buffer on the serial interface, the CPU can process things and receive one or more characters at a time, so that's not an issue.

If you use a Teensy for example, you can use USB at 12 Mbps, so it may work. But the 8-bit 328 does not have the power to even decode simple audio. exit Arduino.

Maybe the 32 -bit clones like the Pinguino or Maple (or their Olimex clones, look very attractive) could provide a better platform. The trouble with those is that ... it's also another IDE, and you lose the stability and reliability of 0022. You will also need to check / double check the libraries, and the community support there is much lower.

But the real question is "what do you want to achieve" indeed : assume you get to hook a microphone, what does your sketch ? voice recognition ? Assume you get 1 image/sec low res, what do you check ? face recognition ? Arduino and probably even 32-bit clones will likely fall short, not only in power but also in memory.

A wireless webcam does not need any Arduino, except possibly for generating overlay text. Even for that, I'd suggest some specific /custom shield with video in/out and some LCD-like specific memory.

Hope this helps.

Bcarroll:
Wireless webcam is probably a good way to describe what I want to accomplish.

In that case, may I suggest that you use a wireless webcam?

The goal is to use the arduino as a mechanism to get data (from sensors, microphone, camera, etc...) and pass the data back to a PC via serial (using a bluetooth module for wireless serial...). The PC will handle all of the decoding, etc... I have a sketch and PC app working that can process data from sensors (IR Motion, temperature, etc...), but it sounds like the speed of serial is going to ultimately be the issue with audio/video, especially if 57000 bps is the maximum reliable speed.

Thanks for all the input!

Bcarroll:
The goal is to use the arduino as a mechanism to get data (from sensors, microphone, camera, etc...) and pass the data back to a PC via serial (using a bluetooth module for wireless serial...).

You seem to be confusing the goal with your preferred solution.

Is it the case that you have an Arduino and want to do something with it? In that case, using an Arduino is a reasonable goal, but I suggest you need to look for a different project for it; this one isn't suitable.

On the other hand, if you want to get video/sound to your PC wirelessly then the most obvious solution is to use a wireless webcam.

You can use an Arduino for almost anything if you set your mind to it - you can even use it to wedge the door open - but that doesn't mean that it's a sensible solution.

You can use an Arduino for almost anything if you set your mind to it - you can even use it to wedge the door open - but that doesn't mean that it's a sensible solution.

I think that using the Arduino to wedge the door open makes more sense that using it to send audio/vide data anywhere.

Bcarroll:
The goal is to use the arduino as a mechanism to get data (from sensors, microphone, camera, etc...) and pass the data back to a PC via serial (using a bluetooth module for wireless serial...).

You should stop there. "microphone" and "camera" are not simple sensors. Both generate significant amounts of data.

Bcarroll:
T but it sounds like the speed of serial is going to ultimately be the issue with audio/video, especially if 57000 bps is the maximum reliable speed.

Step back and realize this isn't necessarily a limit of the Arduino. 57000 (or even 115200) are physical limits of the interfaces you are trying to use. You are simply far more data than can be transmitted in a reasonable amount of time.

Essentially you are saying: "I want to move a boulder the size of a house, with a tricycle." Yah you can do it... but how much effort and time will it require?

I'll try again.

SPI is serial and it's a damned sight faster than 115200 bps.

Can ya get that to bluetooth? Can BT handle megabytes per second?

I'm sure there's better solutions but that's not the point.