Introduction: INTERFACING TRACKING SENSOR KY-033 AND BUZZER WITH BHARAT -PI

KY-033 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.

Step 1: KY-033 SPECIFICATIONS

On the front side, this module has an infrared emitter/receiver, an adjustable potentiometer, a LM393 differential comparator, and an indicator LED. The back side has 4 resistors, two of which are 10 kΩ, one is 1.5 kΩ and the other one is 220 Ω.

The KY-033 has 3 pins: GNDOUT, and VCC. The output pin of the module is digital, its state is HIGH when the module is on top of a black surface, signaling that a line is detected. The state is LOW when the module is on top of a white surface, signaling that a line is not detected.

The indicator LED turns on when the infrared light is reflected back to the receiver, meaning that a line is not detected.

  1. Working voltage : 3.3V — 5.5V DC
  2. Output signal : TTL level (high level if line detected, low if no line detected)
  3. Board Size : 1cm x 4.2cm [0.39in x 1.65in]

Step 2: Components Needed

1.  Line Tracking sensor KY-033

2.  Arduino UNO

3.  5 V buzzer

4.  2 LEDs

5.  2 Resistors 220 ohm

Step 3: Connection Diagram

1.  Connect the ground of the line tracking senor with ground of the BHARAT-PI.

2.  Connect the output pin of the line tracking senor with the digital 35 pin

3.  Connect the VCC of the line tracking sensor with 5 V of the arduino

4.  Now connect the digital pin 26 of the arduino with one terminal of the 220 ohm resistor and connect the other terminal of the resistor with the anode of the red led and connect the cathode of the led with the ground.

5.  Similarly connect the digital pin 25 of the arduino with one terminal of the 220 ohm resistor and connect the other terminal of the resistor with the anode of the green 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..

Step 4: Code

#define sensor 35

#define buzzer 32

 #define red 26

#define green 25

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)

 { tone(buzzer,500);  

 digitalWrite(green, LOW);   

digitalWrite(red, HIGH); 

delay(500);}

else {  

    noTone(buzzer);  

   digitalWrite(green, HIGH);   

 digitalWrite(red, LOW); 

   delay(500);

}

}

 code avilable at git hub: https://github.com/Madhankarthick/interfacing-tracking-sensor-with-bharat-pi/blob/170e5f957871dad1f9b55e3b34bcca2351ace8e5/tracking%20sensor.txt

Step 5: Working

In the following Arduino sketch, we’ll read the digital signal from the output pin of the KY-033 every 500 milliseconds, and see the output at led’s.

The green led will glow if no object detected but if object detected the red led will glow and buzzer will go on.

Step 6: Application

  1. Location tracking: A location sensing device is used to triangulate on known points to provide a relative location. This can be a hardware device built for that purpose or it could be an App installed on a smartphone which leverages the location sensing capability of the phone.
  2. Observing teen driving behaviours: Commonly used by parents to observe teen driving behaviours, businesses to monitor employee driving activity and police agencies to conduct surveillance.
  3. Eye tracking: Placed on or within the machine interface and using the eye’s reflection of near infrared light beams, eye tracking technology calculates data about the user; detecting presence, attention, and focus as well as the position of a person’s eye and pupil size.


Step 7: Video