Ks0051 keyestudio Infrared Obstacle Avoidance Sensor: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
<br>
==Introduction==
==Introduction==
Infrared obstacle avoidance sensor is equipped with distance adjustment function and is especially designed for wheeled robots. This sensor has strong adaptability to ambient light and is of high precision. It has a pair of infrared transmitting and receiving tube. When infrared ray launched by the transmitting tube encounters an obstacle (its reflector), the infrared ray is reflected to the receiving tube, and the indicator will light up; the signal output interface outputs digital signal. We can adjust the detection distance through the potentiometer knob ( effective distance: 2~40cm, working Voltage: 3.3V-5V ). Thanks to a wide voltage range, this sensor can work steadily even under fluctuating power supply voltage and is suitable for the use of various micro-controllers,  Arduino controllers and BS2 controllers. A robot mounted with the sensor can sense changes in the environment.
Infrared obstacle avoidance sensor is equipped with distance adjustment function and is especially designed for wheeled robots. <br>
<br>[[File:511.png|500px|frameless|thumb]]<br>
This sensor has strong adaptability to ambient light and is of high precision. It has a pair of infrared transmitting and receiving tube.  
When infrared ray launched by the transmitting tube encounters an obstacle (its reflector), the infrared ray is reflected to the receiving tube, and the indicator will light up; the signal output interface outputs digital signal. <br>


We can adjust the detection distance through the potentiometer knob (effective distance: 2~40cm, working Voltage: 3.3V-5V ). <br>
Thanks to a wide voltage range, this sensor can work steadily even under fluctuating power supply voltage and is suitable for the use of various micro-controllers,Arduino controllers and BS2 controllers.
A robot mounted with the sensor can sense changes in the environment.<br>
<br>[[File:KS0051 obstacle detector.png|500px|frameless|thumb]]<br>


<br>
==Specification==
==Specification==
*Working Voltage: DC 3.3V-5V
* Working voltage: DC 3.3V-5V
*Working Current: ≥20mA
* Working current: ≥20mA
*Working Temperature: -10℃—+50℃
* Working temperature: -10℃ to+50℃
*Detection Distance: 2-40cm
* Detection distance: 2-40cm
*IO Interface: 4 wire interface (-/+/S/EN)
* IO Interface: 4 PIN (-/+/S/EN)
*Output Signal: TTL voltage
* Output signal: TTL voltage
*Accommodation Mode: Multi-circle resistance regulation
* Accommodation mode: Multi-circle resistance regulation
*Effective Angle: 35°
* Effective Angle: 35°
*Size: 41.7*16.7mm
*Weight: 5g


<br>
==Connection Diagram ==
==Connection Diagram ==
<br>[[File:0051.png|700px|frameless|thumb]]<br>


<br>[[File:522.png|500px|frameless|thumb]]<br>  
<br>


==Sample Code ==
==Sample Code ==
<pre>
<pre>
const int sensorPin = 2;    // the number of the sensor pin
const int sensorPin = 3;    // the number of the sensor pin
const int ledPin =  13;      // the number of the LED pin
const int ledPin =  13;      // the number of the LED pin
int sensorState = 0;        // variable for reading the sensor status
int sensorState = 0;        // variable for reading the sensor status
Line 38: Line 45:
   else {
   else {
       digitalWrite(ledPin, LOW);  
       digitalWrite(ledPin, LOW);  
}</pre>
  }
}
</pre>
 
<br>
== Result ==
Done uploading the code to board, you can see the led on both UNO board and obstacle detector sensor is turned on.<br>
If we put a foam block in front of the sensor, this time when sensor detects the obstacle, sled on the sensor will be turned on.<br>
<br>[[File:KS0349 10-3.png|500px|frameless|thumb]]<br>


<br>
==Resources ==
==Resources ==


'''Video'''
* '''Video'''<br>
http://video.keyestudio.com/ks0051/
 
* '''PDF and Code'''<br>
https://fs.keyestudio.com/KS0051
 
 
<br>


http://www.keyestudio.com/wp/2016/05/ks0052-keyestudio-pir-motion-sensor-module/
==Buy from==


'''Datasheet'''
*[https://www.keyestudio.com/free-shipping-keyestudio-ir-infrared-obstacle-avoidance-sensor-module-for-arduino-robot-car-p0159.html    '''Official Website''']


http://www.keyestudio.com/keyestudio-infrared-obstacle-avoidance-sensor-for-arduino.html
*[https://www.aliexpress.com/store/product/Free-shipping-intelligent-barrowload-sensor-infrared-sensor-photoelectric-switch-for-arduino/1452162_2053067205.html?spm=2114.12010612.8148356.7.52862462ZM2AO8  '''Shop on aliexpress''']


=Buy from=
http://www.keyestudio.com/keyestudio-infrared-obstacle-avoidance-sensor-for-arduino.html


[[Category: Sensor]]
[[Category: Sensor]]

Latest revision as of 14:13, 7 January 2021


Introduction

Infrared obstacle avoidance sensor is equipped with distance adjustment function and is especially designed for wheeled robots. 
This sensor has strong adaptability to ambient light and is of high precision. It has a pair of infrared transmitting and receiving tube. When infrared ray launched by the transmitting tube encounters an obstacle (its reflector), the infrared ray is reflected to the receiving tube, and the indicator will light up; the signal output interface outputs digital signal.

We can adjust the detection distance through the potentiometer knob (effective distance: 2~40cm, working Voltage: 3.3V-5V ). 
Thanks to a wide voltage range, this sensor can work steadily even under fluctuating power supply voltage and is suitable for the use of various micro-controllers,Arduino controllers and BS2 controllers. A robot mounted with the sensor can sense changes in the environment.

thumb


Specification

  • Working voltage: DC 3.3V-5V
  • Working current: ≥20mA
  • Working temperature: -10℃ to+50℃
  • Detection distance: 2-40cm
  • IO Interface: 4 PIN (-/+/S/EN)
  • Output signal: TTL voltage
  • Accommodation mode: Multi-circle resistance regulation
  • Effective Angle: 35°


Connection Diagram


thumb


Sample Code

const int sensorPin = 3;     // the number of the sensor pin
const int ledPin =  13;      // the number of the LED pin
int sensorState = 0;         // variable for reading the sensor status
void setup() {
  pinMode(ledPin, OUTPUT);      
  pinMode(sensorPin, INPUT); }
void loop(){
  // read the state of the sensor value:
  sensorState = digitalRead(sensorPin);
  // if it is, the sensorState is HIGH:
  if (sensorState == HIGH) {     
     digitalWrite(ledPin, HIGH);  
  } 
  else {
       digitalWrite(ledPin, LOW); 
  }
}


Result

Done uploading the code to board, you can see the led on both UNO board and obstacle detector sensor is turned on.
If we put a foam block in front of the sensor, this time when sensor detects the obstacle, sled on the sensor will be turned on.

thumb



Resources

  • Video

http://video.keyestudio.com/ks0051/

  • PDF and Code

https://fs.keyestudio.com/KS0051



Buy from