Security IP camera using Raspberry Pi

UPDATE: I have now deployed the RPi webcam and it is working. It needs better connectors for the wiring, and the front panel needs some cosmetic work. It currently only streams video, not audio. I may add mpd for audio streaming. I have also not connected the lighting control to the RPi yet, and there is no speaker for an intercom. Motion is being detected and pictures and a short video are being saved, but currently not emailed anywhere. Switching on the LEDs at night improves the picture but it is still rather dark. It might be bright enough to get a recognisable picture of someone standing by the door.

I am currently investigating putting a security camera near my front door so that I can record who comes to the door and possibly talk to them over an intercom.

I already have a cheap Wanscam IP camera connected to my home automation system, but that is only suitable for indoors.

Near my front door is a panel with some housing behind it, which used to contain an old intercom system, so I want to use that for the camera. It means that the camera needs to be small.

I prefer an IP camera to other sorts of security camera as it should be much easier to integrate with my home automation system. I want the camera to have infrared lighting so that it works at night.

There seem to be two main choices: buy a complete outdoor IP security camera or build one using a small computer. The Raspberry Pi is by far the cheapest small computer that is up to this job. I have already used webcam streaming and motion detection with a Raspberry Pi in my robotic projects.

Another constraint that I have is that the existing hole from the intercom housing to the inside of my house is quite narrow and I do not want to make it much bigger. It is big enough to feed wires through but not for larger connectors or devices.

The cheapest camera that I found on amazon that looked suitable was this one.

I bought this and tried it with the Raspberry Pi. As its camera feed is composite video, I need a usb video capture device to feed the signal into the Raspberry Pi. I have two of these: a very old Belkin Videobus II and a much newer ClimaxDigital device, which I bought to help one of my grandsons to capture video from his Minecraft sessions on an Xbox.

Unfortunately I could not get either of these to work on Raspbian Wheezy on the Raspberry Pi.

The Belkin VideoBus II using the usbvision driver. It shows up on lsusb on the RPi, but I had no luck getting data from it using a variety of tools including motion, fswebcam, guvcview and mplayer. Either it hangs trying to open /dev/video0 or it gives segmentation faults.

I did not have much better luck with the newer ClimaxDigital device. This uses the em28xx driver, and there seem to be known problems with this on Linux. It appears to work, but I get nothing but blank screens from it. On googling it, I found that this is the expererience of most other people.

In fact there does not seem to be any usb capture device that works reliably on the Raspberry Pi. Some people have had partial success building their own kernels, and modifying the various drivers. Even doing this, I have not found anyone who has any device working reliably. I do not want to start doing linux driver development myself at the moment, so I think I will give up on usb capture devices on the Raspberry Pi for the moment. It is very disappointing that after a year of the RPi being out, nobody has got a usb capture device working.

If I am to stick with using a Raspberry Pi, this means that I need to use a webcam rather than a camera with a composite video feed.

I did look at the alternative of using a wireless sender and receiver with the composite video security camera, but I would still have the problem of getting the signal into a suitable host computer, and the solution is expensive, bulky and inflexible.

The problem with using a webcam is finding a webcam that is waterproof, small, cheap, and does infrared night vision. I have not found one that meets all these criteria.

I have found outdoor IP cameras that are reasonably cheap, so forgetting about the Raspberry Pi and using one of these is an option, but the ones I have found are much bigger than I would like, e.g. this Foscam. Another problem with the IP camera solution is that I do not have control of the software running on it. Using a Raspberry Pi and being able to add extra features in the future (such as voice control) is much more appealing.

So for the moment, I have decided to go with a cheap webcam solution.

I know that this camera works with the Raspberry Pi. It is not weatherproof, but it is small so I can house it in the intercom housing and make it weatherproof. It is cheap enough that I do not mind cutting and its wires so I can fit it in the existing housing. It does not have night vision but it does have LED lighting which might make it work a bit at night. Also, there ia a potentiometer that controls the brightness of the LED lighting. I should be able to replace this with a digital potentiometer and control it from the Raspberry Pi. I will try this solution while I keep looking for something better.

I am using a cheap Wifi dongle and the motion software on the Raspberry Pi. I should be able to email and upload pictures when motion is detected, switch a video stream on and off, and control the LED lighting on the camera. There is also a microphone in the webcam, so some sort of intercom capability is also possible. I would need to put a small speaker in the intercom housing.

There is another option for the camera, which is to use the Raspberry Pi camera when it comes out. I don’t know if it will be suitable for this use, but if I can house it in the the intercom housing and sort out the wiring to it, it might well be a possible replacement for the webcam. Again, it will probably not do night vision, but I could mount some infrared LEDs on the intercom panel.

This entry was posted in Home automation, Raspberry PI and tagged , , . Bookmark the permalink.

8 Responses to Security IP camera using Raspberry Pi

  1. Roger Coleman says:


    Thanks for your post. I’ve been using the same camera following your suggestion and it is working beautifully, however I’ve never been able to configure motion to work with any resolution other than 240 x 320. If I set the resolution to anything else, motion just refuses to start. How did you get it to work with others?

    I am also making a porch cam, will share pics when I’m finished.

    • Geek Grandad says:

      Mine is also working at 320×240. I thought I had this camera working at higher resolution on a Raspberry Pi, but perhaps not. I use a PS3 Eye camera on the my RPi robot as the microphone is good for speech control, but that camera is more expensive and not as good for a security camera. Let me know how you get on. I have not done anything more with my front door camera, apart from experimenting with sending me emails when motion was detected. This works, but motion is detected too often by passers by for this to be useful for me. At some point I plan to link the camera to the door bell and email or ftp a picture when the bell is rung. I might link it to the letter box as well. I would really like a better night vision camera.

      • Roger Coleman says:

        Hi, thanks for coming back to me on this, it’s a shame you didn’t get motion running at a different resolution – I will keep trying to figure that out. Meanwhile I’ve found that using fswebcam instead, I’m able to capture good still images at 1280×720 using this camera, but I have to set the brightness manually which is not great for a camera outdoors. I’ve been experimenting with a PIR sensor to detect movement and then getting my light to come on and telling fswebcam to take a picture at full res. I’ll be installing it in the porch shortly, it’ll be interesting to see how useful it is. Thanks Rog.

  2. lolren says:

    use a microsoft hd 3000 camera with mjpeg streamer… is very cheap and it is working very good. i use the microphone to and in a couple of days i hope i will post my video intercom based on 2 pi`s:) almost working:)

  3. Pingback: My Raspberry pi

  4. HVAC Repair says:

    Any house from newly built to one built 200 years ago should have a comfortable
    interior all winter long. ” flooded homes, clogged bathrooms, overflowing kitchen sinks and even toilet bowls that flush the wrong side. In most cases, people would simply turn their systems off whenever they feel that the temperature is already suitable for what they need.

  5. Joe says:

    hi i’m trying to set up a webcam to use as a CCTV camera and am using a program called fswebcam on my raspberry pi . I have a guide to help me but every time i try to do a test image using the command ‘fswebcam test.jpg’ it says it cannot find the /dev/video0 file. Any assistance would be helpful. If you need more info please email me at

    • Geek Grandad says:

      Use lsusb to make sure your camera has been recognized. Sometimes the problem is insufficient power to the camera. You may have to use a powered usb hub, if you are not already using one.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s