raspberry pi dan alat parkir ui
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.htmlTRANSCRIPT

Raspberry Pi danAlat Parkir UIGladhi Guarddin, [email protected]

Tujuan Implementasi● Raspberry Pi sebagai pengendali proses pengambilan data kendaraan
pada gerbatama UI● Setiap gambar yang dicapture akan diolah oleh aplikasi terpisah



Wiring Sensor

Raspberry in a Box

Rangkaian in a Pipe {bomb}
VCC 3.3V
GND
GPIO pin X

Rangkaian in a Pipe {bomb}
VCC 3.3V GPIO pin 8
GPIO pin 10
GPIO pin 12
GPIO pin 16
GND

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”

Konsep Aplikasi
Python Controllerread from GPIO
Execute Shell (background) &
Execute Shell (background) &
Execute Shell (background) &
Execute Shell (background) &
capture jpg from IP Camera
capture jpg from IP Camera
capture jpg from IP Camera
capture jpg from IP Camera

Python Codefrom time import sleepimport RPi.GPIO as GPIOimport 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)

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")
sleep(0.2);

panggil.shpanggil.sh------------------------------------------------#!/bin/bash/root/ngefoto.sh $1 $2 & > /dev/null

ngefoto.shngefoto.sh------------------------------------------------#!/bin/bashsleep 2TIME=`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" > "$BASE/$FILE.jpg.tmp"mv "$BASE/$FILE.jpg.tmp" "$BASE/$FILE.jpg"

Akses Capture Foto
http://10.39.66.2/

Saving CostBeli dari Vendor● Loop Sensor Rp. 1 jt● Bircher Rp. 2,25 jt● Main Board Rp. 5,5 jt
Seluruhnya dikali 6Total Rp. 52,5 jt
Beli dari Vendor1. Loop Sensor Rp. 1 jt2. Bircher Rp. 2,25 jt3. Raspberry Pi Rp. 0.5 jt
Poin 1 & 2 dikali 6 + poin 3Total Rp. 20jt

Next● Plate Recognition with Python● Gate Controller● UI Cash Transaction (Integration with BNI Tap Cash)

Q & A