Arduino kızıl ötesi infrared sensör ile cisim takibi Arduino object tracking with infrared sensor

Arduino devreleri ve uygulamaları

Arduino kızıl ötesi infrared sensör ile cisim takibi

object tracking with ir sensor

Bu uygulamada kullandığımız infrared sensör şu prensibe göre çalışır.

Üzerinde aynı yöne bakan birer adet alıcı ve verici eleman bulunur bunlardan biri şeffaf olan infrared led dir ve bu led bizim görebildiğimiz renk dalga boyunun dışında bir ışık tayfında ışınım yapar bu sebeple bu ledin yaydığı ışığı çıplak gözle göremeyiz ki bu ledler Tv v.b aygıt kumandalarında da kullanılır ve bu işığı da çıplak gözle göremeyiz lakin bir telefon kamerası ile bakarsanız kameranın renk algılama aralığı gözümüzden daha geniş olduğu için bu ışığı kamera telefon ekranından rahatlıkla görebilirsiniz.

Diğeri ise yani siyah renkli led kılıfında olan alıcı sensördür. Bu sensör sadece infraruj  ışık dalga boyunu algılar ve infraruj ledin karşıya gönderdiği infraruj ışığın karşıdaki cisimden geri yansımasını algılayarak sensörün karşısında bir cisim olduğu bilgisini verir.

Sensör kartı üzerinde bulunan mavi renkli trimpot ile sensörün hassasiyet ayarı yapılır,sensör cisim algılamazken çıkışı “1” +5V tur ve cisim algılandığında çıkışı “0” GND olur.

Ayrıca sensör kartı üzerinde iki adet yeşil smd led bulunur bu ledler den biri power gösterge ledi,diğeri ise cisim algılandığında ışık vererek kullanıcıyı görsel olarak bilgilendirir.

Videoda ki devrede infraruj sensör dondurma çubuğuyla step motorun rotoruna monte edilmiştir ve algılama mesafesinde ki cisimi yatay istikamette takip eder,cisim yokken sensör saat yönünün tersi istikamette algılama mesafesine bir cisim girene kadar tıpkı bir radar gibi sürekli döner,algılama mesafesine bir cisim girdiğinde ise cisim istikametinde durarak cisimin hareketlerini takip eder

Akla ilk gelen soru tek bir cisim algılama sensörü ile karmaşık ve fonksyonel gibi görünen bir işlem nasıl yapılabilir ?

Devrenin çalışma prensibi:

Kod da if/else komutlarından yararlanılmıştır, bilindiği gibi kodlamada “if” bir durum belli bir şarta bağlanacaksa kullanılır ve if den sonra yazılan komutlar yerine getirilir.Şartın sağlanmaması durumda ise “else” den sonra yazılan komutlar gerçekleştirilir.Bu uygulamada motorun sağa dönmesi sensörün cisim algılamasına,sola dönmesi ise cisim algılamamasına bağlanmıştır.

Çalışma mantığını sırasıyla açıklayalım; Sensör cisim algılamadığı sürece sürekli sola doğru döner ve cisim algıladığı anda sağa dönmeye başlar ve sağa dönerken sensör cisim sınırından çıkar ve cisimi yok gördüğü için tekrar sola döner,sola döndüğünde ise sensör tekrar cisimin alanına girdiği için cisimi algılar ve sağa döner,bu çok hızlı olduğu için  motor mili sürekli ileri geri titrer ve cisim durduğu sürece bu döngü böyle devam eder.

Cisim hareket ettirildiğinde ise mesela sola doğru hareket ettirilirse cisim sensör alanından çıkacağı için sensör cisim algılamadığından motor da sola döner ve cisimi yakaladığı yerde tekrar sağa döner ve ileri geri döngü ile motor mili titremeye başlar. 

Cisim sağa doğru hareket ettirildiğinde ise sensör cisimi göreceği için motor milide sağa doğru döner ve sensör cisim sınırından çıkınca tekrar sola döner ve ileri geri döngü ile motor mili titremeye başlar. 

Step motorlu cisim takip uygulaması

Step motorlu cisim takip uygulaması devre şeması

Devre kurulup kod yüklendikten sonra, motor yönü ters olursa !

Kod içinde ki “if” den sonra yazılan sıralı komutlar, “else” den sonra yazılan sıralı komutlar ile

Yada step motor sürücü giriş pinleri arduino giriş uçları ile ters sırada bağlanması gerekebilir.

Motorun dönüş hızı kod içinde bulunan” int delayTime = 200; ” komutunda ki “200” rakamı değiştirilerek ayarlanabilir.

