matt kaar

tech blogging on occasion

Raspberry Pi as a Baby Monitor

UPDATE (6-9-2014): Bernd Thul was kind enough to translate these instructions into German.

As we headed out of town for Thanksgiving, I was in search of my next tech project. On a whim I threw a Raspberry Pi and Yeti USB microphone in my bag, determined to create a networked, high-fidelity baby monitor.

It turned out to be easier than I thought.

First, the Yeti worked without needing a powered USB hub… score. Then Raspbian picked it out without any issues.

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Microphone [Yeti Stereo Microphone], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Finally, I stumbled across this excellent blog post from @mutsuda that shows how to use aplay and arecord to send captured audio to a remote system for playback. With these instructions, you’ll need another Raspberry Pi or separate Linux system for the listening side.

UPDATE 5-26-13: I’ve now added web streaming to the setup, so you don’t need another Raspberry Pi or Linux system to receive audio.

Here we go. First, make sure the levels are correct for both input and output (mine were muted by default).

$ alsamixer

Then run this test capture on the Raspberry Pi.

$ arecord -D plughw:1,0 -f cd -d 10 test.wav

And then this should play the test file out of headphone jack on the RPi.

$ aplay test.wav

Finally, to send sound to a remote system, give this a shot.

$ arecord -D plughw:1,0 -f dat | ssh -C user@remoteip aplay -f dat

You should hear remote audio out of the far end provided those mixer settings are correct too.

Enjoy your new Raspberry Pi baby monitor!