Awesome Open Source
Awesome Open Source


This project elevates a Pi Zero simple webcamera with Motion Detection into a smart security camera by adding Cloud based image analysis via AWS Rekognition.

You can read more about this solution in the following blog posts:

You can also check out this presentation from JavaZone 2017 where I describe the solution. The slides from this talk are also available.

Java or Node.js?

Both Java and Node.js versions of the AWS Lambda Functions are provided. Due to naming differences I have also provided seperate Step Function definitions for both the Java and Node.js versions.

Heres another blogpost that describes the differences between the two versions.


  1. s3-upload: Handles upload of image files from Pi Zero to Amazon s3.
  2. motion-config: Configuration files for Motion (running on a Pi Zero).
  3. aws-lambda-functions: Choose between Node.js or Java source code for all AWS lambda functions.
  4. aws-step-functions: JSON definitions for orchestration of AWS Lambda Functions.

How to use

Note that this repository is provided as a record of my Smart Camera Project, which was originally created in December 2016 and further developed through to early 2018. It is a record for those interested and is not actively supported.

All the code is provided as is, and it is left to the user to work out the fine details for themselves. The AWS documentation is very useful here. Remember that GIYF.

Each subdirectory in this repository has simple instructions. Note that there are naming dependencies in this project, so make sure that any naming changes are applied across the repository.


The following prerequisites are required for working with this repository.

AWS Credentials
  1. AWS Credentials.
  2. You'll also need to be using a AWS Region that supports Rekognition, Step Functions, Lambda, s3 and SES (for example 'eu-west-1').
S3 Bucket
  1. You'll need a s3 bucket where your images can be uploaded for processing.
  2. The bucket will need two root directories : "/upload" and "/archive".
  3. Directly under the "/archive" directory, create the "/alerts" and "/falsepositives" subdirectories.
  4. In the "Permissions->Bucket Policy" tab for your S3 Bucket, set up the following Bucket Policy:
    "Version": "2012-10-17",
    "Statement": [
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            "Action": [
            "Resource": [

To make your S3 even more secure you can swop "*" with the full ARN for the IAM role associated with your nodemailer-send-notification or ses-send-notification Lambda Function.

Suggested Implementation Plan

  1. Set up your PiZero webcamera with Motion.
  2. Create an AWS account.
  3. Create an S3 Bucket.
  4. Implement s3-upload from PiZero to S3 Bucket.
  5. Implement all your aws-lambda-functions and test them individually.
  6. Implement your aws-step-function. Test it.
  7. Set up the S3 Trigger (Java or Node.js) that triggers the Step Function.
Related Awesome Lists
Top Programming Languages

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Javascript (1,119,969
Java (404,180
Amazon Web Services (38,974
Camera (16,807
Lambda Functions (13,971
Amazon (11,045
Aws Lambda (3,545
Aws S3 (1,417
Nodemailer (892
Image Analysis (655
Aws Sdk (571
Aws Ses (243
Aws Iam (183
Aws Rekognition (74
Aws Step Functions (54
Web Camera (30
Aws Sdk Js (16
Arn (5
Bucket Policy (3