Bu uygulama sensörün kablodan bağımsız beslenmesi sağlanarak yapılırsa,yani sensör kendi üzerinde ki bir batarya ile yada kablosuz şarj gibi havadan indükleme yöntemi ile beslenirse,kule tıpkı bir radar gibi sürekli kendi etrafında 360 derece sola doğru dönecek ve cisim algılandığında cisimi takip edecek şekilde yapılandırılmış olur.

Kod:

int motorPin1 = 3;
int motorPin2 = 4;
int motorPin3 = 5;
int motorPin4 = 6;
int delayTime = 200;
int sensor = 2;
int sensor_durum = 0;

void setup()
{
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motorPin3, OUTPUT);
pinMode(motorPin4, OUTPUT);
pinMode(sensor, INPUT);
}

void loop()
{
sensor_durum = digitalRead(sensor);
if (sensor_durum == HIGH)
{

digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
delay(delayTime);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
delay(delayTime);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, HIGH);
digitalWrite(motorPin4, LOW);
delay(delayTime);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, HIGH);
delay(delayTime);
}
else
{
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, HIGH);
delay(delayTime);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, HIGH);
digitalWrite(motorPin4, LOW);
delay(delayTime);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
delay(delayTime);
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
delay(delayTime);
}}

Servo motorlu cisim takip uygulaması

Servo motorlu cisim takip uygulaması devre şeması

Servo uygulaması http://arduinotr.com/360servo/ sayfamızda 360 derece hack servo resimli anlatımı ile birleştirilmiştir.

DC motorlu cisim takip uygulaması

Arduino ile DC redüktör motorlu cisim takip uygulaması devre şeması
Arduino ile DC redüktör motorlu cisim takip uygulaması

Motorun ters yönde dönmesi durumunda ! Motor uçlarının ters çevrilmesi, yada kod içinde ki ” digitalWrite ” yazan satırlarda HIGH ve LOW komutlarını birbirinin yerine ters yazmak gerekebilir.

Kod:

int sensor = 2;
int motorPin1 = 3;
int motorPin2 = 4;
int sensor_durum = 0;

void setup()
{

pinMode(sensor, INPUT);
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
}

void loop()
{
sensor_durum = digitalRead(sensor);
if (sensor_durum == HIGH)
{

digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);

}
else
{
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);

}}

DC motorlu basit cisim takip uygulaması

DC motorlu basit cisim takip uygulaması devre şeması

Yukarıda ki şema da koda gerek yoktur devre kurulduğu gibi çalışır,motorun ters yönde dönmesi durumunda motor uçlarının ters çevrilmesi gerekebilir.

1 metre mesafeli 360 derece kendi etrafında dönen cisim takip uygulaması

Hazırlanıyor

Şekil ve şemaların çiziminde www.easyeda.com online editör programından yararlanılmıştır.

