As an expectant Dad, I was searching for helpful things to do in preparation for the arrival of our little one. Once I had all the essential items ready, hospital bag packed and nursery painted I set about a little hobby project. I bought a Raspberry Pi when they first came out – a tiny, cheap low power computer. Until this point, I had been searching for a use – the baby monitor seemed like a perfect fit. Today I will walk through how to create a simple Raspberry Pi baby monitor with motion detection, temperature and a simple web browser interface so you can watch your little one on your Laptop or phone.
What you will need for the Raspberry Pi Baby Monitor
1 Laptop (to prepare the Raspberry Pi)
1 Raspberry Pi
1 Raspbery Pi Case
1 SD Card (at least 2gb, ideally 8gb or more, microSD for the newer Pi’s)
1 USB charger and micro usb cable
1 USB Webcam
1 Ethernet cable
2 Ethernet Powerline Adapters
If you’re not sure – I’d recommend getting a Raspberry Pi starter kit. The new PI comes with wifi, so no need for the ethernet powerline adapters, unless your wifi signle is unreliable, like mine!
Finally, the Raspberry Pi can be a little picky about webcams – I’ve used the Microsoft LifeCam HD-3000 (Retail Packaging) and it seems to work OK.
Step 1 – prepare the Raspberry Pi
Firstly, you will need to install the base Operating System onto the SD card for your Raspberry Pi. Head to the Downloads page of the official Raspberry Pi site and download the latest Raspbain SD card image onto your laptop. Follow the installation instructions on the official site.
- on Windows, download the free Win32DiskImager and point it at your SD card.
- on a Mac or Linux, use the dd command (e.g. sudo dd bs=1m if=path_of_your_image.img of=/dev/diskn where /dev/diskn is your SD card)
Warning – writing the OS to the SD card will replace all existing files on the card, so make sure you have backed up anything important!
If you can’t get your head around that – just buy a preprepared disk image.
Once the SD card is prepared, you are ready for step 2!
Step 2 – Install motion
I find it easiest to connect to the Raspberry Pi via SSH to run commands. On Windows – get Putty. On Mac OS / Linux, you probably already have SSH.
Put your shiny new Raspbian SD card into your Raspberry Pi. Plug in the Ethernet adapter and connect it up to the Raspberry Pi.
We’re now ready to boot! Plug in the USB charger and connect the Pi up via its micro-USB port. Once it powers on, you’ll see a few LED’s blinking – but that’s it – there’s no noisy fans or disks here! This is one of the reasons it makes a good baby monitor!
Now to connect to the Pi. You’ll need to find out the IP address it has been assigned – this is probably easiest done via your router. By default it will request an IP address via DHCP, so check your routers connected devices to see if the Raspberry Pi has turned up. For this walk through, let’s assume our IP address is 192.168.0.5
The OS ships with a default username / password. So to connect via SSH:
You will be prompted for a password – the default is password is raspberry
You will then see a standard console bash prompt. First things, let’s update the OS and make sure we are running the latest packages.
sudo apt-get update
sudo apt-get upgrade
For both commands, follow the prompts and press Yes (y) when requested.
This will download and install the latest updates from the Raspbian distribution, ensuring that any improvements, fixes and security patches issued since the disk image was created are running. The Raspberry Pi isn’t the fastest little computer in the world, so it might take a little while to churn through all the updates – go make some tea!
The heart of our baby monitor is a package called motion – this is the software which will monitor the webcam for us.
sudo apt-get install motion
Confirm the install with
when prompted and again the Raspberry Pi will download and install a bunch of software.
Note – you will probably see a final warning ([warn] Not starting motion daemon, disabled via /etc/default/motion … (warning).) – don’t worry, we will sort this out next by configuring motion.
Step 3 – Configure motion
Now we need to set about configuring motion to our requirements. Have a look at the configuration guide to see what’s possible – I’ll cover the basics to get a basic monitor set up.
Motions configuration is controlled by a simple text file which you can find at
To edit we use the command
sudo nano /etc/motion/motion.conf
The config file is big – we want to set the following items:
daemon on framerate 2 width 640 heigh 480 ffmpeg_video_codec mpeg4 webcam_localhost off
We want it to run in daemon mode so that it starts automatically once the Raspberry Pi boots. The Raspberry Pi isn’t terribly powerful, so let’s set the framerate to a lowish value to keep it stable. We want to be able to see the webcam from other devices on our local network (e.g. Laptops, phones) so make sure the localhost setting is off.
Once these are set, save the file and exit:
One last bit of config is needed to allow the daemon to start:
sudo nano /etc/default/motion
and then change the “start_motion_daemon” line from no to yes
Save and exit as before. Now we are ready to start the motion daemon!
sudo service motion start
Step 3 – Check its working!
You should now be able to browse to your Raspberry Pi baby monitor from a laptop or phone connected to your local network.
Note – remember to swap the IP address for the assigned to your Raspberry PI!
I’ve had the best results from using FireFox – see what you find and let me know in the comments. With our simple setup, we have two brilliant features:
- Each time the camera detects motion, an image and video is saved into the /tmp/motion folder
- You can see a live stream of the camera at http://192.168.0.5:8081
If anyone else has any brilliant ideas, let me know in the comments!
Tiny disclaimer – Whilst I had fun with this project, I wouldn’t suggest relying on it as your only baby monitor! Check out our review of a more reliable baby monitor if you are looking for ideas!