Apps and online services

About this project

The Idea

Amazon Alexa and Arduino have been forces to be reckoned with in their respective industries. With the prospects and realization of smart homes coming to fruition, the combination of these two companies in one project creates an exciting dynamic for innovation. One area that can be improved with these technologies is home security.

Description

This project is intended to develop the connection between Arduino and Amazon Alexa’s interaction for smart home security. Many indoor or outdoor spaces can be monitored and protected by simply saying, “Alexa ask Sentinel to arm my security.” Upon receiving the command, the software activates each individual Arduino sensor module. When the Arduino sensor module is powered on, it monitors the environment. Disturbances picked up by each PIR sensor are sent to the Raspberry Pi base station, which uploads them to a database with a unique identifier for each module. When asking Sentinel what happened, Alexa will access the Firebase to recount up to five events that day and their locations. Note: The code can be altered to hear more than that if desired.

Use

An Alexa skill on and Amazon Echo device will work in tandem with Arduino sensor modules, and Raspberry Pi base station in order to create a network of security sensors for both inside and outside your house.

The Alexa skill acts as the mediator between you and your Sentinel security system. It can arm, disarm, and recount the disturbances stored in the Firebase.

The sensors consist of an Arduino Nano R3, PIR motion sensor, NRF24L01 radio module, and four AA batteries in a holder. Multiple sensors can be named and used in different locations, both indoor and outdoor to create a network of sensing capabilities for a smart home. Each PIR sensor has a range of 10ft of monitoring space and can be located 20ft from the base station.

The Raspberry Pi base station compiles the sensor outputs when disturbances occurs and uploads them to the Firebase database from which the Alexa skill can retrieve information.

Sentinel security, will allow users to monitor their smart home through the combination of these innovative technologies.

The Project

SetuptheHardware

Arduino Sensor Modules

Step 1: Obtain all of the hardware components listed above.

Step 2: Use a 3D printer to manufacture the SensorBase.stl and SensorBack.stl files. Note: A strip of electrical tape on edge is not necessary but makes a nice seal for weatherproofing.

Step 3: Place all of the components in the module as shown.

Step 4: Use a soldering iron to wire the sensor module according to the Fritzing diagram and pictures below.

Step 5: Repeat Step 2 - Step 4 for as many sensor modules as you wish. Note: The code will allow for up to 256sensors.

Step 6: For each sensor choose a new sensor ID starting with "0" on line 17 on sensor.ino.

Step 7: Upload the modified sensor.ino to each Arduino Nano R3.

RaspberryPiBaseStation

Step 1: Use the Fritzing diagram to wire the Raspberry Pi with the NRF24L01 radio module.

Step 2: On the Raspberry Pi, download the Github repository and install the necessary resources for this project.

Step 2: Click "Add Project." It will prompt you to fill in your project name and country/region. Once the information is filled in, press "Create Project."

Step 3: Click "Add Firebase to your web app." Copy the apiKey, authDomain, databaseURL, and storageBucket onto a text editor like MS Word or Pages. Note: This confiuragtion data will be used for connecting the Raspberry Pi to Firebase.

Step 5: Click the "Rules" tab. Copy the code below into the online editor, replacing what was already there. This is necessary to change the security settings, allowing the project to access the database.

{
"rules": {
".read": "auth
".write": "auth == null"
}
}

Step 6: Now open the file lambda/index.js from the downloaded Github repository, and modify line 8 to match your Firebase project name as seen below.

firebase.host = "PROJECTNAMEHERE.firebaseio.com"

Package the AlexaSkillCode

Step 1: In your computer terminal, navigate to the downloaded Github repository then execute the setup-aws file. This will generate the zip file to be uploaded to your AWS Lambda Function.

Setup theAmazon Alexa Skilland AWS LambdaFunction

The Alexa Skill allows the player to play battleship through an Amazon Echo device. AWS Lambda is used to store the Alexa Skill code.

Step 1: Click here and sign into the Amazon developer console or create an account.