Description
Product name: Obstacle Avoidance Sensor
Size: L46*W17*H11mmWorking voltage: DC 3.3V-5V
Working current: 20mA
Working temperature: -10degree+50degree
Detection distance: 2-40cm
IO interface: 4 lines (-/+/S/EN)
Output signal: TTL Level
Adjusting mode: Multi-resistance regulation
Effective angle: 35°
Specifications:
Working voltage |
DC 3.3V – 5V |
Working current |
More than 20mA |
Working temperature |
-10 to 50 centigrade degree |
Detection distance |
2 – 40cm |
IO interface |
4 line (- / + / S / EN) |
Output signal |
TTL Level |
Adjusting mode |
Multi-resistance regulation |
Effective angle |
35 degree |
Weight (gm) |
5 |
Dimensions in mm (LxWxH) |
40 x 16 x 11 |
Sample Code:
int detector = 8; // define the obstacle avoidance sensor interface
int val ;
void setup ()
{
pinMode(13, OUTPUT); // Built in Arduino LED
digitalWrite (13, LOW);
pinMode (detector, INPUT) ;// define the obstacle avoidance sensor output interface
}
void loop ()
{
val = digitalRead (detector) ;
if (val == HIGH) // When the obstacle avoidance sensor detects a signal, LED flashes
{
digitalWrite (13, HIGH);
delay(100);
}
else
{
digitalWrite (13, LOW);
delay(100);
}
}