299 Comments

  1. Deepak

    Hi am looking to use this IR sensor module to identify a position in space. I ave moving object in the space & my plan is to attach single or two emitters based on the requirement. he emitter will have different IR rays & similarly i will place 2 receivers 0.5m max away from the moving object. With this setup i am looking for the distance from the moving object to receiver. The output would be in the form of triangle formed from three points. one point from emitter & another two points from receiver. Suggest me the right sensor to make this setup and i also wish to know the limitation in getting the distance when the receiver is not so straight to emitter.

    Reply
  2. Rupam Chanda

    Hi, elecrom
    Could I charge mobile phone using IR LED? If yes kindly share the details of circuit because I am trying to build the same but unable to get sufficient voltage at receiver.
    Thanks.

    Reply
  3. Rupam Chanda

    Hi, elecrom
    Can I Charge mobile phone by using IR LED

    Reply
    • Elecrom

      That is not possible. As any energy emitted by an IR LED is far too low to capture and do any useful charging.

      Reply
      • Rupam Chanda

        But a company named Wi-Charge claimed that they developed a wireless charging technology, used IR to charge smartphone. How is it possible?

        Reply
  4. Tubeh

    “Sir.Can i using lm358 comparator ic…???

    Reply
    • Elecrom

      Yes, of course you can use LM358 as well.

      Reply

  5. Explained in a very good manner thanks for sharing an more wonderful information

    Reply
  6. harshit wandhare

    pls tell me how can i connect ir sensor to a dc motor to make a obstuction detecting robot…

    Reply
  7. swati

    can anybody explain me all the designing part?

    Reply

  8. 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

    Reply
    • Elecrom

      Hi,

      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.

      Reply
  9. 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.

    Reply

  10. 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.

    Reply
  11. Maria

    it is very informative for begginers

    Reply
  12. surya s

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

    Reply
  13. hiren

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

    Reply
  14. Gourav Singla

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

    Reply

  15. 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/

    Reply
  16. Anand

    Hello Elecrom,

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

    Regards
    Anand

    Reply
  17. 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?

    Reply
    • Elecrom

      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.

      Reply
  18. 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

    Reply
  19. shubham garg

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

    Reply
    • Elecrom

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

      Reply
  20. 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???????

    Reply
    • Elecrom

      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.

      Reply
    • ajaj Jamadar

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

      Reply

  21. 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?

    Reply
    • Elecrom

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

      Reply
  22. JbO

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

    Reply
    • Elecrom

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

      Reply
  23. 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 :)))))

    Reply
    • 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.

      Reply
  24. manjari

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

    Reply
  25. shekar

    schematic for 3 ir tx with 1 photodiode reverse gullwing.

    Reply
  26. Nandan

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

    Reply
    • Elecrom

      No, this will not give 5V output.

      Reply
      • 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!!

        Reply
  27. Tahami

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

    Reply
    • Elecrom

      470E means 470 Ohms.

      Reply
  28. sam

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

    Reply
  29. ranjit

    hi,
    i have a question .
    how can i choose the rating of resistance and capacitor?
    please reply me as soon as possible on my email [email protected]

    Reply
  30. arun

    Can I measure the distance between the object and the sensors

    Reply
    • ur well wisher

      keep the measurement tape n measure

      Reply
  31. 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!!!!

    Reply
  32. 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

    Reply
    • Elecrom

      Hi,

      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.

      Reply
  33. utkarsh

    its nicely explained….

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

    Reply
    • Elecrom

      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.

      Reply
  34. 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.

    Reply
    • ramireddy

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

      Reply
    • Elecrom

      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.

      Reply

  35. 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.

    Reply

  36. 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.

    Reply
  37. Rajat

    sir
    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…

    Reply
  38. 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..??

    Reply
  39. 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?

    Reply
    • sandeep

      good question i am also thinking it

      Reply
  40. 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.

    Regards,

    Ashok Srinivasan.

    Reply
    • Elecrom

      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.

      Reply
      • 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?

        Regards,

        Ashok Srinivasan.

        Reply
      • Srinivasan Ramachandran aka Ashok

        Hello Elecrom,

        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.

        Regards,

        Ashok Srinivasan.

        Reply
        • Srinivasan Ramachandran aka Ashok

          Elecrom,

          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 😉

          Regards,

          Ashok Srinivasan.

          Reply
      • Srinivasan Ramachandran aka Ashok

        Hello,

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

        Regards,

        Ashok Srinivasan.

        Reply
    • nasrin sharify

      hi
      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

      Reply

  41. 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

    Reply
  42. 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!

    Reply
  43. 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??

    Reply

  44. 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?

    Reply
    • 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.

      Reply
  45. PRITESH SRIVASTAVA

    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.

    Reply
  46. 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: [email protected]
    Thanks!
    -Mark Bradford

    Reply
  47. Benjamin Blumer

    Fantastic!

    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.

    Reply
  48. Bruno

    It’s amazing, very simple…

    Thank you very much!

    Reply
  49. 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

    Reply
  50. Prashant Saraswat

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

    Reply

  51. 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.

    Reply
    • Elecrom

      hey … thank you … it feels really nice to hear that 🙂

      Reply
  52. 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.

    Reply
  53. ronak

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

    Reply
    • Elecrom

      What resistor value you are using ?

      Reply
      • ronak gupta

        330 ohms for transmitor nd 10k for receiver circuits resp

        Reply
        • Elecrom

          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.

          Reply
  54. Mohd Azam

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

    Reply
  55. sreekanth

    hello
    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)

    Reply
    • Elecrom

      sorry. no idea.

      Reply
  56. rajakumar

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

    Reply
    • 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 [email protected]

      Reply
  57. 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.

    Reply
  58. 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….
    thanks

    Reply
    • 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.

      Reply
  59. Gary Pride

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

    Reply
    • anulipt

      simply it is resistance only mean ohm

      Reply

  60. 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

    Reply
  61. bijanfazeli

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

    Reply
    • Elecrom

      Use GP2D12 sensors

      Reply
      • Nathan Kops

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

        Reply
        • Elecrom

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

          Reply
  62. alfarisi

    hi..
    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?

    Reply
    • Elecrom

      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.

      Reply
      • alfarisi

        can u give me the array circuit for this sensor?

        Reply
        • alfarisi

          for 5 sensor..

          Reply
          • Elecrom

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

  63. Elecrom

    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.

    Reply

  64. 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!!!!!!!!!!!!!

    Reply
    • Visakh

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

      Reply
      • philippe florent

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

        Reply
        • Elecrom

          5cm range ? What voltage levels are you getting ?

          Reply
  65. harry

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

    Reply
    • Elecrom

      at the most 7-10cm.

      Reply
  66. Saqib Khan

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

    Reply
  67. Priynka

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

    Reply
  68. afnan

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

    Reply
  69. 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

    Reply
  70. 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).

    Reply
    • Elecrom

      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.

      Reply
      • pavan

        thank you sir

        Reply
  71. Bhupi

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

    Reply
    • Elecrom

      nice to hear that … congrats 🙂

      Reply
  72. Tam

    very useful.Thanx

    Reply

  73. Thanks for your info! It helped me.

    Reply
  74. 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..

    Reply
  75. 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.

    Reply
  76. 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

    Reply
    • Elecrom

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

      Reply
  77. 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

    Reply
    • 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

      Reply
    • Elecrom

      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.

      Reply
  78. 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

    Reply
  79. akshay

    hey..hi…
    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..

    Reply
    • akshay

      hey..
      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?

      Reply
      • akshay

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

        Reply
        • 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

          http://elecrom.files.wordpress.com/2008/02/ctest-irsen-testsetup.jpg

          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

          Reply
          • Elecrom

            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

            hey..hi..
            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

          • Elecrom

            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

            hi…omkar

            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

          • akshay

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

            and corresponding receiver circuit


  80. 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

    Reply
  81. poorna prasads

    MY CIRCUIT IS ELECTRONIC WATCH DOG
    HERE WE USING TSOP 1738IR SENSOR(RECEIVER) &IR LED THROUGH 555TIMER(38KHZ)
    HOW MUCH DISTANCE WE PLACE TXER & REXER
    IS TSOP WORKS PROPERLY

    Reply
  82. poorna prasads

    IS ANY PROBLEM WITH TSOP 1838 IR SENSOR

    Reply
  83. Kuthsav

    Hi,
    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????
    Thanks
    -Kuthsav

    Reply
    • Elecrom

      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.

      Reply
      • Kuthsav

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

        Thanks
        Kuthsav

        Reply
  84. roshan

    Very helpful! Thanks for the good tips.

    Reply
  85. yagnesh

    hi,
    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 elecrom….

    Reply
  86. Soma varma

    Hi!
    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..

    Reply
    • Elecrom

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

      Reply
      • 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..????

        Thanks
        Kuthsav

        Reply
        • Elecrom

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

          Have a nice time … 🙂 – ElecromCK

          Reply
          • 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

        • 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.

          Reply
  87. renegadex

    Hi!
    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.

    Reply
  88. 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

    Reply
  89. 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

    Reply
    • Elecrom

      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.

      Reply
  90. 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?

    Reply
    • Elecrom

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

      Reply
  91. 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>……….

    Reply
    • nandini

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

      Reply
      • arun

        can I measure the distance between the object and sensor.

        Reply
  92. 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?

    Reply
    • Elecrom

      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

      Reply
  93. Manicka Raja PL


    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.

    Reply
  94. 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?

    Reply

    • 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!

      Reply
  95. ultimateremedy

    hi

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

    Reply
  96. gopal

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

    Reply

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

      Reply
      • Elecrom

        yes, thats true.

        Reply
    • gopal

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

      Reply

      • 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….

        Reply
        • Elecrom

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

          Reply
  97. VIJAY

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

    Reply
  98. vineet

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

    Reply
  99. Mike

    Hello,
    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.
    Thanks,

    Reply
    • elecrom

      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.

      Reply
      • 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??

        Reply
        • elecrom

          – 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.

          Reply
  100. ellyelin

    hi elecrom,
    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.

    Reply
  101. ellyelin

    hi elecrom,
    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.

    Reply
    • elecrom

      Bar code reader cannot be made from this circuit.

      Reply
      • ellyelin

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

        Reply
    • 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.

      Reply
  102. simba

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

    Reply
  103. jobi

    can your IR circuit can be use for plethysmography?

    Reply
    • elecrom

      No, it cannot.

      Reply

  104. Hi! I was surfing and found your blog post… nice! I love your blog. 🙂 Cheers! Sandra. R.

    Reply
  105. jawad

    hello elecrom
    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…

    Reply

    • 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 celecromng 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

      Reply
      • elecrom

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

        Reply

        • 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

          Reply
          • Elecrom

            Ok … are you implementing that project ?


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

    • niranjan

      Same issue even i am having
      I thought putting 2 of them and giving conditions such as
      If ir1=1
      Wait ; ir2 =1 then count++ but it wont work

      Reply
      • Elecrom

        Can you describe your issue more clearly and in detail ?

        Reply
  106. J

    Hi elecrom, 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.

    Reply
    • elecrom

      Sorry, I didn’t get your question.

      Reply
      • jawad

        hello elecrom
        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…

        Reply

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

          Reply
    • 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?

      Reply
  107. 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 =)

    Reply
    • elecrom

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

      Reply
      • 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

        Reply
        • elecrom

          – 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.

          Reply
          • 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?

  108. 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!

    Reply
    • elecrom

      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.

      Reply
  109. naman

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

    Reply
    • elecrom

      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.

      Reply
      • naman

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

        Reply
  110. 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.

    Reply
    • elecrom

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

      Reply
  111. akshay

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

    Reply
  112. akshay n

    thnks

    Reply
  113. akshay

    excellent work

    Reply
  114. 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…

    Reply

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

    Reply
    • 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

      Reply
      • elecrom

        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.

        Reply
    • elecrom

      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.

      Reply
      • Neha

        Thanks elecrom….

        Reply
  116. 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.

    Reply
    • elecrom

      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.

      Reply
  117. 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?

    Reply
    • elecrom

      Please read the “Principal” para again.

      Have a nice time … 🙂 – elecrom

      Reply
  118. korben

    hi elecrom
    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.
    thank!

    Reply
    • elecrom

      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.

      Reply
      • korben

        thank for ur infomation.

        Reply
      • Priynka

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

        Reply
        • Elecrom

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

          Reply
  119. 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….

    Reply
  120. adam

    how can you make car reverse parking sensor thanks

    Reply
    • elecrom

      Hi,

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

      Regards,
      – elecrOm

      Reply
  121. isuru

    it’s very use full.thanks

    Reply

  122. Thanx, that was very nice….

    Reply
  123. Sumit

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

    Reply
  124. elecrom

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

    Reply
  125. tejaswi

    if u have got images related to the topic u can mail me at [email protected]
    Tell me also to controll this circuit using parallel port.
    Any websites plz recomend

    Reply
  126. 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?

    Reply

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

    Reply
  128. 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.

    Reply
  129. GOURI

    hi elecrom,
    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??..

    Reply
    • elecrom

      >>GOURI
      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.

      Reply
  130. madhav mahuli

    hi elecrom,

    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

    thanks

    Madhav

    Reply
  131. novrian

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

    Reply
  132. 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!

    Reply
  133. sonu

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

    Reply
    • elecrom

      >>Sonu
      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.

      Reply
  134. Madhur

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

    Reply
  135. elecrom

    >>Prachee
    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.

    Reply
  136. prachee

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

    Reply
  137. elecrom

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

    Reply
  138. elecrom

    >>K
    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

    Reply
  139. bhanu

    hi elecrom

    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………..

    Reply
  140. k

    Hi elecrom,

    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?
    k

    Reply
  141. elecrom

    >>K
    temporary art installation ? What exactly you want to do ?

    Reply
  142. k

    Hi elecrom,

    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?
    k

    Reply
  143. elecrom

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

    http://www.sharpsma.com/Page.aspx/americas/en/b25198ae-eeda-458b-a14f-92e2bd34f1c7/Distance_Measuring/

    Reply

  144. 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 ?

    Reply
  145. 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
    thanks

    Reply

  146. hi

    it is very good

    Reply
  147. 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?

    thanks

    Reply
  148. elecrom

    >>Mattioats
    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.

    Reply
  149. mattioats

    Hi,

    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.

    Reply
  150. elecrom

    >>Yashu,
    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()
    {
    if(motStart==1)
    {
    //Advance stepper by one step
    }
    }

    main()
    {

    //AVR init

    while(1)
    {
    //transmit IR pulse and check the TSOP output

    if(Object is detected)
    motStart=1;
    else
    motStart=0;

    };

    }

    Reply
  151. elecrom

    >>Yashu

    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.

    Reply
  152. yashu

    hi,
    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

    >>yashu

    Reply
  153. elecrom

    >>Shiv
    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.

    Reply
  154. elecrom

    >>David
    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.

    Reply
  155. 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

    Reply
  156. David

    Hi,
    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 🙂

    Reply
  157. elecrom

    >>Mohamad,
    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.

    Reply
  158. 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

    Reply
  159. nick

    Excellent presentation, contents and pictures and clear.
    Thanks.

    Reply
  160. jack

    Very helpful! Thanks for the good tips.

    Reply

  161. 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…

    Reply
  162. ajay8706

    my email id is [email protected]

    Reply
  163. ajay8706

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

    Reply
  164. ajay8706

    how a sensor emits ir rays ,pls explain

    Reply
  165. elecrom

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

    Reply
  166. 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?

    Reply
  167. darkenergy

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

    Reply
  168. elecrom

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

    Reply
  169. 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!!!

    Reply
  170. elecrom

    @Riya
    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.

    Reply
  171. 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?

    Reply
  172. elecrom

    @MenTaL
    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.

    Reply
  173. 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?

    Reply

Leave a Reply to Aditya Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.