Raspberry Pi dan Alat Parkir UI

Download Raspberry Pi dan Alat Parkir UI

Post on 31-Aug-2014

1.506 views

Category:

Technology

2 download

Embed Size (px)

DESCRIPTION

Bagaimana Raspberry Pi digunakan pada gerbang utama (gerbatama) Universitas Indonesia (UI) http://www.python.or.id/2014/02/kopi-darat-python-indonesia-februari.html

TRANSCRIPT

<ul><li> Raspberry Pi dan Alat Parkir UI Gladhi Guarddin, M.Kom adin@ui.ac.id </li> <li> Tujuan Implementasi Raspberry Pi sebagai pengendali proses pengambilan data kendaraan pada gerbatama UI Setiap gambar yang dicapture akan diolah oleh aplikasi terpisah </li> <li> Wiring Sensor </li> <li> Raspberry in a Box </li> <li> Rangkaian in a Pipe {bomb} VCC 3.3V GPIO pin X GND </li> <li> Rangkaian in a Pipe {bomb} VCC 3.3V GPIO pin 8 GPIO pin 10 GPIO pin 12 GPIO pin 16 GND </li> <li> Konsep Rangkaian GPIO Normally True Pull UP, nanti down kalau di short circuit dengan Ground Mengapa perlu di Pull UP ? karena status GPIO nya adalah Floating </li> <li> Konsep Aplikasi Execute Shell (background) &amp; Python Controller read from GPIO capture jpg from IP Camera Execute Shell (background) &amp; capture jpg from IP Camera Execute Shell (background) &amp; capture jpg from IP Camera Execute Shell (background) &amp; capture jpg from IP Camera </li> <li> Python Code from time import sleep import RPi.GPIO as GPIO import os GPIO.setmode(GPIO.BOARD) GPIO.setup(8, GPIO.IN) GPIO.setup(10, GPIO.IN) GPIO.setup(12, GPIO.IN) GPIO.setup(16, GPIO.IN) GPIO.setup(18, GPIO.IN) GPIO.setup(22, GPIO.IN) GPIO.setup(24, GPIO.IN) GPIO.setup(26, GPIO.IN) (cont) </li> <li> Python Code (continue) while True: print( "8 : " , GPIO.input(8)) print( "10 : " , GPIO.input(10)) print( "12 : " , GPIO.input(12)) print( "16 : " , GPIO.input(16)) print( "18 : " , GPIO.input(18)) print( "22 : " , GPIO.input(22)) print( "24 : " , GPIO.input(24)) print( "26 : " , GPIO.input(26)) print( "---------------------") if GPIO.input(8) == False: os.system("/root/panggil.sh 3 10.39.66.105") if GPIO.input(10) == False: os.system("/root/panggil.sh 4 10.39.66.106") if GPIO.input(12) == False: os.system("/root/panggil.sh 6 10.39.66.104") if GPIO.input(18) == False: os.system("/root/panggil.sh 2 10.39.66.102") if GPIO.input(22) == False: os.system("/root/panggil.sh 1 10.39.66.101") </li> <li> panggil.sh panggil.sh -----------------------------------------------#!/bin/bash /root/ngefoto.sh $1 $2 &amp; &gt; /dev/null </li> <li> ngefoto.sh ngefoto.sh -----------------------------------------------#!/bin/bash sleep 2 TIME=`date` HARITGL=`date "+%Y-%m-%d"` JAMMENIT=`date "+%H:%M"` BASE="/run/foto/$HARITGL/$JAMMENIT/$1" FILE=`date "+%Y-%m-%d %H:%M:%S.%N"` mkdir -p "$BASE" curl "http://admin:@$2/image/jpeg.cgi" &gt; "$BASE/$FILE.jpg.tmp" mv "$BASE/$FILE.jpg.tmp" "$BASE/$FILE.jpg" </li> <li> Akses Capture Foto http://10.39.66.2/ </li> <li> Saving Cost Beli dari Vendor Loop Sensor Rp. 1 jt Bircher Rp. 2,25 jt Main Board Rp. 5,5 jt Beli dari Vendor 1. Loop Sensor Rp. 1 jt 2. Bircher Rp. 2,25 jt 3. Raspberry Pi Rp. 0.5 jt Seluruhnya dikali 6 Total Rp. 52,5 jt Poin 1 &amp; 2 dikali 6 + poin 3 Total Rp. 20jt </li> <li> Next Plate Recognition with Python Gate Controller UI Cash Transaction (Integration with BNI Tap Cash) </li> <li> Q&amp;A </li> </ul>