Wednesday, June 26, 2019

How to make ir sensor/proximity sensor/obstacle sensor

Hi  guys i'm Manitesla let' s start our project.
In this project i'm going to explain how to make your own ir sensor and how to use it using arduino and without arduino.


components requires:
  • 1 x Ir transmitter ,receiver



  • 1 x 10k resister

  • 1 x 100ohm resistor




Hardware connection:








  • connect the ir leds has shown in the figure















  • Connect the anode of ir transmitter to 100 ohm resisitor
  • Connect the negative of ir receiver to 10k resistor
  • Connect both the ends of 10k and 100ohm resistor (this is the +ve pin , connect it to 5v)
  • Connect the anode and cathode of ir receiver and ir transmitter together(this is the -ve pin, connect it to ground)
  • Connect an  another wire to anode of receiver  (this is the signal pin)
  • You can identify the anode and cathode of led by lookind at the pins , the longer pin is anode and shorter is cathode
  • You can also identify anode and cathode by looking at the edge of led, the flat edge of led id cathode.
  • Iyou do not find 100 ohm resistor as i did you can use any other resistor nearer to 100 ohm.
  • Ir sensor module is ready .
obstacle sensor circuit without arduino:









Connect the components as shown in the above circuit to make obstacle sensor .

  • Take the ir sensor which we built above , connect the signal pin of ir led to base of 2n222a/ bc547 transistor(add resistor to base if required)
  • Connect emitter of transistor to ground and also connect gnd pin of ir sensor to ground
  • Connect collector of transistor to cathode of led  
  • Connect the  anode of led ,and ir sensor to 5v
obstacle detector using arduino:

  1. Take your arduino board and ir transmitter and receiver.



2. Connect transmitter anode to 100 ohm and to 5v and connect cathode to gnd
3.
  • Connect anode of receiver to cathode of transmitter
  • Connect 10k resistor to ir receiver anode 
  • Connect both the resistor ends to 5v
  • Connect the signal pin taken from receiver to A5 on arduino.





 *Open the arduino ide and paste the code given below and upload it to the uno board.



1. Paste the given code in arduino ide



                                         Click here to download the direct Arduino code file



code:



int inputpin = A5;
int sensor;



void setup( )
{
Serial.begin(9600);
pinMode(inputpin , INPUT);

}

void loop()
{
sensor = analogRead(inputpin);
Serial.println(sensor);
}



working:
  • Open serial monitor
  • You can see the values sent by the sensor 
  • Now try to bringbyour hand near to the ir sensor
  • You will notice that the values keep on decreasing has you move your hand nearer to the ir sensor.
  • By these values you can find out how much far or the nearer is the obstacle .
  • In the next blog im going to make robot car using these sensors hence stay tuned until then bye :)





No comments:

Post a Comment