Project tutorial
Intrusion Alert System using Arduino and Bolt IoT

Intrusion Alert System using Arduino and Bolt IoT

Get an Email and Sms on your mobile and sound alert whenever someone enters in your room.

  • 3,487 views
  • 0 comments
  • 17 respects

Components and supplies

Apps and online services

About this project

Make an account on twillio for SMS.

SID=" "

AUTH_TOKEN=" "

FROM_NUMBER=" "

TO_NUMBER="Your number "

These things you will get from twillio.

Code

Python Code for SMS and Email.Python
import  json, time, requests
from boltiot import Sms, Bolt
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

email = ''
password = ''
send_to_email = ' '
subject = 'intrusion'
message = 'Someone Entered !!'

msg = MIMEMultipart()
msg['From'] = email
msg['To'] = send_to_email
msg['Subject'] = subject

msg.attach(MIMEText(message, 'plain'))

SID=" "
AUTH_TOKEN=" "
FROM_NUMBER=" "
TO_NUMBER=" "

sms = Sms(SID, AUTH_TOKEN, TO_NUMBER, FROM_NUMBER)

while True:
    response = requests.get('http://cloud.boltiot.com/remote/e0f2449f-c1b0-483c-8bd8-f4ba5fc32a89/digitalRead?pin=0&deviceName=BOLT6094123')
    data=json.loads(response.text)
    print(data)
    sensor_value = int(data['value'])
    if sensor_value == 1:
        print("MOTION DETECTED")
        print("sending SMS")
        server = smtplib.SMTP('smtp.gmail.com', 587)
        server.starttls()
        server.login(email, password)
        text = msg.as_string()
        server.sendmail(email, send_to_email, text)
        sms.send_sms("SOMEONE ENTERED")
        server.quit()
    elif sensor_value ==0:
        print("SENSOR IS READY")
    time.sleep(5)
Arduino CodeC/C++
void setup() {

  pinMode(2, INPUT); //Pin 2 as INPUT

  pinMode(3, OUTPUT); //PIN 3 as OUTPUT

}


void loop() {

  if (digitalRead(2) == HIGH) // check if PIR is triggered.

  {

  digitalWrite(3, HIGH);   // turn the LED/Buzz ON

  delay(100);                       // wait for 100 msecond

  digitalWrite(3, LOW);   // turn the LED/Buzz OFF

  delay(100);                       // wait for 100 msecond

  }

}

Schematics

Final Circuit Diagram
Intrusion cqtdgq1in5

Comments

Similar projects you might like

Android App-Based Home Automation System Using IOT

Project tutorial by Team Autoshack

  • 49,354 views
  • 22 comments
  • 141 respects

Anomaly Detection & Temperature Monitoring Using Bolt IoT

Project tutorial by ashish anand

  • 3,852 views
  • 2 comments
  • 19 respects

IOTca2

Project in progress by 3 developers

  • 1,295 views
  • 0 comments
  • 3 respects

Ultrasonic Security System

Project tutorial by Ivan

  • 42,420 views
  • 33 comments
  • 98 respects

Water Level Alerting System

Project tutorial by Pranav Kundaikar and Vinayak Shantaram Joshi

  • 7,238 views
  • 9 comments
  • 15 respects
Add projectSign up / Login