Can I know how to change or connect from this circuit (three pin IR receiver) to two pin IR receiver because when I change the connection (3 pin to double pin), my arduino cannot receive the signal from transmitter.

I dont know because of my connection or because of there are different between tree and double pin IR receiver. Can anyone help me.

My code too long, so I just paste IR sensor for detect signal from transmitter.

  while(1)  //-------loop M1
      if(irrecv.decode(&results) >0 || digitalRead(SBB) == HIGH )
      // if IR receiver detect signal or button pressed
      {    //-------else "if(sensor 2)"
          //go back to else "if(sensor 1)" 
      }//-------else "if(sensor 2)" end
    }//-------while end

double pin

IR connection

  • What is the part number? It looks like an IR LED (transmitter) to me.
    – Nick Gammon
    Commented Aug 4, 2016 at 7:34
  • There are some two pin receivers at the cheaper end of the market. A part number would really help, but I suspect you haven't got one and can't find it. I can't find any diagrams and I can't test one at them moment so this is a guess. You need to leave out the red (vcc) wire from you diagram and connect the signal wire to +ve pin of the Receiver. If that doesn't work switch the connections over. Commented Aug 4, 2016 at 8:05
  • To use a plain phototransistor to detect remote control signal with an Arduino at meaningful range in real world conditions, you will need to add either a circuit or software to select only signals with the desired modulation from the noise. This is probably just barely possible with an Arduino's ADC, but will be a non-trivial project. Unless you really want to spend time learning about signal processing and writing optimized AVR code, better to just buy the usual 3-pin type with an internal demodulator. Commented Aug 4, 2016 at 17:58

2 Answers 2


From what you have described, i think you are getting confused between the function of the two types. The 3 leg style is designed to receive coded pulses from remote controls (TV,Video, etc) where as the 2 leg is typically used, but not limited to, IR switching, where a signal is generated when the light path between the sender and receiver is broken with an opaque blade or similar or a beam is reflected back from an object as it passes. So trying to use the same code for the two types is provably where you are having problems.

Two example of this are here this uses a reflected IR beam where as this slot sensor is the break a beam type, often used in a limit or timing situation. One half of this is similar to the 2 leg diode you show.

It just depends on what situation you are using it in as to which is appropriate.

Without seeing your code, this is about as far as i can go, post your code so the forum can view it and make suggestions.

  • I already put my code.
    – muhisma92
    Commented Aug 4, 2016 at 8:59

To expand on Doug's answer:

There are two types of IR receiver. The two-pin one you have is basically a photodiode with infra-red filter. When infra-red light hits it the transistor gets biased and turns on. This is the most basic type you can get and is very hard to work with for anything other than simple on-off signals.

The second type is the IR receiver module. This contains a photodiode as above, but also contains extra circuitry. It receives IR light on the photodiode and filters it through a band-pass filter. A remote control sends a sequence of pulses of light which itself is further made up of high frequency pulses (36KHz square wave, for example). It's this high frequency pulsing that is allowed through the band-pass filter. The internal circuitry then turns these pulses of high frequency square waves into pulses of ON or OFF signals by low-pass filtering them to remove the high frequency component.

This latter type of receiver is far easier to work with for sending of data or commands from (eg) a remote control. But it can't detect a steady-state IR signal. The modulation and filtering means that a much weaker signal can be extracted from the background IR light meaning much greater distances can be achieved using much weaker transmission LEDs.

So while it is possible to use the former type with an Arduino you have to realise that the software required to do all the filtering and detection, as well as the extra hardware required to interface it, makes them considerably harder to use. That is why almost everyone uses the three-pin versions that do all that for you.

One thing to note with the three-pin versions: they have to match the carrier frequency of the transmitter. So a 36KHz transmitter has to be paired with a 36KHz receiver. Otherwise it won't be able to detect the signal. Just like a radio - it has to be tuned to the right band.

  • 1
    Thanks for expanding Majenko, I am not that technically proficient. Doug
    – Doug
    Commented Aug 7, 2016 at 4:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.