How to make Parking Sensor with Arduino? # DERS-1 (Turkish Tutorial)
Ne Öğreneceğim ?
- HC SR04 Ultrasonik mesafe sensörü nasıl çalışır ?
- HC SR04 Ultrasonik mesafe sensörü nasıl kodlanır ?
- Pin bağlantıları nasıl yapılır ?
Gereksinimler
- Başlangıç düzeyinde arduino kod bilgisi
- Arduino UNO
- HC SR04 Ultrasonik mesafe sensörü
- Buzzer
Zorluk Derecesi
- Intermediate ( orta düzey)
Açıklama
HC SR04 Ultrasonik mesafe sensörü yani Sound Navigation and Ranging . Ses dalgaları kullanarak karşısındaki nesneye olan mesafesini ve nesnenin boyutunu hesaplayan bir input kaynağıdır. Bu tür sensörlerin esin kaynağı genellikle yunuslar ve yarasalardır. Bizde bu sensör ile park sensörü yapımını öğrenicez.
Devrenin Şeması :
Video Tutorial
Oluşturulan kodlar
const int trig = 8;
const int echo = 9;
int sure = 0;
int mesafe = 0;
const int buzzer = 10;
void setup() {
pinMode(trig, OUTPUT);
pinMode(echo, INPUT);
Serial.begin(9600);
pinMode(buzzer, OUTPUT);
for(int i = 2; i < 8; i++)
{ pinMode(i, OUTPUT);
}
}
void loop()
{
digitalWrite(trig, HIGH);
delayMicroseconds(50);
digitalWrite(trig, LOW);
sure = pulseIn(echo, HIGH);
mesafe = (sure/2)/29.1;
Posted on Utopian.io - Rewarding Open Source Contributors
Your contribution cannot be approved because it does not follow the Utopian Rules.
-It is very similar to a contribution that was already accepted here.
You can contact us on Discord.
[utopian-moderator]