Monday, March 30, 2015

Starting Final Project - 

Smart Parking :

0.1 Introduction:

Purpose:

                The purpose of this document is to present a detailed explanation of Smart Parking Detection. This will describe us  purpose and features of the system, the interface of the system, what the system will do, the constraints under which it must operate and how the system will react to external stimuli. This document is intended for both the stakeholders and developers of  system.

1.0 Purpose & Requirements Specification

1.1 Purpose of Project:

                “ Decade of the Urbanization “ – World’s growing love affair with cities shows robust growth of urban population which is at rate of 1.8% per every year in this decade. With estimation of 70% of world’s population live in cities by 2050, managing urban areas has become one of the most important development challenges of the 21st century. As a result, countries will face numerous challenges in meeting the needs of their growing urban populations, including for transportation, infrastructure, housing, energy and employment, as well as for basic services such as education and health care. One of such problem is traffic congestion and parking in cities. According to a survey about 30% of traffic congestion in cities during peak times is because of drivers searching parking areas. To address this problem this project proposes a  well planned parking system that would save time, fuel  and helps us to reshape our cities and put them in path of “Smart Cities”. This smart parking system allows us to check the parking availability remotely using a web application.

1.2 Behavior :

                Smart parking Detector is mobile application which helps people to locate available parking spots in the location that user planning to travel and can reserve a parking spot. This parking system can be installed in all parking demand places in the city such as Shopping malls, Airports, hotels etc.  User needs to install this application on his mobile by downloading it.  User can get availability of parking or propose next parking available time.

1.3 System Management Requirement:

                This system provides remote monitoring  and control function. Administrator will be appointed based of the size of institution, who monitors sensors, payment issues, timing issues (towing vehicle in case of delay in moving out). He also monitors the accuracy of system and update information accordingly.



1.4 Data Analysis Requirement:

                 System will maintain a repository to provide information to support decision making in determining pricing and planning. System will also calculate the time of next available parking slot and should report it to user.

1.5 Application Deployment Requirement:


                Smart parking detectors can be installed in any place in 10 minutes. To install Smart Parking System in any institution will happen in incremental manner instead of blocking all the parking and installing(depends on the size of institution) which may take few hours of shutdown of that particular block.  Internet connection is mandatory for these devices which can be provided with Wifi or Ethernet. These devices fetches and update the information from/in to a database, which is located on a web-server. User should be connected with internet to get the updates on available parking slots.

2.0 Process Specification:

2.1  USE case diagrams:


2.2 Sensor level diagram :



Sensor keeps on checking for a vehicle presence in the parking slot( uses distance sensor) .  If it finds any change in its state it will update those details in Database. If parking slot is empty it will update the total availability count adding one to it. When parking slot at particular sensor is occupied, it will update the availability count by subtracting one from it. When parking is full, it will check expire time-stamp(estimated time to vacate)  in database and determines availability of next parking slot send those details to user.

If distance calculated by sensor is more than 50 cm, parking is available, if its less than that parking slot is occupied.


2.3 Process Diagram:



Rectangle – state 
Diamond – Decision
Circle – Start/Stop

3.0 Domain Model Specification:





4.0 Information Model Specification:



  5.0 Service Specification Model



6.0 IOT level Specification Model


Smart parking belongs to IOT Level-1 specification because it uses a single level node/sensor for collecting data and store it in local database. It also uses local analysis , Rest services.






Monday, March 16, 2015

Fire Detection using Raspberry Pi

 Here in we are going to see how simple it is to come up with your own Fire detecting device using flame sensor and Raspberry pi . We  can use a buzzer or turn on water sprinklers or even  send an automatic email to fire department.  I'm going to use an LED which blinks on fire detection.

Requirements :


  1.        Raspberry Pi
  2.        Flame detector
  3.        LED 
  4.        330 Ohm resistor


Flame Sensor Interface:


  •  VCC :-  3.3V-5V voltage
  •  GND :- GND
  •  DO :- board digital output interface (0 and 1)
  •  AO :- board analog output interface


Circuit/ Connection Images:



Connection Steps:

1) Connect Ground on sensor to ground on Raspberry Pi.
2) Supply + 3.3V to power( + symbol on sensor).
3)  Connect Digital out pin of sensor to GPIO input using a resistor (256 O).
4) Connect GPIO out to LED .

Demo:




Code :

I'm using GPIO 18 as output which is connected to LED and GPIO pin 25 as Input from Flame Sensor


from time import sleep
import RPi.GPIO as GPIO

#GPIO.setmode(GPIO.BOARD)
GPIO.setmode(GPIO.BCM)

GPIO.setwarnings(False)

LedOut = 18
Flamein = 25

#Switch Pin
GPIO.setup(Flamein, GPIO.IN)

#Switch Led
GPIO.setup(LedOut, GPIO.OUT)
count = 0

while True:
    try:
        if (GPIO.input(25) == True):
            print 'fire in your house'
            GPIO.output(LedOut, 1)
            sleep(0.1)
            GPIO.output(LedOut, 0)
            sleep(0.1)
            GPIO.output(LedOut, 1)
         
        else:
            print 'you are safe'
            GPIO.output(LedOut, 0)
         
    except KeyboardInterrupt:
        exit()
GPIO.cleanup()