IR SENSOR

IR SENSOR is detector or a electronic which is used to detect obstacle or a body at some distance. These types of sensors are easily available in the market and also some of the better versions are also available.

Nowadays we all see many devices which uses ir sensor to do some of the basic task in our day to day life like:- Automatic soap dispenser, Automatic taps, These are a type of obstacle detection sensor and used for short range like within 10 cm. The sensor which I am using is the basic one and easily available.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: DESCRIPTION

IR sensor is a sensor which is built out of LM358 ic a pair of ir leds or infrared transmitter led or infrared receiver led a variable resistor to trim the values of range of the value given by the sensor to the micro-controller.

Sensor also has an on-board Power led and also an on-board Status led which will blink whenever the sensor detects an obstacle.

Photo leds are those leds which are built to do some specific wavelength of light. These leds are useful in transmitting data for a far distance but the condition is that the receiver must be of high gain. In the pair which I am using the leds are of good quality.

The white led is the transmitter led and the black one is the receiver led

*NOTE:- THIS SENSOR IS AN IR LIGHT BASED AND THERE ARE FEW DRAWBACKS OF IT LIKE:- SUNLIGHT ALSO HAVE IR RAYS WHICH CAN RESULT IN THE MALFUNCTIONING OF THE LED, ALSO BLACK COLOR ABSORBS LIGHT OF ALL WAVELENGTH HENCE IN SHORT SENSOR WOULD NOT WORK IF THE OBJECT IS BLACK IN COLOR..

This sensor gives the output of DIGITAL type. Difference b/w analog and digital signal is that in the digital signal only high state or low state is given but in the analog signal values b/w 0-1023 is given which is more suitable for condition in the code.

Step 2: SCHEMATIC DIAGRAM

Step 3: FEATURES AND APPLICATIONS

  • Photosensitivity is high
  • Easy to use
  • Adjustable value
  • Low price
  • Can be used in projects and automatic devices like tap and dispensers
  • Obstacle alarm
  • Automated robots

Step 4: SENSOR SPECIFICATIONS

Step 5: COMPONENTS NEEDED

  • Any microcontroller preferably Arduino Uno for beginners.
  • A led
  • A buzzer
  • A ir sensor
  • A breadboard
  • Jumper wires
  • 1kohm resistor

Step 6: CIRCUIT DIAGRAM

First take the power lines onto the bread board from microcontroller

VCC/5v-->+ line and GND--> - line.

Then connect the sensor on to the bread board and connect power to the sensor from powerlines using jumper wires.

Now connect OUT PIN OF SENSOR TO MICROCONTROLLER digital PIN 3.

Now connect a buzzer to the breadboard – wire to gnd and + wire to digital pin 4 of the microcontroller also connect a led parallel to the buzzer.

Step 7: CODE

//put this code in the ide of arduino from this line

//note:- this code is for digital value

int sensor=3; //initializing the digital pin

int buzzer=4; // initializing buzzer pin

int value;

void setup(){

Serial.begin(9600);

pinMode(sensor, INPUT); // assing the pin mode type of the pin as input or output

pinMode(buzzer, OUTPUT);

}

void loop(){

if(digitalRead(sensor)==HIGH){

digitalWrite(buzzer, HIGH);

}

else{

DigitalWrite(buzzer, LOW);

}

}

Step 8: WORKING

As the code starts it initializes the pin to which the sensor sends its data then the microcontroller waits for the data to be received as soon as the data is received it then check the condition and forwards the value to switch on or off the buzzer.

Infrared light emitted by the ir transmitter led are received by the photo receiver led and is amplified by an op-amp lm358 and is transferred to the OUT pin of the sensor.

Step 9: PCB DESIGNING

Now we have got the PCB design and it’s time to order the PCB’s.
For that, you just have to go to JLCPCB.com, and click on “QUOTE NOW” button.

JLCPCB are also sponsor of this project. JLCPCB (ShenzhenJLC Electronics Co., Ltd.), is the largest PCB prototype enterprise in Chinaand a high-tech manufacturer specializing in quick PCB prototype and small-batch PCB production. You can order a minimum of 5 PCBs for just $2.

To get the PCB manufactured, upload the gerber file you downloaded in the last step. Upload the.zip file or you can also drag and drop the gerber files.

After uploading the zip file, you’ll see a success message at the bottom if the file is successfully uploaded.You can review the PCB in the Gerber viewer to make sure everything is good. You can view both top and bottom of the PCB.

After making sure our PCB looks good, we can now place the order at a reasonable price. You can order 5 PCBs for just $2 but if it’s your first order then you can get 10 PCBs for $2.

To place the order, click on “SAVE TO CART” button.

My PCBs took 2 days to get manufactured and arrived within a week using DHL delivery option. PCBs were well packed and the quality was really good.

*NOTE:- If you need pcb gor this project than contact me or write me in the comment.

Be the First to Share

    Recommendations

    • Instrument Contest

      Instrument Contest
    • Make it Glow Contest

      Make it Glow Contest
    • STEM Contest

      STEM Contest

    Discussions