Rohini Boralkar
Published

Railway Platform Accident Preventing System

Preventing railway platform accidents by alert alarm and notification system when it detects human motion beneath the platform.

IntermediateWork in progress1 hour650
Railway Platform Accident Preventing System

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1
Buzzer
Buzzer
×1
Micro-USB to USB Cable (Generic)
Micro-USB to USB Cable (Generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud
SMS Messaging API
Twilio SMS Messaging API

Story

Read more

Schematics

detect human motion using PIR sensor with alert alarm

Code

Human motion detection using PIR sensor

Python
1.Python code for reading data from the PIR sensor
2.sending an alert notification using Twilio credentials
3. Activate the buzzer
import conf, json, time, requests
from boltiot import Sms, Bolt

import RPi.GPIO as GPIO
from time import sleep

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

GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
buzzer=3 
GPIO.setup(buzzer,GPIO.OUT)

while True:
    response = requests.get('http://cloud.boltiot.com/remote/xxxxxxxxxx/digitalRead?pin=0&deviceName=BOLTxxxxx')
    data json.loads(response.text)
    print(data)
    sensor_value = int(data['value'])
    if sensor_value == 1:
        print("MOTION DETECTED")
        print("sending Notification")
        sms.send_sms("Emergency,Accident near to Railway platfrom no:X")
        GPIO.output(buzzer,GPIO.HIGH)
        print ("Beep")
        sleep(6) # Delay in seconds
    elif sensor_value ==0:
        print("SENSOR IS READY")
    time.sleep(5)

Credits

Rohini Boralkar
1 project • 1 follower

Comments