Keyes IR obstacle avoidance sensor

IRObstacleAvoidance1

The Funduino Tracking Maze Robot also comes with 3 IR Obstacle Avoidance Sensors. I couldn’t find any information about it, but i found information about similar ones and give it a try.

The sensor works by sending infrared rays of certain frequency. When the infrared ray meets an obstacle(reflection surface), it is reflected and received by receiver. Then the corresponding indicator light is on. The sensor has a potentiometer knob you can adjust to change the detection distance. I’ve managed to work with 10,5 cm (roughly 4.1 inches).

Although the sensor has 4 PINs, only the first 3 are used. The last PIN, apparently does nothing (but correct me if i’m wrong).  I went trying to work with it using the PIN – EN – as an activation sensor PIN (putting it in HIGH) and deactivating the sensor (putting it on LOW), but the result was the same. The sensor always worked. When reading, the input is always 1.

Here are the connections of the sensor (from GND to EN)

GND Vcc Input signal EN – not used

And, for testing with the Arduino, the connection PINs:

Sensor Arduino
GND GND
+ 5v
Out PIN 9
EN Not used

IRObstacleAvoidance2

Here a small code to test the sensor

By default, the sensor returns 1. When detecting something, the sensor returns 0.

IRObstacleAvoidance

2 thoughts on “Keyes IR obstacle avoidance sensor

  1. The EN (enable) Pin will not work unless you remove the EN jumper. To work properly, it is important to use the EN function because the HS0038BD IR sensor module is expecting pulses of 38Khz IR light. If will interpret a steady IR signal of any frequency, including 38Khz, as noise, and attenuate it. See the data sheet.

    1. Hi Bud !
      Thank you for the information. I’ll update the post to reflect your comment!

      Thank you again and best regards

Leave a Reply

Your email address will not be published. Required fields are marked *