Raspberry Pi dan
Alat Parkir UI
Gladhi Guarddin, M.Kom
adin@ui.ac.id
Tujuan Implementasi
●
●

Raspberry Pi sebagai pengendali proses pengambilan data kendaraan
pada gerbatama UI
Setiap gambar...
Wiring Sensor
Raspberry in a Box
Rangkaian in a Pipe {bomb}
VCC 3.3V

GPIO pin X

GND
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 ...
Konsep Aplikasi
Execute Shell (background) &
Python Controller
read from GPIO

capture jpg from IP Camera

Execute Shell (...
Python Code
from time import sleep
import RPi.GPIO as GPIO
import os
GPIO.setmode(GPIO.BOARD)
GPIO.setup(8, GPIO.IN)
GPIO....
Python Code (continue)
while True:
print( "8 : " , GPIO.input(8))
print( "10 : " , GPIO.input(10))
print( "12 : " , GPIO.i...
panggil.sh
panggil.sh
-----------------------------------------------#!/bin/bash
/root/ngefoto.sh $1 $2 & > /dev/null
ngefoto.sh
ngefoto.sh
-----------------------------------------------#!/bin/bash
sleep 2
TIME=`date`
HARITGL=`date "+%Y-%m...
Akses Capture Foto

http://10.39.66.2/
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. Loo...
Next
●
●
●

Plate Recognition with Python
Gate Controller
UI Cash Transaction (Integration with BNI Tap Cash)
Q&A
Raspberry Pi dan Alat Parkir UI
Raspberry Pi dan Alat Parkir UI
Upcoming SlideShare
Loading in …5
×

Raspberry Pi dan Alat Parkir UI

2,712 views
2,518 views

Published on

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

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,712
On SlideShare
0
From Embeds
0
Number of Embeds
11
Actions
Shares
0
Downloads
48
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Raspberry Pi dan Alat Parkir UI

  1. 1. Raspberry Pi dan Alat Parkir UI Gladhi Guarddin, M.Kom adin@ui.ac.id
  2. 2. Tujuan Implementasi ● ● Raspberry Pi sebagai pengendali proses pengambilan data kendaraan pada gerbatama UI Setiap gambar yang dicapture akan diolah oleh aplikasi terpisah
  3. 3. Wiring Sensor
  4. 4. Raspberry in a Box
  5. 5. Rangkaian in a Pipe {bomb} VCC 3.3V GPIO pin X GND
  6. 6. Rangkaian in a Pipe {bomb} VCC 3.3V GPIO pin 8 GPIO pin 10 GPIO pin 12 GPIO pin 16 GND
  7. 7. 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”
  8. 8. Konsep Aplikasi Execute Shell (background) & Python Controller read from GPIO capture jpg from IP Camera Execute Shell (background) & capture jpg from IP Camera Execute Shell (background) & capture jpg from IP Camera Execute Shell (background) & capture jpg from IP Camera
  9. 9. 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)
  10. 10. 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")
  11. 11. panggil.sh panggil.sh -----------------------------------------------#!/bin/bash /root/ngefoto.sh $1 $2 & > /dev/null
  12. 12. 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" > "$BASE/$FILE.jpg.tmp" mv "$BASE/$FILE.jpg.tmp" "$BASE/$FILE.jpg"
  13. 13. Akses Capture Foto http://10.39.66.2/
  14. 14. 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 & 2 dikali 6 + poin 3 Total Rp. 20jt
  15. 15. Next ● ● ● Plate Recognition with Python Gate Controller UI Cash Transaction (Integration with BNI Tap Cash)
  16. 16. Q&A

×