61 cevap

  1. Gregory Victor Southern dedi ki:

    I liked a lot

  2. Erdem dedi ki:

    Harika. Emeğinize sağlık.
    Kodu paylaşabilir misiniz.

    • admin dedi ki:

      Kodları yakın zaman da step,servo ve redüktörlü dc motor için ayrı ayrı burada paylaşacağım

  3. Furkan dedi ki:

    Bravo

  4. Cuneyt dedi ki:

    Hocam ir sensör sağ sol olayını nasıl algılıyor

    • admin dedi ki:

      Yukarıda adım adım açıklama mevcut, daha iyi anlaşılması açısından en altta ki şemayı işlemci olmadan yapmanızı tavsiye ederim.

  5. Barış dedi ki:

    Merhaba hacklenmiş servo motor için de kodları paylaşabilir misiniz
    Servo motor olduğu için sürücü gerekli olmayacaktır arduino + sensör + hacklenmiş servo devresi yani servoyu normal redüktörlü DC motor gibi kullanmak istiyorum

    • admin dedi ki:

      Bu mümkün fakat fazladan işlem ve zaman gerektirdiği için bu kod kısmı şimdilik boş bırakıldı,daha sonra servo konulu bir başlık ile birleştirilip bu şema altında yayınlanacak.

  6. sadettin dedi ki:

    elinize sağlık. servo uygulamasını dört gözle bekliyorum.

  7. Raj Kumar dedi ki:

    Dear Admin,
    Can I’ve a English translate of this project. I can not understand the project perfectly.
    I’m interesting to make a project of it.

  8. admin dedi ki:

    English version of the site is currently being prepared

  9. Justin dedi ki:

    Long time supporter, and thought I’d drop a comment.

    Your wordpress site is very sleek – hope you don’t mind me asking what theme you’re using?

    (and don’t mind if I steal it? :P)

    I just launched my site –also built in wordpress like yours– but
    the theme slows (!) the site down quite a bit.

    In case you have a minute, you can find it by searching for “royal cbd” on Google (would appreciate
    any feedback) – it’s still in the works.

    Keep up the good work– and hope you all take care of
    yourself during the coronavirus scare!

  10. magnificent points altogether, you simply received a brand
    new reader. What could you recommend in regards to your publish that you simply
    made a few days in the past? Any certain?

  11. Valuable information. Lucky me I found your site accidentally, and I’m surprised
    why this coincidence didn’t took place in advance! I bookmarked it.

  12. Fantastic goods from you, man. I have understand your stuff previous
    to and you are just extremely magnificent. I actually like what you’ve acquired here, certainly like what you’re saying and the
    way in which you say it. You make it enjoyable and you still
    take care of to keep it wise. I can not wait to read much
    more from you. This is really a terrific site. https://alphacheats.io

  13. Do you mind if I quote a few of your posts as long as I provide credit and sources
    back to your site? My blog is in the exact same niche as yours and my users would
    definitely benefit from a lot of the information you provide here.
    Please let me know if this okay with you. Thank you!

  14. cbd for sleep dedi ki:

    Thank you for the good writeup. It in fact was a amusement account it.
    Look advanced to more added agreeable from you!
    However, how can we communicate?

  15. CBD for dogs dedi ki:

    I couldn’t resist commenting. Perfectly written!

  16. CBD for sale dedi ki:

    I loved as much as you’ll receive carried out right here.
    The sketch is tasteful, your authored material stylish.
    nonetheless, you command get bought an nervousness over that you wish be delivering the following.

    unwell unquestionably come more formerly again since exactly the same nearly a lot often inside
    case you shield this increase.

  17. That is a very good tip particularly to those new to the blogosphere.
    Brief but very accurate information… Thanks for sharing this one.
    A must read post!

  18. CBD for sale dedi ki:

    Great beat ! I wish to apprentice while you amend your website,
    how could i subscribe for a weblog web site? The account aided me a acceptable deal.
    I had been tiny bit acquainted of this your broadcast provided bright
    transparent concept

  19. buy cbd gummies dedi ki:

    I am actually thankful to the holder of this web site who has shared this wonderful article at at this place.

  20. CBD for sale dedi ki:

    If you are going for most excellent contents like I do, just go to see this website daily because it gives quality contents, thanks

  21. Thanks for finally writing about > Arduino kızıl ötesi infrared sensör ile cisim takibi
    Arduino object tracking with infrared sensor – Arduino TR < Loved it!

  22. delta 8 thc dedi ki:

    Do you mind if I quote a couple of your articles as long as
    I provide credit and sources back to your webpage?

    My blog is in the exact same area of interest
    as yours and my users would really benefit from some of the information you present here.
    Please let me know if this ok with you. Thanks!

  23. First of all I would like to say fantastic blog!
    I had a quick question that I’d like to ask if you don’t mind.

    I was interested to know how you center yourself and
    clear your thoughts before writing. I’ve had a difficult time
    clearing my thoughts in getting my ideas out. I do enjoy writing however it just seems like the first 10 to
    15 minutes are usually wasted simply just trying to
    figure out how to begin. Any suggestions or tips? Thank you!

  24. I every time emailed this blog post page to all my friends, since if like to read it afterward my friends will too.

  25. Hello, i read your blog occasionally and i own a similar one
    and i was just wondering if you get a lot of spam responses?
    If so how do you protect against it, any plugin or
    anything you can suggest? I get so much lately it’s driving me crazy so any support is very
    much appreciated.

  26. cbd gummies dedi ki:

    Hello, constantly i used to check web site posts here
    early in the break of day, since i enjoy to find out
    more and more.

  27. cbd products dedi ki:

    Wow that was odd. I just wrote an really long comment but after I clicked submit my comment didn’t appear.
    Grrrr… well I’m not writing all that over again. Regardless, just wanted to say great blog!

  28. Great beat ! I wish to apprentice even as you amend your website, how could i
    subscribe for a weblog web site? The account helped me
    a appropriate deal. I had been a little bit familiar of this your broadcast offered
    brilliant clear idea

  29. I have read so many articles about the blogger lovers but this post is actually a good article, keep it up.

    Here is my site; CBD gummies for pain

  30. cbd products dedi ki:

    Thank you for the good writeup. It in fact was a amusement account it.

    Look advanced to far added agreeable from you! By the way, how
    can we communicate?

  31. Howdy! I know this is somewhat off topic but I was wondering if you knew where I could locate a captcha plugin for my comment form?
    I’m using the same blog platform as yours and I’m having problems
    finding one? Thanks a lot!

  32. delta 8 near me dedi ki:

    Howdy this is kind of of off topic but I was wanting to
    know if blogs use WYSIWYG editors or if you have
    to manually code with HTML. I’m starting a blog soon but have no coding experience so I wanted to get advice from someone with experience.
    Any help would be greatly appreciated!

  33. best delta 8 dedi ki:

    I am sure this article has touched all the internet visitors,
    its really really fastidious post on building up new weblog.

  34. Hello, always i used to check blog posts here in the
    early hours in the break of day, as i love to gain knowledge
    of more and more.

  35. It’s really a cool and useful piece of information. I’m satisfied that you
    just shared this useful info with us. Please stay us up to
    date like this. Thank you for sharing.

  36. This is the perfect webpage for everyone who really wants to understand this topic.
    You know a whole lot its almost hard to argue with you (not that I personally will need to…HaHa).

    You certainly put a new spin on a topic that’s been written about for many years.

    Excellent stuff, just great!

  37. Great blog here! Also your website loads up very fast! What web host are you using?
    Can I get your affiliate link to your host? I wish my web site loaded up as fast as yours
    lol

  38. I was suggested this website by my cousin. I am not sure whether this post is written by
    him as no one else know such detailed about my difficulty.
    You are incredible! Thanks!

  39. Hi everyone, it’s my first pay a visit at this site, and paragraph is genuinely fruitful in favor of me, keep up
    posting these types of content.

  40. you are really a just right webmaster. The site loading pace is incredible.
    It sort of feels that you are doing any unique trick.
    Furthermore, The contents are masterpiece.
    you have done a great task on this topic!

    P.S. If you have a minute, would love your feedback on my new website
    re-design. You can find it by searching for «royal
    cbd» — no sweat if you can’t.

  41. It’s an awesome piece of writing in support of all the internet people; they will
    obtain benefit from it I am sure.

    P.S. If you have a minute, would love your feedback on my new website
    re-design. You can find it by searching for «royal
    cbd» — no sweat if you can’t.

  42. I’m not that much of a online reader to be honest but your sites really
    nice, keep it up! I’ll go ahead and bookmark your site to come back in the future.
    Many thanks

  43. Amazing blog! Do you have any tips and hints for aspiring writers?
    I’m hoping to start my own blog soon but I’m a little lost on everything.

    Would you advise starting with a free platform like WordPress or go for a
    paid option? There are so many options out there
    that I’m completely overwhelmed .. Any ideas? Many thanks!

  44. Great blog! Is your theme custom made or did you download it from somewhere?
    A design like yours with a few simple adjustements would
    really make my blog stand out. Please let me know where you got your theme.
    Many thanks

  45. First off I would like to say superb blog! I had a quick
    question in which I’d like to ask if you don’t mind.
    I was curious to know how you center yourself and clear your head before writing.

    I have had difficulty clearing my thoughts in getting my ideas out
    there. I truly do enjoy writing however it just seems like the first 10 to 15
    minutes tend to be wasted simply just trying to figure out how to begin. Any recommendations or tips?
    Kudos!

    P.S. If you have a minute, would love your feedback on my
    new website
    re-design. You can find it by searching for «royal cbd» — no sweat if you can’t.

  46. I needed to thank you for this fantastic read!!
    I certainly enjoyed every little bit of it.
    I’ve got you bookmarked to look at new stuff you post…

    P.S. If you have a minute, would love your feedback on my new website
    re-design. You can find it by searching for «royal cbd» — no sweat if you can’t.

  47. I know this web page offers quality depending articles or reviews and other data,
    is there any other website which provides these data
    in quality?

  48. Thank you for another excellent article. Where else could anyone get that type of info in such a perfect method of writing?
    I’ve a presentation next week, and I’m on the search for such
    info.

  49. It’s actually a nice and helpful piece of information. I am satisfied that
    you shared this useful information with us. Please keep us up to
    date like this. Thanks for sharing.

  50. I don’t even know how I finished up right here, however I thought this
    publish was once good. I don’t recognise who you might be however definitely you
    are going to a well-known blogger in the event you aren’t already.
    Cheers!

  51. buy cbd dedi ki:

    I love what you guys are usually up too. This sort of clever
    work and reporting! Keep up the good works guys I’ve incorporated you guys to my
    personal blogroll.

  52. best CBD dedi ki:

    Hi it’s me, I am also visiting this web page daily, this website is
    really fastidious and the viewers are actually sharing nice thoughts.

  53. I’m curious to find out what blog platform you have been utilizing?
    I’m having some small security problems with my latest site and
    I’d like to find something more risk-free. Do you have
    any recommendations?

  54. That is a very good tip especially to those fresh
    to the blogosphere. Brief but very precise info… Many
    thanks for sharing this one. A must read post!

  55. best CBD dedi ki:

    Excellent post. I was checking continuously this blog and
    I am inspired! Extremely useful info particularly the
    last phase 🙂 I deal with such information much. I used to be seeking
    this certain info for a very lengthy time. Thank you and good luck.

cbd gummies için bir cevap yazın Cevabı iptal et

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir