Overview :

In this tutorial we will see how to make simple infrared sensor module for detecting reflecting surface. This sensor can be used to detect reflecting silver/white strip, obstacle detection, flame detection, etc. These sensors are primary requirement of any simple line follower robo-car.

Principle :sensor

IR LED emits infrared radiation. This radiation illuminates the surface in front of LED. Surface reflects the infrared light. Depending on reflectivity of the surface, amount of light reflected varies. This reflected light is made incident on reverse biased IR sensor. When photons are incident on reverse biased junction of this diode, electron-hole pairs are generated, which results in reverse leakage current. Amount of electron-hole pairs generated depends on intensity of incident IR radiation. More intense radiation results in more reverse leakage current. This current can be passed through a resistor so as to get proportional voltage. Thus as intensity of incident rays varies, voltage across resistor will vary accordingly.

This voltage can then be given to OPAMP based comparator.Output of the comparator can be read by uC. Alternatively, you can use on-chip ADC in AVR microcontroller to measure this voltage and perform comparison in software.

IR LED and IR sensor :

IR LED is used as a source of infrared rays. It comes in two packages 3mm or 5mm. 3mm is better as it is requires less space. IR sensor is nothing but a diode, which is sensitive for infrared radiation. cropIR sensors

This infrared transmitter and receiver is called as IR TX-RX pair. It can be obtained  from any decent electronics component shop and costs less than 10Rs. Following snap shows 3mm and 5mm IR pairs.

Colour of IR transmitter and receiver is different. However you may come across pairs which appear exactly same or even has opposite colours than shown in above pic and it is not possible to distinguish between TX and RX visually. In case you will have to take help of multimeter to distinguish between them.

Here is how you can distinguish between IR TX-RX using DMM :

  • Connect cathode of one LED to +ve terminal of DMM
  • Connect anode of the same LED to common terminal of DMM
    (means connect LED such that It gets reverse biased by DMM )
  • Set DMM to measure resistance upto 2M Ohm.
  • Check the reading.
  • Repeat above procedure with second LED.
  • In above process, when you get the reading of the few hundred Kilo Ohms on DMM, then it indicated that LED that you are testing is IR sensor. In case of IR transmitter DMM will not show any reading.

Following snap shows typical DMM reading obtained when IR receiver is connected to it as mentioned above. Second snap shows how sensor’s resistance increases when it is covered by a finger. Note that, these are just illustrative figures and they will depend upon sensor as well as DMM that you are using.

sIR sensor open sIR sensor covered

While buying an IR sensor, make sure that its reverse resistance in ambient light is below 1000K. If it is more than this value, then it will not be able to generate sufficient voltage across external resistor and hence will be less sensitive to small variation in incident light.

The circuit diagram :

Circuit diagram for IR sensor module is very simple and straight forward.


Circuit is divided into two sections. IR TX and IR RX are to be soldered on small general purpose Grid PCB. From this module, take out 3 wires of sufficiently long length (say 1 ft). Then, as shown above, connect them to VCC, preset and to ground on main board. By adjusting preset, you can adjust sensitivity of the sensor. VCC should be connected to 5V supply.

Making the sensor module :

You can follow these steps to make a sensor module ….

  • First cut the 1 inch piece of grid PCB such that you get 4 columns of holes .
  • Now Solder IR Transmitter and Receivers as shown. While bending their leads, make sure that cathode of each one comes to RHS after mounting on PCB.
  • Solder 470E current limiting resistor as shown.
  • Solder, 47nF capacitor to other end of resistor and anode of RX. Refer circuit diagram.
  • Now take 3 pin RMC connector and twist its wires as shown.
    You can also use wires of your choice, may be FRC.
  • Solder these wires to GND, SIGNAL and VCC points on the PCB. Refer circuit diagram.Finished !!!

 Testing sensor module :

If you have a breadboard(BB) you can quickly test this module and see how it works.
-First, connect Module on BB and connect 50K preset between vOut and GND.
-Connect DMM to movable terminal of preset.
-Rotate preset knob fully so that, resistance between variable terminal and ground is maximum.
-Give 5V supply to sensor module.

Test setup : cTest_IRSen-testSetup cTest_IRSen-testSetupCloseup

Here are some test results of my module :

    Glow of IR LED. Since sensors in out digital cameras are sensitive to IR, we can easily see IR led glowing !! cTest_IRSen-IRGlow
    vOut when K750i’s camera flash was turned on cTest_IRSen-voutInFlash
    vOut in ambient lighting.
Two fluorescent lights are there in room.
    vOut when a piece of white paper is held near to the module. cTest_IRSen-voutWithWhitepaper

Here are some of the snaps of my sensor modules :

    Four IR transmitters are  used to flood the surface. Sensor diode is at the centre. I had made this when I had to detect black wall. Even black colour reflects detectable IR, if irradiated sufficiently. sIR sensor module 2
    Sensor module covered with black tape to lessen effect of ambient IR radiation. Also metal strip is glued for easier mounting on robot-car’s chassis. sIR sensor module 3
    This is how I use sensor module with my mega16 development board. Blue preset is connected to sensor in exactly same way as shown in circuit diagram. vOut is connected to ADC input of AVR. sIR sensor module 4


vOut is the output from sensor module. You can connect this to ADC input of AVR microcontroller. Now using ADC, you can read the voltage developed across the movable tap and grounded pin of preset. Alternatively you can also use OPAMP based comparator.

…. And finally, if you found this tutorial helpful or have any suggestions … do leave a comment.

Ready made modules:
Some readily available infrared sensor Modules
from Amazon:

Infrared Sensor Module Pyroelectric IR Module

From DX:

