Archive

Archive for the ‘Robotik & Mikrokontroler’ Category

Hardware application in Raspberry PI

i was in Depok yesterday , and suddenly thought about “how to control a hardware component by using PI”, because i used to control hardware device such as LED’S (Light emitting Diode) , Switches, censors, servos, and many more with microcontroller. maybe, i could do same thing by PI, then i searched for article last night , and i got brief tutorial. in this section, i would like to discuss hardware application and how to turn on / off your LED by using python script in Raspberry PI. this is interesting enough. here lists of my raw materials (depend on you) :

  • PI , of course
  • LED
  • Resistor , 1 x 330 ohm
  • Electronic Board or you can use breadboard
  • Cable usually called jumper to connect electronic component to others.
  • Coffee ( to enjoy step by step)

step by step :

  • create electronic circuit like this and connect it to your PI. please be carefull to make this circuit, i suggest you to use breadboard.

rangkaian

  • create file ‘lamp.py’ :

import os; #import os to use 'system' function
import RPi.GPIO as GPIO #GPIO module to access your GPIO Port in PI
import time

GPIO.setmode(GPIO.BOARD);
GPIO.setup(3, GPIO.OUT); # 3 : port GPIO3 set as output
os.system("clear"); #clear screen
status = True; #boolean status as flag true or false, but set true first
while(status): #while status true then loop
 os.system("clear");
 print "1. Nyalakan Lampu"
 print "2. Matikan Lampu"
 print "3. Kedap Kedip"
 print "0. Keluar"
 pil = raw_input( "Pilihan Anda : ") #store user input to pil variable
 if(pil=="1"):
  print "Lampu Dinyalakan";
  GPIO.output(3,False);
 elif(pil=="2"):
  print "Lampu Dimatikan";
  GPIO.output(3, True);
 elif(pil=="3"):
  for i in range(1,10):
   GPIO.output(3, False);
   time.sleep(1);
   GPIO.output(3, True);
   time.sleep(1);
 elif(pil=="0"):
  print "Terima kasih";
  status = False;
 else:
  print "GAGAL";
 raw_input("Press any button");

  • Test your PI, execute it , type sudo python lamp.py .

IMG_0781When you choose ‘2’

IMG_0778when you choose ‘1’

  • After learn about fundamental of hardware of PI, it leads you into combination of hardware and software. you can put servos, censor , switch and other technique. hopefully 🙂
Advertisements

Web Service in RaspberryPI

i have been doing my final project at health informatics engineering ITB,, which related with web services. i used Codeigniter framework as web builder to accompany me accomplish this program. i thought i could change a paradigm that website stored at web service must have be saved in a server or PC. then, i searched whether RaspberryPi could as a web server, and run normally without lack in connection. the answer is “yes” , it could. so i decided to move my final project into PI. here this step :

  1. Connect your RaspberryPI to the network ,i prefer you use a wireless than switch.
    WP_000731this wireless will connect to mobile device or your laptops later. connect this device into ethernet card in PI through UTP Cable.
  2. connect your PI into display adapter (if this is your first action on PI), you can use TV or LCD . if you use TV, connect video adapter port into TV Port. if you use LCD , connect HDMI in PI into HDMI in LCD
  3. WP_000730
  4. Network setting setting your network using DHCP, which acquired from wireless.  open network setting by use nano /etc/network/interfaces
  5. i recommend you use remote connection such as ‘Putty’. download from this URL and install into your laptops (client) as far as you need. both use remote connection and use actually device without remote is good.
  6. suggest that you get IP Address on your PI 192.168.1.104 (my PI address)
  7. install this requirement tools : apache = sudo apt-get install apache2 , PHP = sudo apt-get install php5 , MySQL = sudo apt-get install mysql-server and PHP-MySQl = sudo apt-get install php5-mysql
  8. make web file in /var/www for instance just provide a service
  9. Create your own database :
  • mysql – u root -p
  • in mysql prompt , type : create database your_database_name
  • create a table

I don’t discuss more about database or PHP , moreover you can follow latest post about php or mysql in sidebar.

IMG_0726

Watch My Robot Tong Sampah and GPS V-TrackMobile

In this chance i would like to show you “Trash Robot” . this robot created by octav, yoga, uyuy and ira when we were playing at PKM (Creativity Students Events) Monitoring Evaluasi .the financial is given by Dikti. Ok Lets see our product :

WATCH TRASH ROBOT

Unfortunately, you can’t see directly, because joomla site isn’t support avi or video from youtube.

You can also view antoher projects, this is called “V-Track Mobile” .. that can solve your car problem like as stolen by thief , monitoring your car position , etc

this robot was created by octav and bhima.. let see our product.

WATCH V-TRACK MOBILE

Aplikasi Bahasa C Pada Mikrokontroler dan Robotika (Part 3)

February 27, 2011 Leave a comment

3. LCD (Liquid Crystal Display)

Pada pembahasaan kali ini, saya akan membahas tentang LCD, LCD yang digunakan adalah LCD 16 * 2 yang akan kita hubungkan dengan rangkaian mikrokontroler atau lebih tepatnya di PORT B. berikut ini rangkaian nya :

  • untuk mengatur contras LCD, maka dipasang Potentiometer 10 K
  • berikut ini program Singkat untuk menampilkan karakter di LCD

lcd_gotoxy(0,0);

lcd_putsf(“Octav”);

  • Program diatas berfungsi untuk memasukan Teks ->> Octav dan kemudian ditampilkan di baris pertama kolom pertama dari LCD
Categories: Robotik & Mikrokontroler Tags:

Aplikasi Bahasa C Pada Mikrokontroler dan Robotika (Part 1)

February 7, 2011 3 comments

1.Pendahuluan

Bahasa C++ dapat kita terapkan pada berbagai alat elektronika, contohnya dapat kita terapkan di robotik dan mikrokontroler. saya tidak akan membahas lebih detail tentang skematik mikrokontroler(karena yang membuat nya bukan saya, mikrokontroler yang digunakan buatan kakak kelas saya, kang manda), namun garis besar nya adalah :

Mikrokontroler merupakan sebuah chip yang telah terintegrasi yang didalamnya terdapat sistem input/output(I/O) dan Memori dengan kapasitas kecil yang dapat digunakan untuk mengendalikan alat lainya. misalnya pada percobaan kali ini kita mengendalikan nyala atau matinya beberapa buah LED dengan menggunakan switch. Read more…