KY-032 - Hindernis-Vermeidungs-Sensor

KY 032(Obstacle Avoidance sensor)

Einführung

Was bei den Chinesischen Herstellern als „Hindernis-Vermeidungs-Sensor“ bezeichnet wird, ist nichts anderes als ein Infrarot-Näherungsschalter. Offenbar denkt man sich das Modul als Teil eines Robots, der auf diese Weise Hindernissen ausweichen kann. Das Modul hat einen einstellbaren Infrarot-Sender und Empfänger, der auf annäherung reagiert. und auf diese Weise den Signalpin auf HIGH zieht. Die Distanz bei der das Modul schaltet ist wiederum von 2-40cm einstellbar.

  • Working voltage: DC 3.3V-5V
  • Working current: ≥ 20mA
  • Operating temperature: -10 ℃ - +50 ℃
  • detection distance :2-40cm
  • IO Interface: 4-wire interfaces (- / + / S / EN)
  • Output signal: TTL level (low level there is an obstacle, no obstacle high)
  • Adjustment: adjust multi-turn resistance
  • Effective angle: 35 °
  • Size: 28mm × 23mm
  • Weight Size: 9g

Here we use the obstacle avoidance module and a digital interface, built-in 13 LED build a simple circuit, making avoidance warning lamp, the obstacle avoidance Sensor Access Digital 3 interface, when obstacle avoidance sensor senses a signal, LED light, and vice versa off.

 

Anschluss

ArduinoModul
+5V Pin +
GND Pin -
Pin 13 S
FIXME EN
 

Beispielcode

int Led = 13 ;// define LED Interface
int buttonpin = 3; // define the obstacle avoidance sensor interface
int val ;// define numeric variables val
void setup ()
{
  pinMode (Led, OUTPUT) ;// define LED as output interface
  pinMode (buttonpin, INPUT) ;// define the obstacle avoidance sensor output interface
}
void loop ()
{
  val = digitalRead (buttonpin) ;// digital interface will be assigned a value of 3 to read val
  if (val == HIGH) // When the obstacle avoidance sensor detects a signal, LED flashes
  {
    digitalWrite (Led, HIGH);
  }
  else
  {
    digitalWrite (Led, LOW);
  }
}