Small form factor IR sensor module Compact IR Velometer (Sensor module) DIY IR sensor module


  1. swati

    can anybody explain me all the designing part?

  2. i have a confusion its given to use 47nF capacitor so is it equal to the 47 uf or is there diffrence and if yes pls tell me what is the diffrence and what will be its value in uf replay me pls … thanks

    • Omkar


      Yes, there is a big difference.

      47uf = 1000 x 47nf .

      Value of 47uf will be too large for this circuit and sensor will not respond quickly to the changes in reflectivity of the surface.

      – Omkar

  3. Frank

    I’m wondering whether a pair of the standard garage door opener infrared reverse sensors (that sell for around $23 a par) could be used in a stand alone manner. Perhaps DC could be fed to the pair of devices through a resistor and the sensors would work – changing the state of the LED in the receiver end. That voltage could be monitored to activate a circuit external to the sensor.

  4. Thank you for every other informative site. Where else may I am getting that kind
    of information written in such an ideal way? I have a project that I’m simply now working on, and I’ve been on the glance out for such information.

  5. Maria

    it is very informative for begginers

  6. surya s

    can i use this circuit for my project automatic car parking system…..we are using IR sensor…

  7. hiren

    also , Which type IR sensor (model no.) can be used to detect the obstacle and specification of the IR sensor (freq. , range , )

  8. Gourav Singla

    thanks a lot my friend for this useful information……. explained very simply…. thank u…

  9. This is a great tutorial and this is the reason that I included into an article about IR sensors how to tutorials. The article can be readed here http://www.intorobotics.com/use-infraredir-sensors-tutorials/

  10. Anand

    Hello Omkar,

    Good article and well documented. The presentation is clear even a newbie can understand. Thanks


  11. assassin0009

    can i use an ITR9909 in lieu of the 2 Tx and Rx sensors?and is the configuration (including the capacitor) would be still the same?

    • Omkar

      Yes you can use ITR9909. TX connections will be same, for NPN transistor between POT and GND. Connect collector to the POT and emitter to GND. Short the ‘IR-RX’. Connect 47nf capacitor across the collector and emitter terminals.

  12. ARPAN

    very much helpful and awsome……..thanks a lot………but ri8 now there is a problem that it can be seen that the transmitter is transmitting but receiver is probably not receiving

  13. shubham garg

    is dere any circuit using 555 timer.. bcz i want to generate frequency of 38khz…

    • Omkar

      There are ! Search on google. It is very simple to design one.

  14. shruti

    hello!! this is shruti,,,,i made sensors using infra red leds but i am encountering an error,,,,,one que.which arises in my mind is that can we use the -ve terminal of battery for GND or we have to make GND by connecting terminals to body of GPB???????

    • Omkar

      GND is basically a concept, where some reference potential point (which is generally lower than some highest positive potential applied to circuit) is considered as a common reference point for the entire circuit. So, you will have to use a “-ve” terminal of the battery as a GND connection.

    • ajaj Jamadar

      you may use – ve supply terminal of battery. if your further ckt demands for negative supply then use two batteries.

  15. my O/P voltage is ranging from 0.56V-0.10V
    is there a way to increase the range? or the o/p voltage? that is without using an amplifier?

    • Omkar

      Increase the resistor value at the receiver, or slightly (by 10%) decrease the value of the resistor connected to the transmitter.

  16. JbO

    is it possible to connect the circuit to a bulb den make it light when the sensor is activated?

    • Omkar

      Yes, quite possible. You will have to drive a relay from the output of this circuit.

  17. Tsoni

    Hi.Thanks for that very much!!!I am ordering some ir pairs these days, so I was wondering-is there a way i connect two receivers, and when even one of them is triggered by light, a signal is sent to the microcontroller, so I get a wider angle of visibility?
    P.S. Can I directly connect the vout to one of an arduino’s analog pins?The signal of the is analog I believe, so the arduino should have no problems reading them?I need them only to detect objects, not the distance.I read smt about regulating the maximum visible distance(the minimum distance that an object must be to be detected), but can you please tell me how to do it without a potentiometer-maybe some resistors in front of the tx? thanks very much one again :)))))

    • kelvin

      hi, i wish to to interface IR with the timer in such that the system will give feedback after every five minutes if the IR is blocked or not so that i can give that output to the microcontroller.

  18. manjari

    May I please know the use of the capacitor used in the circuit?

  19. shekar

    schematic for 3 ir tx with 1 photodiode reverse gullwing.

  20. Nandan

    Can i use this exact circuit to get 5v i/p to the microcontroller?

    • Omkar

      No, this will not give 5V output.

      • Nandan

        I want to design a sensor circuit so that i can get 5v and 0v variations whenever the object passes through it…..
        And how can i reduce the error, that the ambient light causes???
        Thanks in Advance!!

  21. Tahami

    whats 470E resistor ??? what is its value in ohms ???

  22. sam

    can we use ir led in place of photo transistor l14g3 in recie
    ver side

  23. ranjit

    i have a question .
    how can i choose the rating of resistance and capacitor?
    please reply me as soon as possible on my email kumarranjit64@gmail.com

  24. arun

    Can I measure the distance between the object and the sensors

    • ur well wisher

      keep the measurement tape n measure

  25. Thushan

    sir I am new to this project. I am doing a project detecting target by using IR RX TX module. Followings are my requirment sir.
    (a) May I have the cct diagram of connecting IR RX-TX and convert the analog out put to digital sig.
    (b) How do I work with this dital sig with Micro controller to operate stepper motor.

    My Regards!!!!

  26. amad

    hi omkar…
    im trying to use this cct as automatic switch to my microcontroller.. but it wont work (i connect vout to pin RBO of pic16f877a)
    can u help me?

    the cct works fine if not connected to microcontroller..

    help pliss

    • Omkar


      Connecting vout directly to microcontroller will not work, as vout is analog voltage. Microcontroller will not be able to distinguish between logic high and logic low levels. You have two options:
      1) Use ADC (if available) on microcontroller to convert this voltage in a digital form and use that value. OR
      2) Use external OPAMP based (say using LM339) comparator to generate logic signals.

  27. utkarsh

    its nicely explained….

    But can i use this sensor to count no. of persons entering a room

    • Omkar

      Yes, you can count the pulses to counter number of persons. However, mechanism will work only if one person enters the room at a time.

  28. jagadish

    when the given circuit is connected i don’t get the enough varation,like when with out giving the preset i am getting a variation from 0 to 0.5.
    so i need to get more variation. what should i do..plzz help me in this issue..a quick response is highly appreciated.

    • ramireddy

      hi jagadish
      for this issue you need to use high gain precition amplifier or oerational amplifier to get more variations.
      good night

    • Omkar

      Hi Jagadish,

      You can increase the value of series resistor (with RX) to 100K. More the value, more variation you will get. Don’t make it more than 500K.

  29. Sir,
    Tutorial is gift for beginrs,but i could not find a circuit. Could u give me IR sensor circuit which suitable for IC motor driver L293D. So that ,motor cannot run if IR is sensed from atleast 5cm distance.

  30. adam

    Question: that may not belong here I saw a infared duck hunting toy the other day, you point an plastic toy gun with and infared beam and when it hits a flying plastic duck the duck stops flaping its wings and falls, would it be cheaper to buy the toy for $25 or could i build somthing like this for cheaper? would this prodject work? if anyone knows where to point me in the right direction it would be appreciated.

  31. Rajat

    i am making a railway gate control using IR sensor.my question is how and which ADC will i connect to the outputs of IR sensor so that it will give me the digital output so that i can interface it with 89c51 and further with stepper motor…

  32. fazirahazmi

    Anybody hear..i need your help..this is for my project..i don’t know how to build infrared sensor circuit that will use in my project HUMAN TRACKING FAN..can someone here teach me how to create the circuit diagram..??

  33. nandini

    hey thanks a ton for this circuit :)
    can you also explain how you designed this circuit? you mentioned ’empirical’ values for resistances, did you try out
    different values and settled on one based on trial and error?

    • sandeep

      good question i am also thinking it

  34. Srinivasan Ramachandran aka Ashok

    Nice tutorial you have posted here. Gives me a lot of hope from being dead after a long time. Can you tell me if i can yours to measure the intensity of reflection by reading the voltage out? Assume i keep it very near a surface and measure the reflectance. So should i read the voltage from the unit you have shown above to know the reflection intensity?
    I mean more reflection = more voltage?

    Sorry if my question had been stupid.


    Ashok Srinivasan.

    • Omkar

      yes whatever you have said is correct. Output signal of the above circuit is proportional to the amount of light reflected. So you can use it to approximately measure reflectance of the surface by correlating measured values with some reference values.

      • Srinivasan Ramachandran aka Ashok

        Wow! I owe you something dude. I am really seeing light at the end of the tunnel.

        And You mean by correlating measured values with some reference values? Can you please throw some light on it?

        Also how can i add a filter to avoid detecting ambient day light? Just wrapping a black chart paper around it will do the job of the filter? Is this problem really applicable to the solution?


        Ashok Srinivasan.

      • Srinivasan Ramachandran aka Ashok

        Hello Omkar,

        I did the circuit and connected just the circuit to my Arduino board’s GND, 5V (VCC) and the Vout to the Analog PIN 0. When i look at the transmitter with my mobile camera i can see it glow. Since i was not able to secure a 47nF but was able to get 47pF capacitor and used it in your circuit(I am a beginner with electronics and i come from a mechanical background, sorry if this is a huge mistake).

        Reading the output from the vout I see it is not showing much variation and fluctuates between 4.98 to 5v i believe. Is there anything i am missing here.

        I want to know if the missing piece is due to:

        * The 47pF capacitor.
        * Or do i need to build the PRESET circuit and then connect it with my Arduino.
        * The above points are not the factor, but something else?

        PS: Arduino Board uses a ATMEGA328 microcontroller. For more info on Arduino: www dot arduino dot cc.

        Can you please tell me the piece i am missing here. Thank you for your patience. It would be really great if you can help me on this.


        Ashok Srinivasan.

        • Srinivasan Ramachandran aka Ashok


          Thank you for your circuit. It works like charm i believe. If what i am doing really works out in my result. I owe you something. Atleast a Beer 😉


          Ashok Srinivasan.

      • Srinivasan Ramachandran aka Ashok


        Can you tell us how to calculate reflection strength in terms of units other than the voltage and relation between it?


        Ashok Srinivasan.

    • nasrin sharify

      i need your help please help me if you can
      my project is this:send data between 2 atmega microcontroller by infrared.
      but i dont know the circuit of reciever and transmitter
      please help me i so need your notification
      thanks alot

  35. hi, i am jeni,, im an engineering student here in the phils,,, as our project, I was tasked to make an obstacle avoider robot,,, i just wanna ask if how long is the distance before the sensor detects a barrier? i preferably want to have a long range distance for the sensor to detect a barrirer,, can you pls help me with that? thank you

  36. virender

    Dear sir, Can you please let me know how to see long distant [upto 30 meter] objecte using IR Light. And also plz. let me know what type of lens is used to send the IR Light in long distant. Any reply shall be hightly appreciated.

    With Regards!

  37. abhay

    hi..i am doing a project on eye tracking using ir leds n ir sensors.
    can any 1 tell me how to convert the output of ir sensors into the eye co-ordinates???
    i mean the o/p of ir sensors is voltage, how to map it into co-ordinates or in axis??

  38. aditya

    if im to connect an led in the circuit such that it glows after the sensors have sensed movement across how do i do it?

    • ravi kumar

      first find the output pin of comparator ,and connect a led with a resistor(1kor 10).
      then see the output of sensor through led.


    sir i have to make a sensor to detect human entrance through a door………and with the help of which bulb of that room could get ON.

  40. Mark Bradford

    is there any way I can integrate this device and use it with my android powered smart phone as a universal remote? Please email me if there is any possible way to do this: mbfortis@yahoo.com
    -Mark Bradford

  41. Benjamin Blumer


    It was great once I got it working. I also appreciated the comments you posted about the capacitor selection. Might be a nice thing to add to the main post.

    Great work! Thanks so much.

  42. Bruno

    It’s amazing, very simple…

    Thank you very much!

  43. nikhilss

    thank you very much this circuit really works, i am very happy when i found the result, for doing this sensor i spent lot of time and money but with simple circuit i did this sensor once again thank you very much

  44. Prashant Saraswat

    i am using emitter ehich has 3 legs ie sm0038 tehn what will be its connection with emmiter plse tll me

  45. Thank you buddy. I am new bee to electronics(just got interest on it). I was trying this sensor thing since last 30days(may be I am poor at google too). Now I am successful with this post. Thank you very much.

    • Omkar

      hey … thank you … it feels really nice to hear that :)

  46. Amruth

    Hi i would like to activate a LED when the IR detects something, how do i do it should i connect the vout to the -ve of the LED and the +ve of the LED to VCC. Will this work if not plz tell me how to do this abd can u give me the circuit for the 5 IR thing. Thx and eagerly waiting for an answer.

  47. ronak

    i am using 5mm ir couple. Not getting variation. please suggest resistor values.

    • Omkar

      What resistor value you are using ?

      • ronak gupta

        330 ohms for transmitor nd 10k for receiver circuits resp

        • Omkar

          increase 10K to 22K or 47K to get more variation. If you need more detection distance (say 4-8 cm), reduce transmitter resistance to 220 Ohm or 180 Ohm.

  48. Mohd Azam

    I have to measure the distance using this IR sensor module.how can i do it???plz reply…

  49. sreekanth

    can I use this for gigabyte ga6iwfe motherbord IR TX RX header?
    if yes how can I use please help
    I have four pins on IR header (VCC, IRRX, GND, IRTX)

  50. rajakumar

    i need to find the distance using ir sensor………
    can u tel me how can be made possibe using the above circuits……..

    • anulipt

      rajkumar i have an idea to do this is that you have to use the microcontroller or the microcontroller developing software like arduino if you need more help please mail me anulipt4u@gmail.com

  51. Ahmedo bedo bedo

    Dude, you rock. this is well explained.

    i just needed your help in something else. i want to make an ir circuit (or whatever it is called) to send only an sos signal. how do i go about it?

    i’m sorry but i have no idea how to make such circuit.

  52. lakshmi

    hey hi….i and my frnd are doing a simple project on elevator….we are using ir beam sensors for detecting the persson entering into the lift…so that wen the beam get abstracted imoles oerson entered the lift…my ques is can i use above mentioned sensor for this task…is it helpful…because i need to connect two sensors…one inside the lift other outside…pls help me asap….

    • Rakeshlal

      This sensor will not reflect from a black body when it is brought in front of a black body the reflecting angle reduces and will be impossible for the detector to detect it. Better to go for a Proximity sensor or an inductive infrared sensor.

  53. Gary Pride

    Hi an you tell me what the E behind 470 means Thanks

    • anulipt

      simply it is resistance only mean ohm

  54. i have a heavy equipment,,,but the machine havn’t port for check the rpm engine..as note the engine have speed sensor signal at flywheel housing with 2 pin….i have tool kit tachometer with infraredsignal..how i can modified?????
    please your respon to my email.
    Thanks alot
    Best regards

  55. bijanfazeli

    how can i make distance measuring sensor?what kind of technology is used and which is better?

    • Omkar

      Use GP2D12 sensors

      • Nathan Kops

        Omkar, would these sensor be able to give me the actual distance measurements?

        • Omkar

          Nope. Not this one. You will need sharp IR ranging modules.

  56. alfarisi

    can u provide me an array of this line sensor?

    i need to ask something, is that 50k must have for each array of module?

    • Omkar

      No, 50K is not must have. You can change it to any suitable value between 10K to 50K. I can provide you as many sensors as you want, then you can mount them in array fashion.

      • alfarisi

        can u give me the array circuit for this sensor?

        • alfarisi

          for 5 sensor..

          • Omkar

            Drop me a mail on the email address mentioned on “Products” page.

  57. Omkar

    What is this ? Don’t spam the blog. You can write you email address while posting the comments and then I can reply directly to your email ID.

  58. harry

    i have used these leds with LM 358
    in a object detection system
    but the range is so less
    is there any other way to get increased range with little modifications
    of low cost
    and low set up coz i need a simple small one like the one u showed above.
    pls reply!!!!!!!!!!!!!

    • Visakh

      Use a TSOP…..u ll get a range of about 5 ft min

      • philippe florent

        i tested and it gives like 5cm range, not detecting further nor closer

        • Omkar

          5cm range ? What voltage levels are you getting ?

  59. harry

    dis article is quite explanative
    but i have a doubt
    what is the detection range of these led’s????
    please reply!!!!!!!!!

  60. Saqib Khan

    Thanks a lot…explained in a very easy to understand language and with images wherever necessary. Brilliant work.

  61. Priynka

    thanks a lot…..It works..:)

  62. afnan

    great ckt normally such qs are just asked & der are no ans thanks

  63. techno12

    I am making a gun controller out of joystick for my pc.Can any one
    tell me how to use this sensor on it.I will play FPS with it.Can anyone tell me how to use a sensor or webcam to change sides like we do with a mouse

  64. pavan

    I have got RX LED in which its two leads are of equal size and the diode is black colored..Now how to identify the anode and cathode of RX led(Receiver).

    • Omkar

      Use the diode tester on digital multimeter. Connect it to diode tester in either of the ways. For which ever way it shows some reading, that is the correct configuration. In that case, lead connected to COMMON terminal of multimeter is cathode.

  65. Bhupi

    thanks a lot……. was doing failed attempts in making sensor from last two weeks……
    now the work has been completed………

    • Omkar

      nice to hear that … congrats :)

  66. Tam

    very useful.Thanx

  67. Thanks for your info! It helped me.

  68. roy

    can i know…. what transistor code that math with ZVNL110A? i cannot find this code component in my country…. it doesnt exist… maybe with a same function to work with 4013B IC..

  69. mehak

    Please somebody can suggest me:

    I am using reflective sensor and emitter of this connected with 220 ohm resistance and detector (transistor) with 10k resistance but it showing me value 0.9 volt rather than 0 volt when placed near reflective surface.How i can get 0 volt rather than 0.9 volt.

  70. akshay

    hey..one more thing.this may sound silly..
    can anybody tell me difference between 470e 1/4 watt and normal 470 ohm ressistor..

    please respond asap

    thanx in advance

    • Omkar

      ‘normal’ 470Ohm, is itself ‘1/4 W’ resistor.

  71. akshay

    hey, hi omkar.we tried ur module.using the led type ir rx,tx..we however reduced the resistance value from 470e to 220e.

    now the voltage observed at the receiver is dependant on the surrounding light..and not on the corresponding transmitter.
    The voltage obsered at the receiver is in the range of 1 to 0.8 v when tubelight is on
    and when off its 0.08 to 0.07
    can u explain this.

    ok..now we have series of questions
    1.ir tx,rx should efficiently detect obstruction(a gud voltage difference)
    how do we do that so that a microc ontroller will detect i t??????

    2.any other sensor modules to be used ..i have tsop 1738…can we use this for identifying obstruction between tx,rx

    awaiting your experience

    thanx a lot for ur patience

    • akshay

      can u please answer the qestions of fowllowing post

      hey, hi omkar.we tried ur module.using the led type ir rx,tx..we however reduced the resistance value from 470e to 220e.

      now the voltage observed at the receiver is dependant on the surrounding light..and not on the corresponding transmitter.
      The voltage obsered at the receiver is in the range of 1 to 0.8 v when tubelight is on
      and when off its 0.08 to 0.07
      can u explain this.

      1.ir tx,rx should efficiently detect obstruction(a gud voltage difference)
      how do we do that so that a microc ontroller will detect i t??????

      2.any other sensor modules to be used ..i have tsop 1738…can we use this for identifying obstruction between tx,rx

      awaiting your experience

      thanx a lot for ur patience

    • Omkar

      reducing the 470E res to 220E resistor will increase forward current of the TX and result in more intense output radiation. Which should help you to get more voltage difference at the RX. Secondly, output of the RX will indeed depend on the ambient lightning and it is unavoidable. If you want to avoid the effect of ambient light, you will have to use TSOP1738 sensor. Circuit shown on this page will not work with TSOP.

  72. akshay

    this is jus amazing..i found many new intresting things…
    your blog does much more than my guide

    thanx a lot

    keep the gud work

  73. akshay

    i am a beginner..working on a ir tx,rx based mini project…

    i have read the posts earlier..
    1.how to identify ir tx and ir rx with mobile phone cam??
    2.i have with me the led type ir tx and rx…can they be used for detecting an obstacle?
    3.If so..what is the maximum allowed distance between the tx and rx
    4.I am building jus a prototype model…with toy cars..

    • akshay

      With refrence to the post by soma verma..my case is almost the same..i want my ir to notify me when there is a obstacle,

      can i use the ir led type for this?

      • akshay

        ok…i read the posts below..i found the answer to identification of tx-rx

        • akshay

          there is one more thing that i dint understand about the sensor module..

          the receiver and transmitter are kept so close in the picture


          hw do u use it if the distance is 1o cm apart …i mean for the prototype i am using

          I need the info asap..

          thanx a lot..

          love ur blog

          • Omkar

            Use the heat-shrinkable tube to wrap TX RX LEDs. If u can’t get it, then simply wrap them with any opaque material.

          • akshay

            thanx for your earnest reply.
            led type tx,rx for obstruction
            is not satisfying.i now plan to use tsop 1738..howevr am not able to get it,i have a tsop 1556 with me..can it be used instead..

            i wud be very grateful if you could guide me with its interface with 89c51..
            (a web link will be more than enough)

            thanx once again

            akshay joshi

          • Omkar

            Refer to TSOP’s datasheet. Various TSOPs differ by their operating frequencies. For example for TSOP1738, you will have to use 38KHz IR signal. Plenty of resources are available on the web showing TSOP-uC interface. Just google it.

          • akshay


            I want to know what is meant by burst length and how to realise it practically
            2. how do u actual send those burst ?????

            thanx for u r patience

            awaiting your experience


          • akshay

            omkar..need help for a 56 khz ir tx modulator circuit..

            and corresponding receiver circuit

  74. Using a capcitor did not work for me. I made a simple potential divider with the reverse biased rx. I used a 10 pot, but i didnt check the value at which i was using it. And the transmitter in series with 470 ohm resistor. Both provided 5V

  75. poorna prasads


  76. poorna prasads


  77. Kuthsav

    Can any one help me with obstacle sensors?????
    I need complete circuit schematic. I want to use TSOP. And I dint understand that TSOP gives Digital output. If it is giving either 1 or 0 how can it help in finding small distances???? Is there any circuit to get analog output???? Can we adjust its range.???If yes How????

    • Omkar

      You cannot use TSOP for finding the distance. If you want to do so then you will have to use Sharp’s GP2D12 infrared ranging modules.

      • Kuthsav

        Can you give me some circuit diagram of sensor for obstacle avoidance robot that uses TSOP1738.


  78. roshan

    Very helpful! Thanks for the good tips.

  79. yagnesh

    please tell how can i use this circuit for ,
    i live in flat & when my papa’s scooter come i want to acknoledge by the electronic signal in the home,i can arrange receiver led at my gallary which is 5 meter above the gate of enterance,
    please help me on this omi….

  80. Soma varma

    IF there is any mass/content is in between the ir emiter and ir reciever, it shud not detect each other..If no mass/content it shud detect and notify. and also the distance between the ir tx and ir rx shud be atleast 30cm range in my case.

    what IR tx and rx i shud use?

    Thanks in advance..

    • Omkar

      make TSOP1738 based sensor. The kind of sensor presented on this page will not work.

      • Kuthsav

        I came to this page while I was searching for the same circuit.
        Sir I would like to know if the resistor and capacitor changes if we r using TSOP17..????


        • Omkar

          TSOP’s output is digital and hence no RC ckt is required.

          Have a nice time … :) – OmkarCK

          • Kuthsav

            And If I want to use TSOP I should generate 38Khz waveform Right……
            Can you give me any link or circuit diagram for the transmitter circuit???

            Thanks in advance

        • Kuthsav

          I also have another doubt. Can we use this IR circuits circuit for tracking lines?????
          Am a beginner so, also need circuits for line follower, light follower and obstacle avoider.

  81. renegadex

    how do i modify your circuitry to be able to do this…
    be able to detect if a piece of paper is inbetween the ir emiter and ir reciever. if a piece of paper is in between then an led light turn on and if there is no paper, the led light will turn off.

  82. Writwick

    Hey friends i found a software to identify the resistance using the color bands on the resistor………
    To download this,
    Simply click on the link:Resistorcolor code

  83. raja

    at what distance the sensors must be placed from the reflecting surface. please tell the maximum and minimum distance between the sensors and the reflecting surface

    • Omkar

      For the sensors which are described on this page, minimum distance is around 1.5cm and maximum distance is around 4cm. If you want to increase the max distance to 8-10 cm, reduce the value of 470E resistance to 220E.

  84. Jitu

    very simple & easy way to make IR sensor
    I have connected 390E instead of 470E & 100K instead of 50k & ignore the capacitor.
    it is working good & giving 5v o/p when open ckt but when i give this 5v to 8051 (p89v51rd2, port 1) o/p voltage drop to 0 V.
    Do u have any solution?

    • Omkar

      put the comparator circuit in between before giving to the microcontroller. you can use LM393 for this purpose.

  85. Writwick

    Hi there,
    I have some stupid questions to ask!
    1. how to identify a 470e resistor?
    2. how to identify a IR-TX?
    3. how to identify a IR-RX?
    4. Can I use a cardboard instead of a blank PCB?
    Please answer them as soon as you can>……….

    • nandini

      1. use a multimeter
      2.black is receiver (usually)
      3. transparent is transmitter (usually)
      4. no you cant

      • arun

        can I measure the distance between the object and sensor.

  86. Writwick

    Hi there,
    I have some stupid questions to ask!
    1. how to identify a 470e resistor?
    2. how to identify a IR-TX?
    3. how to identify a IR-RX?
    4. Can I use a cardboard instead of a blank PCB?

    • Omkar

      1) 470E resistor – use Digital multimeter 2,3) How to identify a IR-TX/RX – Use mobile phone’s camera to see IR radiation 4) Cardboard cannot be used instead of PCB

  87. Hi every one…

    I was confused by my friend regarding the differences between…..these three

    1. IR Rx
    2. Photo Diode Rx
    3. LDR

    Can anyone make me clear? plz…

    and one more doubt…
    just i need to glow a LED when ever there is a obstacle!

    I wanna detect obstacle using 3 or 4 below,

    3.IR Tx and Rx
    4.IR Tx and Tsop

    plz give me some links for the circuit to my questions 3 and 4.

  88. darkenergy

    if we modulate the ir radiation say at 37khz, then how do we design the reception circuitry to get an analog output. TSOP give a digital output…can’t measure distance?

    • Well, its pretty simple. The TSOP-1738 for example only accepts light modulated at 38 KHz. Beyond that, its just your average photodiode. It gives the intesnsity of light falling on it. To measure distance, you need to fire a single pulse of light, count the number of clock cycles elapsed until it comes back and multiply it by the speed of light to get the distance. Sounds simple doesn’t it?

      lolz, it doesn’t work since light travels way way too fast for even a 16Mhz clock. For a distance of 10m, it takes 0.33X10E-7. You need a clock much faster than that. Plus even if you did, the resolution will be so small that you can’t o much. Fine it can measure maybe 10-20m distance, but not a meter or two, do the calc, divide 10 by 3 X 10E8 and 12 by 3 X 10E8. your average 8 bit microcontroller can’t even tell the difference between them. Also remember, that the distances you’ll need will be of centimeter dimensions, not meter. So hell forger about it. If you had to measure KM, you could use this technique, but then ordinary IR doesn’t remain coherent for that long, anyways

      So if you must judge distance, you can use an Ultrasonic thing, available over the internet fr a thousand or so bucks. That’s what bats do!

  89. ultimateremedy


    Thanks for contributing well-illustrated page. It really helped me. Keep it up.

  90. gopal

    can we use this circuit to distinguish between glass and plastic surface depending on the reflectance of the surface ??:(

    • nope its not practical to do that, if both of them are transparent.

    • gopal

      can u suggest a sensor that idetify between glass and plastic accurately

      • hmmm…on a second thought, glass is opaque to IR, so maybe you could use that property….I am not sure about plastic, you will have to test that out. Again this is all theoretical.
        i may be wrong….

        • Omkar

          General glass is not opaque to IR. Plastic may be opaque, but I am not sure.

  91. VIJAY

    does any company gives you the free samples of high speed IR emitters ?? plz reply …..

  92. vineet

    i want to prepare the obstacle deteection robot using ir sensors so after preparing the ir sensor module how can i proceed

  93. Mike

    Can you talk a bid about extending the range of this sensor? If I want to increase the sensor to a useful range like one used by the auto urine flusher, paper disposal, …, what do I need to do? It’s very hard to find finish module for this purpose so I am thinking about building it. The problem is getting it to sense more than a few mm away. For any practical purpose, you will need about 30-50mm range.

    • Omi

      For increasing the range you can use narrow beam width LEDs and also you can reduce the value of series resistance used with TX to 100E.

      • Ameya

        1.For increasing the range you can use narrow beam width LEDs….can u explain how??
        2. also you can reduce the value of series resistance used with TX to 100E……By doing this what is the max range that we can obtain??

        • Omi

          – If you use narrow beam width LEDs, IR radiation will be constrained in small area and hence can provide larger range. See the LED SFH4501. – I cann’t comment on the exact maximum range that you can obtain, it seems you can obtain upto 10-15 cms. You will have to check it manually.

  94. ellyelin

    hi omi,
    i need to make a barcode reader(sensor). is it the circuit is still the same? and if it the same, is that anything that i need to add? and how the whole circuit until it connect the MCU?
    hope to get the answer ASAP.TQ so much.

  95. ellyelin

    hi omi,
    i want to make a barcode reader(sensor). is it the circuit still the same? and how i want to make the connection make it perfect until the circuit connect to the MCU?
    hope can get your explaination. TQ.

    • Omi

      Bar code reader cannot be made from this circuit.

      • ellyelin

        so,can you show me the sketch of bar code reader circuit..

    • Henry Best

      I too want a barcode reader but not to read a standard barcode. As I only want to distinguish between <32 different items (5 bits) I plan on printing my own barcodes (black on white) and using 5 IR detectors to detect each bit. The thickness of the barcode lines can be upto 2.5 Cm. Distance between the barcode and the IR detectors will be 1 to 2 Cm. The barcodes will be passing over the detectors quite slowly. My problem is how to tell WHEN to read the detector's output as the barcodes will be stuck on a black or coloured plastic item and also, if I'll need more than one transmitter.

  96. simba

    Hi..can anyone say if IR sensors can be used to measure linear displacements?

  97. jobi

    can your IR circuit can be use for plethysmography?

  98. Hi! I was surfing and found your blog post… nice! I love your blog. :) Cheers! Sandra. R.

  99. jawad

    hello omi
    kindly tell me how to write code for ir sensor in C language… i have to work on ir counter sensor using atmega32…. with ir counter sensor i have co count people come inside room and go outside the room.. help me to write code in C language…

    • I am not much of an expert, but you might want to consider not using an IR sensor, and use a trip detector instead. Basic Principle: One module emits a laser, which falls on another module with photo diode. When he light is cutoff, it flags the entry, there should be two sets of transmitters. If the outside one is triggered first and the inside one later, the person is coming inside. If the inside one is triggered first, he’s going outside. It can actually be made completely without a microprocessor, with counters and some state logic

      • Omi

        Yes, that’s possible. It might be bit expensive though.

        • but i think its pretty much the only way. I’ve been thinking bout trying this one as part of energy conservation project. you know when there are zzero people in the room, the lights automatically go off

          • Omkar

            Ok … are you implementing that project ?

          • I am thinking of startin with it as soon as these exams of mine are over.

  100. J

    Hi Omi, for the frequency to the ir leds in the transmitter and receiver of the automatic room controller, is it calculated using (f=1/2*pi*r*c), which is roughly equals to 7.2 kHz? Thanks.

    • Omi

      Sorry, I didn’t get your question.

      • jawad

        hello omi
        kindly tell me how to write code for ir sensor in C language… i have to work on ir counter sensor using atmega32…. with ir counter sensor i have co count people come inside room and go outside the room.. help me to write code in C language…

        • please,tell me how i can increase the intensity of ir sensor about 8cm to 10cm as soon as possible?

    • J

      I mean how did you get the values for the resistance and capacitors?
      is it using the formula f=1/2*pi*r*c?

  101. tengku

    hi,i hv a few simple questions..i hope u can email me the answers
    1)what is DDM?
    2)what is the 50K preset?its function?

    thats all,thanks =)

    • Omi

      1)It is not DDM. It is DMM (Digital Multimeter)
      2)50K preset is used as a voltage divider.

      • tengku

        again,simple questions to ask you.
        1)the 50k preset hv 3 legs,how to determine which leg to connect with gnd,Vout,and the 47n and the 470R?

        thats all,thanks again..plese help me,or i’ll gv up..lol

        • Omi

          – Generally, central leg will be the variable terminal of preset. This is the Vout. – either of the extreme legs can be connected to Gnd and remaining extreme other leg should be connected to junction of IR-RX and 47n cap.

          • Tengku

            me again,sorry..
            ok,then i’ve measured the Vout,only 6.8mV..is it correct or not?what cn i do with 6.8mV? this voltage cant even turn on a LED..or should i email to u my cct connection so u can check?

  102. Atul Undre

    In order to interface this with MCU, MCU must have an ADC! am I right ?

    We can add extra OPAMP configured as Schmitt Trigger to it.

    Plz provide a tutorial for that too, That will be helpful to robotics geeks…..
    ….. Keep doing all these good work :)
    ….All the best!

    • Omi

      Yes, you are right. OPAMP can be used in Schmitt trigger configuration. Infact I used to do the same thing initially, but it makes robot’s circuit unnecessarily complex and prone to more assembly errors.

  103. naman

    will only 47n capacitor work or i can use some in range of pf also???

    • Omi

      47nf to 220nf is recommended. If you set the movable arm of potential divider to the topmost location point and assume resistance of IR receiver to be constant and input impedance of ADC to be infinite, then 47nf and 50K resistor forms LPF with the cut-off frequency of 67Hz (f = 1/(2*pi*R*C)). So that high frequency noise flickers will be eliminated. If you reduce the value cut-off frequency will increase and intern noise will increase. However if you want to capture voltage variations in short time frame (like few microseconds) then reduce the C value to 150pf. With this value cut-off frequency will be 20KHz.

      • naman

        thanks really helpful……….:)
        Keep up the good work !!!!!!!

  104. J

    Hi, I’m working on a project for Automatic room light controller with visitor counter. Can I use this sensor to detect the visitor entering a room? Many thanks.

    • Omi

      Yes you can use it in your project, as long as project is personal and non-commercial.

  105. akshay

    hi omi,
    how to make line tracer with single ir sensor?

  106. akshay n


  107. akshay

    excellent work

  108. james

    can any one tell how to make a optical sensor which is capable of measuring various soil properties like conductivity,salinity,pH,moisture content etc…

  109. Can any1 please tell me the reason 4 using 470E resistor,47nF capacitor,etc.
    i mean can i replace them?
    will it work???

    • Chanchal singh

      you may also go through simplier way i.e using LM358N ic…
      it will surely be the easier way to have your own IR sensor

      • Omi

        Yes, that is also another way. However it makes circuit board unnecessarily complex. Hence generally I prefer to use on chip ADC and some lines of C code, to carry out OPAMP functionality (i.e. Comparator) in software.

    • Omi

      Reason for using 470E resistor : It is used as current limiter, so that IR LED won’t get blown off. You can reduce the value of this resistor to get more IR radiation and thus longer object detection range and vice versa. If you remove 470E resistor, your IR LED will get burned immediately.

      47nF cap : Generally when sensors are mounted on robot, their output doesn’t remain stable. This is due to mechanical vibrations/movements in robots. This give rise to flickery signal which may indicate presence of the silver strip, even though sensor is not on the strip. To smooth out these unwanted flickers (noises) , 47nF capacitor is used.

  110. Ajay

    Thanks for the great information. I was searching for this. I am building a micromouse and i am a new to sensors. Can i use these sensors to detect walls for micromouse. I saw many other sensors which use some timing ICs. I am confused whether i can use this sensor for micromouse. I have ADC support in my development board.

    • Omi

      Yes, you can definitely use these sensors for that purpose. Only thing is you will have to take care about ambient IR radiation by properly enclosing the sensor.

  111. dhaval

    what a top class demostration.
    this kind of knowledge of you,make the all problems solved.
    hear i have question.
    please expain how the IR Rx works and why u connect it in reversed bais?

    • Omi

      Please read the “Principal” para again.

      Have a nice time … :) – elecrom

  112. korben

    hi omi
    thank for ur sharing.
    & i do construc the circuit which show in the wedpage.
    just that when i connect the led to V out the led is on but it is dim condition.
    2. can i know how to meansure the distance for the ir sensor can feedback.coz my didnt got any feedback but if i point the Tx to Rx it work well.
    i use the 5mm ir.

    pls give me some comment.

    • Omi

      Can you explain once again properly. I didn’t get what you want to do. By the way, these type of sensors cannot be used to measure a distance. They can detect only whether object is present or not or … amount of incident IR radiation, which can be used to infer the presence of an object.

      • korben

        thank for ur infomation.

      • Priynka

        Is there any way to find the distance using ir sensor or any other cheap alternative

        • Omkar

          nope … you will have to use SHARP’s GP2D12 or similar sensors.

  113. Mohit Luthra

    Hey thanku for these wonderful demos and if anybody has any new ideas of project then he can contect me at my e-mail id….

  114. adam

    how can you make car reverse parking sensor thanks

    • Omi


      Can you please elaborate on that … what exactly you want to make ?

      – elecrOm

  115. isuru

    it’s very use full.thanks

  116. Thanx, that was very nice….

  117. Sumit

    Hi Omi,
    Great work and demonstration. I found what I was looking for.

  118. Omi

    You cannot control DC motor directly using this circuit. You have to connect comparator and motor driver for that.

  119. tejaswi

    if u have got images related to the topic u can mail me at tejaswi91@yahoo.com
    Tell me also to controll this circuit using parallel port.
    Any websites plz recomend

  120. tejaswi

    can any one tell me the way to connect the above circuit with a 12V DC geared motor I tried it but it doesnt work.I am trying to use the sensor to detect the object and stopp the motors corespondigly?

  121. Will give product numbers/details for IR transmitter receiver module(non modulated)for data reading at a close proximity (Bar code reader type)?

  122. rajeev

    good circuit idea.I am looking for a detector circut which can detect moving as well as stationary objects. view angle 120 and distance for detection is 2-3 mtrs.

  123. GOURI

    hi omi,
    i am making a autonomous robot.. which requires Ultrasonic sensors..
    but its too costly,so its not fitting my budget… so my next option is IR sensors..
    But in my project sensors are directly connected to uc ATmega 32…
    so can i use this??..

    • Omi

      Generally ultrasonic sensors are used for ranging and obstacle detection. If that is the case, then these sensors are not suitable for that. These sensors are used for detecting surface with contrasting colors, like black and white.

  124. madhav mahuli

    hi Omi,

    i am doing a project on automatic control of lights and AC of a room.i am using an IR sensor to detect whether the user car is passed the parking gate. if the user car has passed through the IR sensor then it should send interrupt to the micro-controller and respective control should be turned on.if possible pls can you help me in the designing the circuit diagram of the project



  125. novrian

    To repaired one part of sensor
    Can infra red lamp be remove with other type of sensor use ?

  126. Vincent

    Thank You! This is a very helpful guide, with lots of detail!
    Came to this page via google, leaving this page with your blog bookmarked!

  127. sonu

    wat is da difference between 5mm and 3mm led.
    wer did i hav to use 5mm instead of 3mm or vice-versa.

    • Omi

      15mm/10mm/5mm/3mm is the measurement of outer diameter of the LED. It indicates the size of the LED. Larger LED gives more light output. You should use the LED according to the application. For robotics, 3mm is better as it gives more accuracy than 5mm.

  128. Madhur

    Hey there ! … Great work! … Found exactly what i was searching for !!!
    Thank You :)

  129. Omi

    It is not possible with the type of IR sensors shown on this page. You will have to use thermopiles. I don’t have idea where you can get thermopiles.

  130. prachee

    hi omi
    can u plz tell me how can i built an ir sensor which can sence temperature difference???

  131. Omi

    use TSOP1738 and modulated IR transmitter to transmit 38K wave.

  132. Omi

    Yes its possible, please describe it in detail and I will be able to tell you how to do it. Light bulbs can be controlled using TRIACs

  133. bhanu

    hi omi

    i want to make a circuit of obstruction detection using ir(tx & rx), that a ir light goes and after reflection it is recieved by the rx, and give the o/p to uc for proper sound of buzzer………..

  134. k

    Hi Omi,

    Basically I would like to have lights turn on as the viewer walks through a hallway. The placement of the lights would correspond to the position of the viewer. I thought an IR sensor would be the easiest way to achieve this, but I need a brighter light than is emitted by one led. Is there an inexpensive way to connect a IR sensor to a regular light bulb?

  135. Omi

    temporary art installation ? What exactly you want to do ?

  136. k

    Hi Omi,

    Thanks for the tutorial! I was wondering if you could give me some advice? I’m working on a temporary art installation & I want to use IR to turn on more than one led simultaneously. What would be the easiest way to do this? ((Also I was hoping to keep it relatively inexpensive)) Any thoughts?

  137. Omi

    There are some sensors which can measure this type of distance with accuracy of 1mm. See this for more information :


  138. my requirement is i want to measure the hight of rount pipe pipe dia 3mm and max hight i want to measure 30mm and i want accureacy 1mm can i used this IR ? I need this sensore size very small is it posible ? 1mm or 2mm is it posible ?

  139. yashu

    hi om…

    i am still having problems…cud u help me in building a 38 khz IR transmitter and a corresponding reciever that latches properly…i am having a tough time

    pl. help me out

  140. hi

    it is very good

  141. yashu

    hey om,

    i thought we were suppose to tune it as u told 5ms burst with 10ms interval…also thats how the design is given in EFY…giving the output directly would it b feasible?? again we wud hav to tune it rite?


  142. Omi

    Yes it will work. What matters is the intensity of IR incident on the receiving sensor. If your receiving sensor is close enough it will work without any problem otherwise you will have to increase transmitter’s current so that it can emit more infra-red light. However watch out for maximum limit of the transmitter. Generally its from 50mA to 100mA for continuous current and 1A for very short pulses. For example, refer datasheet of SFH4501.

  143. mattioats


    If one were to separate the Tx and Rx LEDs (I plan to have the Tx on a glove) would the results be the same (voltage change as proximity changes)?

    Would anything else need to be considered in this case?

    Many thanks.

  144. Omi

    Why r u giving output of TSOP to IC74121 ? You can directly connect TSOP o/p to uC. There is the flaw in your code and thats why stepper is jerking. For smooth operation, keep stepper motor handling code in timer interrupt and configure the timer to run the stepper at desired speed. Keep TSOP pulse TX and RX code in main(). This code in main() can set/reset some global flag, say motStart. This flag you can use in your timer ISR to start and stop the motor. Psuedo code will be something like this …

    timer ISR()
    //Advance stepper by one step


    //AVR init

    //transmit IR pulse and check the TSOP output

    if(Object is detected)



  145. Omi


    1)How to check if IR led is TX or RX … as explained above … simply forward bias the LED with series resistance of 470Ohm. Use any digital camera and look at the LED on cam’s display. Camera’s can “See” infrared light. If it is really an LED, you will see it glowing through the cam. See photographs above.

    2)TSOP1738 needs modulated IR radiation. You need to transmit short time bursts(<50ms) of 38KHz signal through IR LED. Then only TSOP1738 output will go LOW(output is active LOW) after detection of 38KHz pulses.

  146. yashu

    i am using a transparent casing IR led and detecting its output with a tsop1738. i am confused whether led is TX or RX…also the output of tsop is fluctuating which is connected to a stepper motor. thus, it doesn’t give constant DC to Stepper motor, and motor runs with jerking motion…pls. help


  147. Omi

    Give 38KHz signal to IR LED and use TSOP1738 to receive it. TSOP1738 has internal filter which can detect only 38KHz signal. Ambient light + 38KHz IR signal becomes DC offset + 38KHz wave for TSOP sensor. Due to internal filter this DC(or any other frequencies which are not equal to 38K) gets filtered out and o/p of TSOP goes low(because it is active LOW) on detection of 38K signal. See datasheet of TSOP1738.

  148. Omi

    To send digital data you must modulate some carrier with your data and then demodulate it on receiving end. Simple way to do this is using TSOP1738. It is 38KHz receiver. You have to give 38KHz signal to IR LED (i.e.Tx). When TSOP1738 receives this signal its o/p goes low.

    You have to transmit digital data in the form of 38KHz pulses. For example, drive IR LED with 38KHz for representing 1 and do not drive it for representing 0 (similar to RS232 protocol). You can have some start bit kindda stuff which can be used to synchronize the receiver.

  149. shiv chandra kumar

    its such anice for the beginer like me.
    but i havite one querry.you have not mentioned about the effect of ambient light.
    please discuss the ways of modulation and fiteration in this sensor with required circuit diagram
    thank you

  150. David

    great presentation , but i have a few quistions that i will be glade if u can help me with:

    1. Can this sensor be used for sending digital data (stream of bits)?
    2. How can i enlarge the sending/receiving distance of the sensor ?(i saw the circuit with the
    4 leds) i want to know if there is another solution like using stronger components ?
    3. does the transmitting led interrupt the receiving led (the one on the same circuit) from
    getting the light from the distance sensor?(does the light that emits from the transmitting
    led is detected on the receiving led on the same circuit)?

    thanks :)

  151. Omi

    There is definite difference between IR TX and IR RX diodes. IR RX diode generates much more photoelectric current after being irradiated by IR light than IR LED. Current generated by IR LED is so small that you need separate OPAMP circuit to detect it properly, which unnecessarily complicates the things.

  152. mohamad

    good work but i think there is no different between ir leds Tx and RX they may be the same type and it will work

  153. nick

    Excellent presentation, contents and pictures and clear.

  154. jack

    Very helpful! Thanks for the good tips.

  155. how tv remote controls work? i know that most of them works with infrared but why those have a long range?
    and another quesrion: how we can send information or signals with this sensors? can you explain me this modulation? or give me a link on internet. thanks…

  156. ajay8706

    my email id is ajay8706@yahoo.com

  157. ajay8706

    pls mail me ,its necessary for me…………..

  158. ajay8706

    how a sensor emits ir rays ,pls explain

  159. Omi

    TO# Lee
    yes it might work. check input voltage requirements of that module. you can give a try.

  160. Lee

    I have a new product that requires an IR object detector that will turn on a motor when object is detected at 12 inches away and stay on until object is removed. Will this sensor work for this application?

  161. darkenergy

    the reverse biasing of ir rx,never knew! thanx.was using photodiodes

  162. elecrom

    What type of sensors ? What is the purpose and which assembler ? Please be specific.

  163. Fox

    i need help with my asignment. about sensors in a alarm system in combination with assembler. were given four sensors. two reicivers and two transivers. please help me with the schematic on how to put what were in the circuit. and it also work via printer port!!!

  164. elecrom

    You can increase the range by increasing number of IR tx, see one pic above which shows the module having 4 IR txs and 1 Rx.

    Also, range depends upon your threshold setting for comparator/ADC.

  165. riya

    first of all, thanx for such a helpful tutorial. but i get response only upto the distance of 5 cm…how can i increase the range of IR TX-RX?

  166. elecrom

    1)No, color of IR LED doesn’t matter.
    2)Values used are empirical. No specific formula as such. Say for example for IR tx LED to emit sufficient IR radiation, at least 5-6mA current should pass through it. 470E is sufficient for this purpose. If you want more IR, reduce this value to 220E.

    To generate sufficient voltage, a higher value is selected for IR Rx. Out of the experience I found that 47k pot works well.

  167. MenTaL

    Really very helpful for beginners like me. Thanx a lot.

    I’ve got a few doubts though:
    1) Does it matter if u choose a red/green/blue IR LED?
    2) How do u calculate the values of the resistors used?