IR ARRAY SENSOR
IR ARRAY SENSOR
IR array sensor consists of more than one IR
sensor. Each IR sensor is capable of detecting black and white colors. The
array is capable of emitting sounds. IR array can perform object detection at
proper distances. We can interface IR array sensor with Arduino to develop
automation projects in a wide range.
Application:
- Double line following robot.
- Automatic street light turn ON vehicle presence.
- Detection of multiple objecs.
Sample Project With Arduino:
In this we going to detect the object or obstacle using the IR array and it indicate the object detected in which array.
Materials required:
- IR array sensor
- Arduino UNO
- Connecting wires
Circuit:
int IRpin = 0;
int IRpin1 = 1;
int IRpin2 = 2;
int IRpin3 = 3;
void setup()
{
Serial.begin(9600);
pinMode(IRpin, INPUT);
pinMode(IRpin1, INPUT);
pinMode(IRpin2, INPUT);
pinMode(IRpin3, INPUT);
}
void loop()
{
if (digitalRead(IRpin) == HIGH)
{
Serial.println("Obstacle detected in
First IR Sensor");
}
if (digitalRead(IRpin1) == HIGH)
{
Serial.println("Obstacle detected in
Second IR Sensor");
}
if (digitalRead(IRpin2) == HIGH)
{
Serial.println("Obstacle detected in
Third IR Sensor");
}
if (digitalRead(IRpin3) == HIGH)
{
Serial.println("Obstacle detected in
Forth IR Sensor");
}
}
Comments
Post a Comment