Notification texts go here Contact Us

Panduan Praktis Menggunakan Sensor Infrared Proximity FC-51 dengan Arduino Uno

Pelajari cara mudah mengakses dan memprogram sensor infra merah (IR) proximity FC-51 menggunakan Arduino Uno dalam hitungan menit!
Controller,Arduino,Sensor,Proximity FC-51

Memahami dan Menggunakan Sensor Infrared (IR) Proximity FC-51 dengan Arduino Uno

Pengenalan Sensor Infrared (IR) Proximity FC-51

Sensor ini mendeteksi keberadaan halangan di depannya dan memberikan output berupa sinyal digital HIGH atau LOW.

Skema Pengkabelan

Hubungkan Sensor Infrared (IR) Proximity FC-51 dengan Arduino Uno sesuai skema yang diberikan.
Controller,Arduino,Sensor,Proximity FC-51

Kode Program Arduino

Program Arduino untuk membaca output sensor dan menampilkan status ke Serial Monitor.
const int SensorProximty = 9;

void setup()
{
  Serial.begin(9600);
  pinMode(SensorProximty, INPUT);
}

void loop()
{
  int hasil = digitalRead(SensorProximty);
  if(hasil == LOW)
  {
    Serial.println("Ada Halangan");
  }
  if(hasil == HIGH)
  {
    Serial.println("Aman, Tidak Ada Halangan");
  }
  delay(250);
}

Setelah mengunggah program, lihat hasilnya pada Serial Monitor untuk mendapatkan status keberadaan halangan.

Posting Komentar

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.