Day 3: $75 hand-crafted surveillance camera
Worked solely on hardware today — no software. It’s part of my plan to shift focus to learning some hardware before I go for my 3-month web development course with General Assembly.
I have a few electronics projects that I’d like to get my hands dirty for:
- Electronic door lock with PIN access
- Home security camera
- Some kind of drone
- In-helmet inter-communication headsets
It’s a tentative list, but this should keep me busy for at least 2 weeks. Probably more.
Today I decided to start with #2, the home security camera. I wanted to make my own surveillance camera to monitor our living room, in case our Airbnb guests decide to mistreat Brownie while we’re out.
My requirements are for it to (1) stream footage live in Chrome if I want to, (2) record a burst of still photos when motion is detected (and not record all the time, in order to save disk space), and (3) upload the files to an online repository, like Google Drive.
To be honest, I hoped from the start that I’d be able to find an open-source project that I can use to achieve all that without me having to write any code. After all, C++ isn’t like JavaScript — my only experience coding in C++ was with my Arduino Starter Kit. I’d have to learn a lot to be able to write a program that is stable enough to be used for surveillance, even if it’s just for home and not a business.
Thankfully, I found ccrisan’s motionEyeOS project after about 30 minutes of searching. It is everything I wished for: a very simple graphic user interface (no need to write code, just fiddle with buttons and drop-down menus), auto-detection of on-board cameras, and even the protocol to set up file-uploads to Drive.
To think that I almost went with a more primitive project made in 2013 with instructions on Instructables… lucky I read in the comments about the motionPie, which has been running for a long enough now for it to be renamed to motionEyeOS. One year in tech feels more like five.
Seriously, though. We live in an age where technology advances so fast that it’s not only possible to get for free software that used to be at the core of successful corporations, it’s actually likely. The thought that a guy like me who knows almost nothing about electrical engineering can put together a home-made surveillance camera with motion detection capability is mind boggling.
Here, it is the advent of affordable (cheap, even) single-board computers that made it possible. In this case, I’m using a Raspberry Pi for my project, a $35 SGD computer that is open-source from the ground-up.
(The Raspberry Pi Foundation just released the Pi Zero in Christmas last year, which is the smallest mainstream single-board computer and the cheapest, at $5 USD. They’re so cheap, the foundation distributed a free Pi Zero with each magazine (Pi mag) it sold. Just think about that, a free computer with the purchase of a magazine…)
Home surveillance camera for under $75 SGD
After spending slightly more than 5 hours working on putting together the Pi computer, Pi camera, and various other components (WiFi dongle, power supply with the right ratings), I have a 75 percent finished product. All in a day’s work!
I managed to stream video live on my web browser (Chrome), and I got it to capture a burst of photos when I waved my hands in front of the camera (motion detection). Because there’s a GUI that I can easily interact with on my browser whose code was written mainly by one person (thanks ccrisan!), I was able to view the photos that were written into the SD card of my Raspberry Pi surveillance camera remotely, directly from Chrome, right off the bat. Isn’t that spectacular?
There are a few things that I will have to do to complete the project tomorrow, but I’m happy with the progress. It’s rare for any project to go this smoothly, let alone one that involves both hardware and software.
So far so good.