Crowtail- Adjustable Infrared Sensor

From Elecrow
Revision as of 06:04, 22 August 2019 by Admin (talk | contribs) (Created page with "== Introduction == This infrared distance switch features a high-sensitivity photoreflector to perform distance detection function,ranging from 3cm to 50cm. When the infrared...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

This infrared distance switch features a high-sensitivity photoreflector to perform distance detection function,ranging from 3cm to 50cm. When the infrared light emitted by the emitter gets reflected on a surface that blocked it, the phototransistor can pick up the signal for distance calculation. Also a potentiometer for adjustment is arranged for easy and clear use. It is small, easy to use/assemble, and inexpensive. Useful for robotics, interactive media, industrial assembly line, etc.
Model: CT0036AIS

Crowtail- Adjustable Infrared Sensor11.jpg

Features

  • Power supply: 5V
  • Current: 100mA
  • Range: 3-50cm adjustable
    • Red: +5V
    • Yellow: Signal
    • Black: GND
  • Wire length: 20cm
  • Dimensions(mm):45.0(L)x23.4(W)x23.4(H)

Usage

Hardware

Connect this sensor to your Arduino/Crowduino digital pins( D2 for example). When there is an object behind this sensor, the output would be low.
Crowtail- Adjustable Infrared Sensor12.jpg

Programming

1.Download the following program to Arduino, Please refer to here

void setup()  {
 Serial.begin(9600);
 pinMode(2,INPUT);
}
void loop()  {
 while(1)  {
   delay(500);
   if(digitalRead(2)==LOW)  {
     Serial.println("object detected.");
   }
   else  {
     Serial.println("no object detected.");
   }
 }
}

2.open the serial monitor , and set the baudrate to 9600, you will see the output changes with the object behind this sensor or not.

if no object:
Crowtail- Adjustable Infrared Sensor01.jpg 300px
have object:
Crowtail- Adjustable Infrared Sensor21.jpg Crowtail- Adjustable Infrared Sensor3.png