There are many different IR sensor types, most of which rely on photodiodes. They range from single PIN diodes to arrays of sensors used in IR cameras. In the industrial and commercial devices, the diodes are either doped silicon, or gallium arsenide, very similar to LEDs, which can also be used as photodiodes.

IR scientific imaging, such as microscopy, astronomical telescopes, and satellites, may require detection of longer wavelengths. The detectors may be arrays of indium antimonide, antimony doped silicon, arsenic doped silicon, or gallium doped germanium. The arrays are typically very small at 16k to 64k pixels compared to visible light arrays, which typically have millions of pixels.

There are also IR detectors that are part of a functional module, such as the packaged IR remote control receivers, which put a photodiode, modulation frequency bandpass filter and amplifier in a single package. The modulation frequency is designed to match that of an IR transmitter in a remote control.

Silicon Photodiode

Silicon photodiodes are very common. They are used where low light levels must be measured. One place to find them is in IR detectors, where they act as the receiver of the infrared light and convert it to an electrical signal. Another place is in CCD cameras, where they act as the light sensitive pixels for the CCD array. Yet another is in the light meters used by photographers and photographic film processors.

Solar cells are large area photodiodes with high current capability. Their application is generally not as a sensor, but they are sensitive to the visible and infrared spectrum.

Photodiodes are not digital devices. They provide a current based on the number of photons penetrating the device's surface. This currernt may be used as is, amplified, and/or turned into a digital signal. Generally, IR is used in a digital domain - detecting the absence or presence of an object, although it may be used in the analog domain for heat sensors.

Digital IR Detectors

In this case, we want to use the diode to detect one of two states - absence or presence. To do this we just need to provide an IR signal from an emitter, and amplify the signal from the IR detector so that it is one logic state when an object is blocking the view of the emitter and the other state when the object is not blocking the view.

Making an IR diode digital.

In the diagram above, the photodiode conducts when no object it blocking the emitter. That current turns on the PNP transistor, pulling R3 high. When the emitter is blocked, the photodiode is not conducting enough to turn on the PNP transistor and the voltage remains at ground. The circuit uses the 276-0142 "Infrared Emitter and Detector" from Radio Shack. Be wary of these parts. The package describes the detector as a diode, and so does my meter. The Radio Shack website describes it as a phototransistor, complete with Vceo and Ic. It definitely isn't.

Once conditioned as above, the signal may be read directly using a digital input on the Arduino.

IR Remote Control PCM Detectors

IR photodiodes are used as sensors in IR remote control receivers. In this case, the signal is run through a bandpass filter to prevent interference by unmodulated signals, like the sun and people moving. Only the signal that is modulated on a carrier of (typically) 38kHz to 44kHz is amplified and passed through the detector.

Oscilloscope traces of IR remote control signals.

The image above shows two views of the same signal. The left trace shows the 40kHz carrier, as seen by a photodiode, and the right trace shows the complete received signal, also as seen by a photodiode.

Oscilloscope traces of modulated and demodulated IR remote control signals.

The above image shows the relationship between the modulated 40kHz carrier and the demodulated serial data it carried. The top trace is from a photodiode, and the bottom trace is the output of a TFMS5400. There is a slight delay between the two because of the 40kHz detector's response time.

The output of the TFMS5400, or any simlar IR receiver, may be read directly using a digital input on the Arduino.

PIR Sensor

There is a pyroelectric (heat to electricity) sensor called a Passive InfraRed (PIR) sensor. It is extremely sensitive to infrared radiation. It has two different uses. One is the sensing of heat for fire detection. The absolute value of the signal indicates temperature. It may be used in a hand-held thermometer gun, or a stationary heat detector. Some medical thermometers use this technology as well.

The other main use is the detection of motion. That is generally done with a Fresnel lens, which concentrates radiation from several different places onto two pyroelectric sensors. The two internal sensors are connected in one of two ways, depending on the sensor. The first, and most common way wires them in series with opposite polarity. As long as they both see the same signal, the output is null. The other way brings out both sensor outputs, running them through a differential amplifier. The second is less common now than it used to be.

PIR amplifier for digital or analog output.

The PIR device must be buffered by a low-noise, high-gain amplifier before being used. The schematic above is inspired by the datasheet for the D203S from PIR Sensor Co.,Ltd. In it's typical use as a motion detector, the circuit above provides a digital signal (marked "DIGITAL") indicating motion. As a heat detector, the last two amplifiers, which form a window comparator, would be left off, and the output from the second amp (marked "ANALOG") would be monitored by an analog input on the Arduino. Capacitors C4 and C5 would be replaced by jumpers, and the values of resistors R6 and R7 adjusted to get the desired offset.

Opto Couplers

Also called opto-isolators because they act to electrically isolate the input from the output. They are often found separating low voltage circuits from high voltage circuits. They contain an IR LED and a phototransistor. Turning on the LED also turns on the phototransistor. You can find them on many Arduino compatible relay boards. They prevent any high voltage on the output side from getting to, and likely destroying the Arduino.

Arduino Board Logo


Arduino-Board is the go-to source for information on many available Arduino and Arduino-like boards, tutorials and projects.

Help and Support


Stay updated

Sign up if you would like to receive our once monthly newsletter.