Thursday, August 2, 2012

Flame Detector Sensor YL-38

Setelah berekspreimen dengan line tracing, dilanjutkan dengan fire detector. Produk yang akan saya coba kali ini dari pabrikan china dengan seri YL-38. Sensor diterima tanpa datasheet tapi dari konfigurasi sudah secara jelas tergambar kalau produk ini mempunyai pin untuk power, 1 DO dan 1 AO. Prinsip kerja dari sensor ini adalah mendeteksi temperature dimana dia akan menghasilkan digital output sesuai dengan threshold yang diatur oleh potensiometer. Untuk program, bisa kita ambil referensi dari hobbycomponents seperti yang dibawah.


 -------------------------------------------------------------------------------------------------------------------------------------------------------------
/* FILE:    ARD_Flame_Detector_Sensor_HCARDU0024_Example.pde
   DATE:    03/07/12
   VERSION: 0.1
   WEB: http://www.hobbycomponents.com

This is a simple example of how to use the HobbyComponents Arduino flame detection
module (HCARDU0024). The sensor has two outputs, an analogue output that is
dependent on how strong a flame is detected, or a digital output that will go high if
a flame is detected above a threshold set by the modules potentiometer.

This example program reads the status of both sensor outputs and outputs the result
to the UART.

SENSOR PINOUT:

PIN 1: Analogue out
PIN 2: Ground
PIN 3: +5V
PIN 4: Digital out

You may copy, alter and reuse this code in any way you like but please leave
reference to HobbyComponents.com in your comments if you redistribute this code. */


/* Select the input pin for the flame detectors analogue output. */
#define FLAME_DETECT_ANA A0    
                                 
/* Select the input pin for the flame detectors digital output. */
#define FLAME_DETC_DIO 12      
                                 


/* Initialise serial and DIO */
void setup()
{
  /* Setup the serial port for displaying the status of the sensor */
  Serial.begin(9600);
 
  /* Configure the DIO pin the sensors digital output will be connected to */
  pinMode(FLAME_DETC_DIO, INPUT);
}


/* Main program loop */
void loop()
{
  /* Read the sensors analogue output and send it to the serial port */
  Serial.print("Sensor Value: ");
  Serial.print(analogRead(FLAME_DETECT_ANA));
 
  /* Read the status of the sensors digital output and if it is high
     then send an alert to the UART */
  if (digitalRead(FLAME_DETC_DIO))
  {
    Serial.println(" FLAME DETECTED!");
  }else
  {
    Serial.println();
  }
   




Tuesday, July 31, 2012

Line Hunting Sensor Module

Kali ini kita akan belajar untuk mendeteksi line (line tracking) dengan menggunakan photosensitive diode. Line hitam akan membangkitkan signal low sedangkan line putih akan membangkitkan signal high. Sedangkan untuk DIO digunakan input no 12.



------------------------------------------------------------------------------------------------------------------------------------------
/* Define the DIO pin that will be used to communicate with the sensor */
#define LINEHUNTSENS_DIO 12


/* Initialise serial and DIO */
void setup()
{
  /* Setup the serial port for displaying the status of the sensor */
  Serial.begin(9600);
 
  /* Configure the DIO pin the sensor will be connected to as an input */
  pinMode(LINEHUNTSENS_DIO, INPUT);
}


/* Main program loop */
void loop()
{
  /* If the DIO pin is pulled low then an object has been detected */
  if (!digitalRead(LINEHUNTSENS_DIO))
    Serial.println("Object detected !");   
}



Source

Sunday, June 24, 2012

Aplikasi digital output

Sharing pertama saya adalah aplikasi digital untuk menghidupkan led. Fungsi yang digunakan adalah digitalWrite.

Penjelasan digitalWrite(pin, value) diambil dari arduino reference:
"Sets a pin configured as output to either a HIGH or a LOW state at the specified pin. The digitalWrite() function is also used to set up pullup resistors when a pin is configured as an input".

Di contoh ini, kita akan menggunakan pin no 3 sebagai DO dengan led sebagai bebannya (see gambar).

Programm yang digunakan:

int ledPin = 3;                       //LED connected to digital pin 3

void setup()
{
    pinMode(ledPin,OUTPUT); //Sets the digital pin as output
}

void loop()
{
    digitalWrite(ledPin,HIGH);
    delay(1000);
    digitalWrite(ledPin,LOW);
    delay(1000);
}

Program diatas akan menyalakan dan mematikan led secara bergantian tiap 1 second.




Thursday, June 21, 2012

Home Automation & Security

Automation! Adalah suatu kata yang menarik di telinga. Sudah lama bergelut di bidang ini. Sejak kuliah sampai kerja bersinggungan dengan kata ini. But kebanyakan dengan programmable logic controller (PLC) dan instrumentation untuk industrial.

Home automation. Its very interesting. Mengimplementasikan automation untuk rumah. Mengintegrasikan semua elektronik device di rumah menjadi suatu system. System yang secara otomatis mengatur operasional device-device itu. Menggunakan device seperlunya sesuai dengan kebutuhan. Menghemat listrik tujuan akhirnya.

Security. Ini adalah sesuatu yang amat penting. Untuk menjaga keamanan keluarga dari tangan-tangan yang tidak bertanggungjawab. Mendeteksi pergerakan-pergerakan di areal yang tidak terpantau khususnya saat malam. Sensor-sensor security bekerja secara bahu-membahu untuk menjaga keamanan rumah.

Saat ini saya berusaha menggabungkan antara automation dengan security sehingga menghasilkan project pribadi "Home Automation & Security". Disini saya menggunakan controller arduino duemilanove sebagai otak utama dikarenakan board ini menggunakan bahasa pemrograman yaitu C dimana saya sudah familiar sejak bangku kuliah. Yang membuat saya tertarik dengan arduino karena ini bersifat "Open" seperti linux ubuntu dan android yang saya gunakan.

Komposisi sistem yang lagi saya develop terdiri dari:
  1. Arduino duemilanove
  2. Mux shield for arduino
  3. LCD
  4. Watchdog module -> for time
  5. Sensor ultrasonik untuk mengukur tinggi torrent air
  6. Sensor inframerah untuk mendeteksi pergerakan
  7. Solenoid valve yang berfungsi untuk secara otomatis menyiram tanaman di balkon


Kedepannya, sensor-sensor akan ditambah untuk menambah kelengkapannya dan fungsinya.

Development project will be update regularly

Tuesday, June 19, 2012

Quadcopter Project

Just 3 month before know arduino. When see it, it looks like simple and powerfull. But the most why I interest is "OPEN SOURCE" like ubuntu and android which i have used.

Searching and always searching with google, finally found a toys to learn advance arduino. The toys is "quadcopter". Due to i dont have enough money to buy it, i buy piece by piece.  First I buy the frame from hobbyking. After review for a long time, I choose Turnigy Talon V2 Quadcopter. It look a good frame and it really good design and tough.

But its a long project to realize. The progress will be write soon.