My favorites | Sign in
Project Home Wiki Source
Search
for
MakingOf  
Making of the Autonomous Surveillance Camera
Design, DIY, HowTo
Updated May 17, 2011 by bshi...@me.com

Introduction

There are a lot of surveillance cameras out there on the market. Some provide old-school AV output, some plug into local network with Ethernet cable, some need Wi-Fi to work. However, there are almost no fully autonomous cameras that do not require either external power or local network connection.

The Autonomous Surveillance Camera is, as name implies, a fully autonomous device. It is able to operate up to a month on single battery charge. It uses cellular network for communication. The device checks pre-defined email mailbox once an hour. If a new email is received the camera takes a picture, saves it on a SD-card and emails the image to its owner.

I have designed this device for the case when I am our for a long time, but I still want to make sure how are things back home. You know, when you have one of those paranoia moments about an iron or a leaking tap you could just send an email and in about 30 minutes get a picture confirming that everything is OK.

Making of the camera was also an interesting journey I would like to share.

Components Choice

The Autonomous Surveillance Camera consists of four primary components: GSM modem, camera, SD-card, micro-controller and power supply system. Here are parts that I have used:

MultiTech MTSMC-G2-IP I have chosen this GSM modem mainly because of its built-in POP3 and SMTP support. Although these protocols are not very complicated to implement having them implemented saved some time.

LinkSpite JPEG Camera This is a great little device. Built-in JPEG compression support saved me a lot of development effort. The camera produces a 640x480 image. The image is around 50K; it is small enough to rapidly transmit over a cellular network.

Sparkfun's microSD Shield Although there are a few SD card circuits available I decided to go with this one because it is very easy to work with both in software (Sparkfun provides great APIs) and in hardware (again, thanks Sparkfun for built-in voltage conversion).

ATmega 328P This micro-controller was a natural choice. Arduino Uno uses this chip, so there are plenty of libraries and examples out there. Unfortunately, Arduino Uno itself consumes too much power when it is in a sleep mode, so I had to build a board with more efficient power supply system myself.

TPS2020 and LM2936 TPS2020 is a great power distribution IC. It allowed me turning circuit components on and off as I needed it. LM2936 is an awesome regulator with really low quiescent current. Combination of the two parts allowed my circuit to consume as little as 0.14mA in sleep mode. It stretches battery life for up to a month on a single charge; the camera is powered by 5V from two CR123A batteries.

Here are all parts laid out:



Breadboard Layout

Once parts have arrived I laid everything out on a breadboard. Proto-prototype helped me debug the circuit. It also transformed my table into a small cyberpunk jungle. Here is how it looked:



Coding

It took me about two months to fully code and debug camera's firmware. Following resources were very helpful when developing micro controller program:

  1. AVR Eclipse Plugin made it very easy to set up AVR project and flush it to the chip (I used AVRISP mkII, which worked great with my OS X).
  2. This implementation of LinkSpite Camera provided easy way of capturing an image.
  3. SdFat Library built by William Greiman was small and efficient (although I had to remove some un-used methods to make it even smaller).
  4. Martin Nawrath's Nightingale example gave a good idea about how sleep mode works on ATmegas.

I had to write a wrapper serial communication with MultiTech GSM modem (it certainly works with MTSMC-G2-IP and it should also work with an Universal Socket device). Check out SocketModem.cpp.

All code is released under MIT license and could be found on Google Code.

Body Design

Unfortunately, not all DIY projects have nice looking enclosures. I decided to use 3D printing service to achieve a look I want.

After struggling quite a bit with 3D CAD tools, I have discovered a great program OpenSCAD. It is a great script-based CAD editing software. Instead of using mouse to draw 3D shapes one just types in commands. For example, a sphere with radius of 5 would be sphere(r=5). Awesome, right?

Caliper, couple weeks of modeling and an order placed at Ponoko brought me to this:

Source for the CAD files could be found under enclosure folder in the project source.

Result

Everything fit together nicely. The camera is currently working and carefully surveilling my house. I am using AT&T GoPhone as a network plan. It costs about 8 cents to check an email and about 70 cents to send an email with a picture.

Check out the video and some pictures of the contraption.

Comment by dorjan.s...@gmail.com, May 18, 2011

Fascinating !

Comment by ToddHoff...@gmail.com, May 18, 2011

Very cool! How do you send email to the device without any configuration?

Comment by project member bshi...@me.com, May 20, 2011

@ToddHoff? The configuration is stored on an SD-card that is inside the camera. It is a simple .properties file that has information about POP3/SMTP accounts, carrier APN, check duration, etc.

This SD card also holds images taken by the camera.

Comment by joel...@gmail.com, May 20, 2011

Have you considered adding a passive infrared sensor for the device and/or an IR camera with flash? Do you have an estimate of the total hardware cost of the unit? What is the power supply for the unit?

Comment by Lee.Sa...@gmail.com, May 20, 2011

Did you edit the video for the super fast reply? If it checks an email account once an hour, how'd it get back to you so fast?

Comment by jdbuckma...@yahoo.com, May 26, 2011

That is too cool, so how much are you selling it to the governent, and how much will you sell me one????

Comment by isabelle...@gmail.com, May 29, 2011

Too hot! I'll try it very soon!!

Comment by tpeters...@gmail.com, May 29, 2011

Great job and nice construction. This is a very useful little gadget. Thanks. For those with less skills, maybe it would cost less and be more covert if built into a hollow book???

Comment by stevenek...@gmail.com, May 31, 2011

Can you add your costs?

Comment by yamanoor...@gmail.com, Jul 24, 2011

Hi,

How did you attach the pictures in the mail inside your code?

Comment by bshi...@gmail.com, Aug 2, 2011

@yamanoor Attaching pictures was quite easy, actually. I just formed an email message with Base64-encoded attachment. Kinda like what you see if you select to see "raw" view of an email.

Comment by bshi...@gmail.com, Aug 2, 2011

@stevenek This project cost me about 100$ for cell radio, 100$ for other electric components and 250$ for the body.

Comment by bshi...@gmail.com, Aug 2, 2011

@tpeters Oh, you can absolutely built it into anything that has about 6x6cm of free space.

Comment by bshi...@gmail.com, Aug 2, 2011

@joel A passive infrared sensor is certainly something to think about. I am a bit afraid of a breeze draining my battery though.

This project cost me about 100$ for cell radio, 100$ for other electric components and 250$ for the body.

The camera is powered by two CR123 batteries.

Comment by pvs.vi...@gmail.com, Feb 16, 2012

Awesome! Could you please let me see the wiring to the MTSMC-G2-IP module? MultiTech? site isn“t very easy to find application notes and your project is what I found best on google ;-) Thanks!


Sign in to add a comment
Powered by Google Project Hosting