Anti Theft Detection From IR Sensor Using Arduino....
Hello Guys! This is my second projects Anti Theft Detection From IR Sensor Using Arduino. If you have not read my 1st article LED BLINK ON ARDUINO BOARD WITH SIMPLE ARDUINO PROGRAMMING you can click on this article. This is a very simple project. You can easily make and run with few times. We have used the IR Module to create an Anti Theft Detection project.IR Sensor or IR module or Proximity sensor module is very useful. You can create a lot's of projects like You can make projects
1. Line following Robot.
With the help of this sensor,your robot proceed by following the line.
And you can make
2.Object detection System or Object avoiding Robot.
And you make a lot of projects.When you will learn to use the IR module and interface to the Arduino Board. so Let's start...
So we have designed such a system that IR module will keep detecting the expensive objects or theft the expensive thing. and Buzzer starts ringing immediately. So that we know that someone is trying to steel our expensive thing and we can do it immediately. I have given a little information about Arduino in previous article .So today i will tell a little information about to IR Module ...
What Is IR Proximity Sensor?
IR Proximity sensor is simple electronics circuit.This sensor is used very much in Science projects and other usable projects. You can easily interface this ir module with Programming board and Different-Different circuits.
Pin Configuration
Pin Name Description
Vcc (3v to 5v) Power supply Input
GND Power Supply Ground
OUT Active High Output
There are some components parts...
1.IR Transmitter
2.IR Receiver or Photo diode
3. Variable Resistance
4.Op-Amp
5.Output Indicator Led
6.Some Resistance.
IR Transmitter:-IR Transmitter is a type of led.Which has a white color led or then a transparency color of led. IR led's work is to release rays from self in a range of infra ray frequency.The rays emanating from ir led are invisible ,which we can not see. The range of ir leds commonly used in science projects is around 20 cm. This means that ir module can detect up to 20 cm to any object and also ir module available s are with different-different ranges in the market that depend on manufacture and designer...
IR Receiver :-IR Receiver is a type of led. Which has a black color of led.IR receiver or Photo diode receiver works to receive the incoming signal from the objects like human,animals or any things.This means that the rays emitted by the ir receiver led reflect on an object then it returns to ir receiver to receive the reelected rays from the objects. In this way our photo diode detected the object and then turn on of the indicator led of ir module and after some process.
LM358 Op Amp:-LM358 is an operational Amplifier is used as voltage comporator in the ir module.Comparotor compares threshold voltages through the set of preset ,which is connected to lm358 pin number 2 and photodiode is connected with series resistance to lm358 pin number 3.When phodiode's series resistancee voltage is (>)less than.The threshold voltage operational amplifier output is high and when photodiode's series resistance is (<)greater than,op amp is low. when op amp is high so op amp output so lm358 op amp of output indicator led is glow or on and when op amp is low lm358 op amp of output indicator led is Off . It means output indicator led of ir module is not glow..
Variable resistance:- Variable resistance is a preset.Sets the range from preset of ir module for object detection.
IR Proximity Sensor Give Output Status
Step 1:- When IR Sensor has detected any object. So IR sensor gives Logic 1.
Step 2:- When IR Sensor has not detected any object. So IR sensor gives Logic 0.
Component Required:-
1. Arduino UNO With USB Cable
2. IR Module
3. Buzzer
4. Some Male and Female wires
5.Bread Board For Circuit Connection
Circuit Wiring:-
Arduino Uno - IR Module
5v Vcc - Vcc
GND - GND
D2 - Signal Or Out Or Do
Arduino Uno - Buzzer
GND - (-) Terminal
D3 - (+) Terminal
First connect GND pin of IR module to GND pin of Arduino and Vcc pin of ir module is connected to 5 v pin of Arduino and Do pin of ir module is connected to D2 pin of Arduino and also (+) positive terminal of buzzer is direct connected to D3 pin of Arduino Uno and (-) negative terminal or GND terminal of Buzzer is connected to GND pin Of Arduino..
Code:-
int IR = 2;
int Buzzer = 3;
int var ;
void setup()
{
Serial.begin(9600);
pinMode(IR, INPUT);
pinMode(Buzzer, OUTPUT);
digitalWrite(Buzzeer, LOW);
}
void loop()
{
var = digitalRead(IR);
Serial.print("IR =");
Serial.Println(var);
if ( var == 1)
{
digitalWrite(Buzzeer, HIGH);
Serial.println(" Theft Detected! ");
}
else
{
digitalWrite(Buzzeer, LOW);
Serial.println("Normal Position");
}
delay(500);
}
Code Description:-
int IR = 2;
int Buzzer = 3;
int Var ;
This is int data type Global variable declared Arduino pin number 2 is IR, and Arduino pin number 3 is Buzzer and also Var for data store from the ir sensor.
Serial.begin(9600);
Serial.begin(9600) is predefined function that sets the speed of communication for computer to Arduino Board in the bits per second.
PinMode(IR, INPUT);
pinMode(Buzzer, OUTPUT);
pinMode( ) is predefined function for make input pin or output pin of Arduino. So here Buzzeer or 2 is made input pin of Arduino with the help of pinMode( ) function, and also made 3 or Buzzer input pin of Arduino.
digitalRead(IR);
First of all we have to remember that ir module's out pin is connected from Arduino pin number 2 and we read and store the data of IR sensor by using the digitalRead() in the Var variable.
When we give power supply to the system. The IR sensor normal position ,so indicator led of ir sensor is not glow, it mean's no object detects within the range of the ir module, during which time ir sensor read's the zero value. and when ir sensor detects the object so indicator led of ir sensor is glow and read data One from the ir sensor.
In this way the data of the input sensor can be easily read by using the digitalRead predefined function.
Serial.print("Var = ");
Serial.println(Var);
Serial.print( ) is a predefined function by using this function, whatever input sensor's are connected to the Arduino board. Show the all data of the input sensor on the serial monitor of the Arduino IDE. Whatever name we write inside the double quot (" ") in the bracket of Serial.print( ) .So the serial monitor show the names whatever you write the string inside the " " .And continuously read data and store data in to var variable from the ir sensor and show data on serial monitor of Arduino ide...
if ( var == 1)
{
digitalWrite(Buzzeer, LOW);
Serial.println(" Theft is not Detected ");
}
else
{
digitalWrite(Buzzeer, HIGH);
Serial.println(" Theft is Detected! ");
}
if ( ) statement is a powerful conditional statement.if statement is used when we want to any particular instruction execute through the condition. We know that if IR sensor detects any objects ,it gives logic 1. And if IR sensor does not detect any objects ,it gives logic 0.So we put the IR sensor in front of the expansive things in such a way that it keeps detecting them.It means give logic 1. So we have applied a condition in a if statement.
If the condition of if statement is True it mean's object is detected from ir sensor,then the instructions is executed inside the body of if statement. So here we have kept the Buzzer OFF by using the digitalWrite(Buzzer, LOW ) predefined function inside the bode of if statement and show status Theft Is Not Detected! on serial monitor using Serial.println(" " ).
If the condition of if statement is False it mean's object is not detected from ir sensor,then the instructions is executed inside the body of else statement. So here we have kept the Buzzer ON by using the digitalWrite(Buzzer, HIGH)
predefined function inside the body of else statement and show status
Theft Is Not Detected! on serial monitor using Serial.println(" " ).So this is how the project works. Thank You...
0 Comments