1

We've got an Arduino KY-032 obstacle avoidance sensor, and have spent a decent time searching and researching to find a detailed data sheet/manual to figure out how it works; but there aren't any detailed information on the module.

Arduino KY-032

One of the few instructions here says that the potentiometers on the chip are used to adjust the distance, but I've tried all different settings and the maximum I can get is 10 centimeters. I've tried different surfaces with different reflectivity levels, but it doesn't really differ much.

Any idea how to increase the distance on this? Anything to do with the enable jumper?

Update: Here's the related code to the obstacle detection:

void loop() {
  // check the network connection once every 10 seconds:
  val = digitalRead (buttonpin) ;// digital interface will be assigned a value of 3 to read val
  if(full==1 && val==LOW) {
    Serial.print("Bin Full");
    delay(5000);
  } else {
    if (val == LOW) {
      // When the obstacle avoidance sensor detects a signal, LED flashes
      digitalWrite (Led, HIGH);
      delay(2000);
      if(digitalRead(buttonpin)==LOW) {
        delay(2000);
        if(digitalRead(buttonpin)==LOW) {
          full = 1;
        }
      }
      count++;
      //printCurrentNet();
      sendData();
    } else {
      digitalWrite (Led, LOW);
      if(full==1) {
          count = 0;
      }
      full = 0;
    }
  }
}
  • It could be code related. Can you add small snippet of your code (excluding anything unrelated to this issue)? Thanks! – Anonymous Penguin Mar 7 '15 at 14:10
  • @AnnonomusPenguin There you go. (: – Neeku Mar 7 '15 at 15:20
  • It may just be defective. Have you tested duplicate sensors? It may also just be low quality product. Have you tried contacting the manufacturer? – Paul May 16 '15 at 3:22
  • How about this- test the sensor WITHOUT the Arduino Uno. – Mathsman 100 May 19 '15 at 15:12
  • How did you connected it to arduino? – user11402 Jul 24 '15 at 16:10
1

The IR sensor module incorporates an internal 38KHz bandpass filter. The pot near the GND pin fine tunes the frequency of that signal, which is used to illuminate the IR LED.

The other pot adjusts the duty cycle of the signal. This controls the brightness of the IR LED. Both adjustments effect the sensitivity and range of the device.

To achieve maximum sensitivity, it is absolutely necessary to use the 'EN' or 'Enable' pin. When used correctly, however, additional optical shielding of the IR LED is required. This can be done with a small cardboard tube commonly used as packing material or any of a variety of other materials.

If the Enable function is not used, the jumper must be installed on the board. The Enable pin cannot be used if the jumper is in place.

For more information, see: http://irsensor.wizecode.com/

1

These Obstacle sensors don't always work as expected.I bought 3 of them, but only 2 worked properly.The other only worked to a distance of about 6-7cm.
By the way, the code seems to be fine, but there is no way to tell for sure without complete code.

0

Well, the range of the sensor should be: "2-40cm" I would suggest using the code below and changing the potentiometers to see if it makes any difference.

int Led = 13 ;// define LED Interface
int buttonpin = 3; // define the obstacle avoidance sensor interface

void setup ()
{
  pinMode (Led, OUTPUT) ;// define LED as output interface
  pinMode (buttonpin, INPUT) ;// define the obstacle avoidance sensor output interface
}
void loop ()
{
  if (digitalRead (buttonpin) == HIGH) // When the obstacle avoidance sensor detects a signal, LED goes on.
  {
    digitalWrite (Led, HIGH);
  }
  else
  {
    digitalWrite (Led, LOW);
  }
}
  • I wouldn't think that's required, it's very likely that the Sensor is malfunctioning. – Mathsman 100 May 19 '15 at 15:08
  • @Mathsman100 But it is a way to prove so? – Paul May 19 '15 at 15:53
0

Check This: http://irsensor.wizecode.com/

When the GREEN JUMPER is installed on the board (see picture), the IR LED will flicker continuously at 38kHz. If the Enable (EN) function will not be used, the jumper must be installed . When the jumper is removed, pin 4 of the 555 timer is held LOW (RESET) by R3, a 22K pull-down resistor. Then, if a HIGH condition is applied to the EN pin, the reset condition will be relieved and the 555 timer will begin to oscillate. The Enable function cannot be used if the GREEN JUMPER is in place. You must remove the jumper on the board in order to use the EN (Enable) pin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.