Line Tracking Sensor KY-033 With Arduino and Buzzer:

by rayankiwan63 in Circuits > Arduino

4390 Views, 0 Favorites, 0 Comments

Line Tracking Sensor KY-033 With Arduino and Buzzer:

ky-033-line-tracking-sensor.jpg

KY-033 Line tracking sensor– A line tracking sensor and it does exactly what the name suggests it tracks black lines against white background or white lines against black background whatever you would like to do and it’s a pretty simple device. This sensor is also known as hunt sensor or line following sensor. I just want to talk a little bit about what these things can do and how they should be used with the Arduino. This sensor consists of IR. This is basically obstacle sensing module having built-in receiver and transmitter that senses the IR energy and looks for the reflected IR energy to detect the obstacle in front of the sensor module. The sensor returns the status of the IR light reflected from the surface. So it’s a pretty simple device it has got an infrared receiver and an infrared transmitter. So the transmitter is constantly transmitting infrared pulses and the receiver is looking for those pulses to receive when reflected. When this line tracking sensor is on a black surface then all of the radiation that’s been transmitted gets absorbed by the surface and nothing is reflected onto the sensor and so we get a zero output signal and when it is on a white surface the opposite happens all of the radiation that is transmitted off the transmitter is being detected by the receiver and then we get a positive signal or a digital one. There is a knob that you can use it goes from one to three and you can use this to adjust the sensitivity of the line tracking sensor. A line tracking sensor consists of three pins in which one pin is ground, one is VCC and other pin is the output of the sensor.

Components Needed

  1. Line Tracking sensor KY-033
  2. Arduino UNO
  3. 5 V buzzer
  4. 2 LEDs
  5. 2 Resistors 220 ohm

Circuit Diagram

line-sensor-with-the-arduino-ky033-line-tracking-Sensor.jpg

  1. Connect the ground of the line tracking senor with ground of the Arduino.
  2. Connect the output pin of the line tracking senor with the digital pin 2
  3. Connect the VCC of the line tracking sensor with 5 V of the arduino
  4. Now connect the digital pin d3 of the arduino with one terminal of the 220 ohm resistor and connect the other terminal of the resistor with the anode of the led and connect the cathode of the led with the ground.
  5. Similarly connect the digital pin d4 of the arduino with one terminal of the 220 ohm resistor and connect the other terminal of the resistor with the anode of the led and connect the cathode of the led with the ground.
  6. Now connect the digital pin 5 of the arduino with positive terminal of the buzzer and connect the negative terminal of the buzzer with the ground..

Code

KY-033 Line Tracking Sensor with Arduino | step by step with code #sensor #arduino #viral #trending
#define sensor 2 

#define buzzer 3

 #define red 4 

#define green 5  

void setup() { 

Serial.begin(9600);

 pinMode(sensor,INPUT);

 pinMode(buzzer,OUTPUT); 

pinMode(green,OUTPUT);

 pinMode(red,OUTPUT);   }  

void loop() {

 bool value = digitalRead(sensor);

 if(value == 0)

 {   digitalWrite(buzzer, HIGH);    

 digitalWrite(green, HIGH);       

digitalWrite(red, HIGH);  } 

else {     

digitalWrite(buzzer, LOW);     

digitalWrite(green, LOW);      

 digitalWrite(red, LOW);   

} 
}