Raspberry Pi Security Cam From Scratch: Motivation and Hardwares [Part 1]


I wanted a security camera for a while. There are many reasons that I am insist building it. Of course, the primary reason is for fun. If you are looking for a complete product, there are some open source pi security projects built already. For example, the MotionEyeOS. I personally have not installed it, but you can check out the YouTube for other people’s review. I want my Pi run other tasks whiling serving as a security camera. So I want to keep it running Raspberry Pi OS (formerly known as Raspbian). FYI, there is also a Python library for the Pi camera, you can use it for your project. I will not rely on that. Reinventing the wheel is not useful, but I hope I will learn something from doing it.

I like to plan things before actually doing it. Like a normal computer science project, the plan have to be scalable. My plan is using multiple cameras and sending the videos to the root server in-house. The root server can be attached to an additional storage with better cooling. The root server will also compute facial detention if the computation is possible in the Pi.


  • Raspberry Pi Zero

Raspberry Pi Zero is the cheaper model in the Pi family. I recommend Pi zero because it is sufficient for this usage. From inspecting top, Raspberry Pi Zero only has 12% CPU usage while taking video and encoding it.

The essentials are Pi Zero, SD card, micro-usb cable and power adapter.

Temperature wise, my kit came with a heatsink. I put the Pi Zero under 33°C (91.4°F) on a partial cloudy day. Being directed heated from sunshine for a while, the highest core temperature was 77°C. I think it works for me.

I found this Vilros Raspberry Pi Zero combo very promising. You probably will need to buy the standalone power adapter(like the one your phone is using) and longer cable for the security camera usage. You can also look for the other combos, but looking the one with w, it stands for the wireless.

You will need to buy a separate SD card since this combo does not include one. I recommend 16GB or up for the storage. The 16GB storage will provide you a greater flexibility. In case you want to transform it to anther project.

This combo doesn’t include HDMI cable, keyboard, mouse. If you do not have these, you will need to install it as headless(headless means no monitor output). The headless setup require you to use SSH method. Do not frustrate if you do not what SSH is. The whole process is not difficult.

  • Pi Camera

I recommend buying the first generation camera, which is under $10. The second generation is about $30, the newer HQ one is $50. I think the first generation camera is capable enough for the security camera usage. Please do note that the ribbon cable is different for the regular Pi and Pi zero. My purchase had the Pi zero ribbon cable included. I bough this one

  • My Root Server (Optional)

This is optional. You can save the video in the Pi Zero. However, if your Pi is stollen, your data will also be gone. It is doable if you want to use it for in-house application. I used my previous Pi 4 as a root server. Hope it can also handle facial detention computation. It seems struggle with it. I am still optimizing the code for the facial detention.