Project tutorial
Christmas Presents Intruder Detector

Christmas Presents Intruder Detector © GPL3+

See when your kids move their presents! Detector sets off an audio alarm and sends an alert directly to your phone!

  • 3,341 views
  • 5 comments
  • 12 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)

Apps and online services

About this project

Christmas Present Intruder Detector

Want to know when your kids are messing with the presents? Now you can!

Using the Arduino MKR1000 board, Adafruit accelerometer, piezo and Ubidots, parents can now keep track of spying little eyes.

The project is able to fit on a half-breadboard, use 3M VHB tape to secure your LiPo battery to the bottom of the breadboard. Feel free to use a larger Piezo if necessary, the one included in the instructions will produce a modest alarm.

Connecting the MKR1000 to the Ubidots cloud will allow for push notifications to be sent to your phone immediately upon activation.

Instructions

  • Gather the necessary equipment and supplies.
  • Login into your Ubidots account. If you do not have one, create a free account here.
  • If you have not previously used the Adafruit MMA8451 Accelerometer sensor, read the tutorial by Adafruit.
  • Some soldering is required for the Adafruit Accelerometer.
  • Assemble board and sensor per diagram, See photos for placement.
  • Login to Ubidots to create your Dashboard, Sensors, and Event (this is where you will setup email notification).
  • Upload code to your Arduino MKR1000.
  • Place board inside of gift to be monitored.
  • Get ready to stop those prying eyes!

The project works by detecting acceleration on the Z-axis. When the SI unit is greater than 10, the audio alarm sounds and notifies you immediately.

Code

Present DetectorArduino
/*
Project: Present Detector
Created by: David Escobar
*Check out my site escobartechnologies.com*

MKR1000 board
Ubidots Account
*/

#include <SPI.h>
#include <WiFi101.h>
#include <UbidotsArduino.h>
#include <Wire.h>
#include <Adafruit_MMA8451.h>
#include <Adafruit_Sensor.h>
#define ID "Variable ID"
#define TOKEN "Ubidots Token"

char ssid[] = "Enter Network Name"; //  your network SSID (name)
char pass[] = "Enter Network Password";    // your network password (use for WPA, or use as key for WEP)
int status = WL_IDLE_STATUS;

unsigned int freq = 5000; //freq for piezo sound, change if higher volume needed
unsigned long time = 3000; //current time is 3 seconds

Ubidots client(TOKEN);
Adafruit_MMA8451 mma = Adafruit_MMA8451();

void setup() {
    Serial.begin(9600);
    //mma.begin();
    if (! mma.begin()) {
    Serial.println("Couldnt start");
    while (1);
    }
    
    mma.setRange(MMA8451_RANGE_8_G);
    
    Serial.println("MMA8451 found!");
    while (status != WL_CONNECTED) {
        Serial.print("Attempting to connect to SSID: ");
        Serial.println(ssid);
        status = WiFi.begin(ssid, pass);
        // wait 10 seconds for connection:
        delay(10000);
    }
}

void loop() {
    mma.read();
    sensors_event_t event; //get sensor data
    mma.getEvent(&event);
    // uncomment serial lines if needed
    /*
    Serial.print("Accelleration: ");
    Serial.print(event.acceleration.z);
    Serial.println();
    */
    client.add(ID,event.acceleration.z);
    client.sendAll(); //send data to ubidots
   
   if(event.acceleration.z > 10.0){
        tone(8,freq,time);
    }
    delay(1000); //wait 1 second 
}

Schematics

Present Detector Diagram
2aojl3a0bzbt5boklv1s

Comments

Similar projects you might like

Healthcare Skin Pressure Detector

Project tutorial by David Escobar

  • 5,089 views
  • 2 comments
  • 17 respects

Christmas Tree Water Level via Cayenne and MKR1000

Project showcase by Ian Zahn

  • 1,767 views
  • 0 comments
  • 2 respects

IoT Christmas Tree Topper

Project tutorial by Balázs Simon

  • 1,638 views
  • 0 comments
  • 9 respects

Arduino EMF Detector A.K.A Ghost Detector

Project showcase by Patel Darshil

  • 5,376 views
  • 8 comments
  • 15 respects

Hackable Christmas Greeting Card

Project tutorial by Neoxelox

  • 1,664 views
  • 0 comments
  • 3 respects

Bare Conductive Leak Detector

Project tutorial by Samir Undavia and Adam Cellon

  • 3,385 views
  • 2 comments
  • 10 respects
Add projectSign up / Login