Zum Inhalt springen
IR Sensor Sharp

Infrarot Entfernungsmessung mit Sharp Abstandssensor

    Sharp GP2Y0A21YK
    Sharp Abstandssensor GP2Y0A21YK – Schaltung mit Fritzing erzeugt

    Der Infrared Proximity Sensor – Sharp GP2Y0A21YK ist ein Infrarot-Abstandssensor. Er besteht aus einer Infrarot-LED und einem Phototransistor, der das von einem Objekt reflektierte Infrarot-Licht misst.

    Der Sensor selbst verfügt über eine Steckbuchse für die man am besten ein vorkonfektioniertes Anschlusskabel verwendet. Das Anschließen selbst ist sehr einfach. Das mittlere Kabel wird mit dem GND und das rechte mit 5V+ verbunden. Das linke Kabel kann man einfach an einen analogen Input anschließen.

    Wenn kein Infrarotlicht durch ein Objekt reflektiert wird, beträgt der Output des Sensors 0V. Das ergibt einen analogen Input Wert von 0. Je näher sich ein Objekt vor dem Sensor befindet, desto höher wird der analoge Input Wert. Er steigt bis ca. 630. Sobald ein Objekt dem Sensor zu nahe kommt (ca. 20cm), sinkt der Wert allerdings wieder.


    Sieh dir jetzt meinen neuen Arduino-Videokurs an: Jetzt ansehen!


    Der Sensor ist preiswert und sehr einfach anzuschließen, jedoch liefert er keinen verlässlichen festen Abstandswert. Dieser ist von der reflektierenden Oberfläche abhängig. Auch können Infrarotquellen, wie Fernbedienungen, die Werte beeinflussen.

    Sharp stellt den Sensor in unterschiedlichen Varianten mit unterschiedlichen Reichweiten her.

    AbstandsmessungModellnummer
    1,5 bis 15 cmAnaloger OutputGP2Y0AF15 series
    2 bis 15 cmAnaloger OutputGP2Y0A51SK0F
    4 bis 30 cmAnaloger OutputGP2Y0A41SK0F
    10 bis 80 cmAnaloger OutputGP2Y0A21YK0F
    20 bis 150 cmAnaloger OutputGP2Y0A02YK0F
    100 bis 550 cmAnaloger OutputGP2Y0A710K0F
    void setup(){
      Serial.begin(9600);
    }
    
    void loop(){
      Serial.println(analogRead(0));
      // Ergebnisse werden im seriellen Monitor angezeigt
      delay(20);
    }

    Und was kann man jetzt damit anstellen? Hier ein paar Beispiele:

    »Fox in a box«:

    Fox in the Box from Stephan Thiel on Vimeo.


    Wenn dir das Projekt gefallen hat und du von weiteren interessanten Projekten inspiriert werden willst, sieh dir doch mal mein neues E-Book »Arduino Projekte Volume 1« an!

    • Die beliebtesten Arduino-Projekte von StartHardware
    • Inklusive Schaltplan, Beschreibung und Code
    • Arduino-Schnellstart-Kapitel
    • Kompakter Programmierkurs


    12 Gedanken zu „Infrarot Entfernungsmessung mit Sharp Abstandssensor“

    1. Pingback: Gruseliger Halloween-Süßigkeitenspender mit Arduino

    2. Pingback: So baust du einen berührungslosen Seifenspender mit Arduino

    3. I should prablboy have used some paste, but couldn’t be asked I’ve checked the temperature of the engine block vs. that reported by the sensors, and it was within 1 degree, so good enough.The cuboids are low voltage/power signal relays, 5V which can be driven directly from the Arduino’s pin outs. One of them is used to drive the remove switch functionality of the generator control unit (DeepSea 3110), i.e. to turn it on or off.The other relay is to turn the radiator fan on and off, but that relays is used to drive a second automotive relay which can handle the current. There’s a third relay there, which is the solid state relay for switching the 80W extractor fan and of off, but I’ve not connected it yet.

    4. olololololololoolololololololololololololololololo
      olololololololololololololololololololololololololol
      olololololololololololololololololololololololololol

    5. ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt

    6. glkjhlgr oih geroijmgroijm groijm groimhlroihliunh lih groijm ru tdzujizujztujtedzujhsyhtruzi dgfhnjuzfj rthrdzudt rzhtrshrzu wetsertztitdxhersg ertzhydfgear zyedfrgertr ztdytdyfgtzsrtgert eargdsfrgzuttzitmgcxhm ipoukgchj uouziztjxhaewrq

    7. oihzr9um0e
      zbtztruztantrtqazliudntserruztbszdzt
      54sn7ze65us4e5r7ztdchguhox gfuz
      trsuiuo rtu z nterzer tiuzsrtzdzj ztum
      trszrtzsrb ztrzeatrzatrzmjti dztrut z truz

    8. @Kalinci: Also wenn ich Ultraschall richtig verstanden habe, dann muss ein Lautsprecher eine Frequenz im Ultraschallbereich senden und ein Empfänger muss den reflektieren Ton wieder aufnehmen. Die Zeitdifferenz wird gemessen und daraus errechnet sich die Entfernung zum etwaigen Objekt. Im Auto macht das ein Steuergerät. Dieses Modulieren und Messen ist nicht ganz einfach und Arduino kann das nicht leisten.

      Das Bauteil, dass Du hast, nützt Dir ohne Steuereinheit wahrscheinlich wenig.
      http://forum.arduino.cc/index.php?topic=69602.0

      Ich glaube nicht, dass man damit was anfangen kann. Ich habe selber solche Dinger im Keller und habe es aufgegeben, damit was Sinnvolles anstellen zu wollen :-/

      Trotzdem frohe Weihnachten und liebe Grüße

      Stefan“

    9. Hallo Stefan,
      vielen Dank für die Antwort.

      bis jetzt habe ich keine brauchbare Informationen gefunden. Ehrlichgesagt habe ich wenig Erfahrung mit Arduino.
      Hast du eine Vermutung wie es funktionieren könnte.
      ich brauche ein Anhaltspunkt.
      es wäre sehr Hilfreich.

      viele Grüße
      kalinci

    Die Kommentarfunktion ist deaktiviert.