Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Manufacturing process

Build a Motion‑Activated Security Camera with Arduino and Bluetooth

Components and supplies

Build a Motion‑Activated Security Camera with Arduino and Bluetooth
Arduino UNO
×1
Build a Motion‑Activated Security Camera with Arduino and Bluetooth
1Sheeld
×1
Build a Motion‑Activated Security Camera with Arduino and Bluetooth
Breadboard (generic)
×1
Build a Motion‑Activated Security Camera with Arduino and Bluetooth
1Sheeld
×1
Jumper cables
×1
Build a Motion‑Activated Security Camera with Arduino and Bluetooth
PIR Motion Sensor (generic)
×1
LEDs with resistors
×1
Android phone with Bluetooth
×1
Build a Motion‑Activated Security Camera with Arduino and Bluetooth
Jumper wires (generic)
×1

Apps and online services

Build a Motion‑Activated Security Camera with Arduino and Bluetooth
Arduino IDE

About this project

This tutorial will show you how to make a motion-activated Camera. You can use this as a security camera, or as a party cam that takes pictures when there is motion. The pictures will be uploaded to twitter as an example and you will receive an SMS when something happens, so that you can check your account.

What do you need?

**MAKE SURE THAT YOU HAVE INSTALLED ALL THE 1SHEELD LIBRARIES**

Steps for creating this motion-activated camera:

Step 1

  • Connect your 1Sheeld to your Arduino
  • Connect the Arduino to your PC
  • Make sure the 1Sheeld's UART switch is open – otherwise the Compiler will give an      error.
  • Upload this code to the Arduino: 

http://codepad.org/ckMD0prd

  • Edit the number to SMS yourself

Step 2 (The LED)

  • Connect the led to pin number 8 and, with the resistor, to ground.

Step 3 (The PIR Motion sensor)

  • When you point the PIR motion sensor bubble away from you, to see the back with      the 3 connector pins at the bottom, connect it like the following:
  • The left pin needs to connect to pin number 2,
  • The middle pin needs to be connected to 3.3V,
  • The right pin needs to be connected to ground on your Arduino.

FRITZING:

Build a Motion‑Activated Security Camera with Arduino and Bluetooth

Step 4 (Connecting)

  • Pair your Android device to your 1sheeld, via the 1Sheeld app, through Bluetooth
  • Select the following shields:
  • Camera shield 
  • Twitter shield (or the Facebook shield, if you want to use Facebook. Use this code: Facebook.postLastPicture("HappyHolidays")
  • Text to speech shield, if you want
  • SMS shield, to be notified when something happens
  • Make sure that you are logged into all your accounts and that everything is authorized. Make a secondary Twitter account for your code.

Step 5 (Ready to go)

  • Make sure the code is uploaded, and wait for the LED to switch off.
  • Switch the UART switch to closed, to begin communication between the 1sheeld and your phone.
  • Check your Twitter account to look at the picture taken.

NOTE : Make a secondary Twitter account, and with your primary one FAVORITE the secondary one, to get notifications when something happens. When the security camera captures something and uploads it, you'll be notified. Or, use your primary account and get an SMS notification when something happens.

Code

  • Motion Activated Security Camera CODE
Motion Activated Security Camera CODEJava
Add to Arduino IDE and UPLOAD to 1Sheeld and make sure that on the 1Sheeld the UART switch is switched to the off position.
//Need to include the following to avoid memory overload:
#define INCLUDE_SMS_SHIELD //sms
#define CUSTOM_SETTINGS
#define INCLUDE_CAMERA_SHIELD //camera
#define INCLUDE_TEXT_TO_SPEECH_SHIELD //text to speech
#define INCLUDE_FACEBOOK_SHIELD //facebook
#define INCLUDE_TWITTER_SHIELD //twitter

#include <OneSheeld.h> 
int ledPin = 8;                // choose the pin for the LED
int inputPin = 2;               // choose the input pin (for PIR sensor)
int PIR = LOW;             //The motionsensor's value
int val = 0;  


void setup() {
  pinMode(ledPin, OUTPUT);      // declare LED as output
  pinMode(inputPin, INPUT);     // declare reading sensor as input, this is the part on the Motions sensor that find the difference between no movement and movement
   OneSheeld.begin(); // Begin the onesheeld code

 
}

void loop(){
  //loop begins
    val = digitalRead(inputPin);  // read input value of the movement dectetion pin
  if (val == HIGH) {            // check if the is movement
    digitalWrite(ledPin, HIGH);  // turn LED ON  to indicate movement was found  
    delay(100); //Delays the loop for 1/10 second

    
    if (PIR == LOW) { //if the PIR value is equal to LOW do the following:
       SMS.send("0123456789","Motion DETECTED , Check Twitter for image"); //ADD your NUMBER INSTEAD OF 0123456789 , EDIT YOUR OWN
       PIR = HIGH; //Set PIR to HIGH and NOT LOW sothat it wount do a infinite loop
       TextToSpeech.say("got you"); //phone speaks this is not neaded just remove if you want this silenced 
       Camera.setFlash(ON); // Putting the flash on incase it night
       Camera.rearCapture(); //Taking the picture from back camera
       Twitter.tweetLastPicture("Posted with #1sheeld @1sheeld"); //posting the image to twitter
      // Facebook.postLastPicture("Posted by User");  //ENABLE this if you want to USE FACEBOOK          
       delay(1000); // Delay for 1 seconds sothat the value resets and th movement is different
       
    
    }
  } else { // if no movement
      digitalWrite(ledPin, LOW); // turn LED OFF        
      if (PIR== HIGH){ //nested if , if that value was HIGH , set to low and it wil check everything

      PIR = LOW;
      //loop restarts
    }
  }
}

Schematics

Untitled%20Sketch.fzz

Manufacturing process

  1. ESP32-Powered Motion-Detecting Security Camera for Discord
  2. Build a Smart Home Automation & Security System with 1Sheeld
  3. Smart Motion-Activated Water Gun Built with Arduino Nano
  4. Build a 4x4x4 LED Cube with Arduino Uno & 1Sheeld – Interactive LED Project
  5. Arduino MKR1000 WiFi Pick‑to‑Light System – Project 2
  6. Arduino-Powered Security System: Smart Motion Detection & Alert
  7. Gesture‑Controlled PC with Arduino and Python – Hands‑Free Operation
  8. Android Motion‑Detection Camera Controlled by Arduino MCU
  9. DIY Ultrasonic Security System with Arduino – Real-Time Distance Detection
  10. Build an Arduino Security & Alarm System – Step-by-Step Tutorial