ADALM2000 Activity: An LED as a Light Sensor


The objective of this lab activity is to explore the use of the light emitting diode (LED) as a photodiode light sensor and the use of NPN and Darlington-connected NPN transistors as interface circuits for the light sensor.


When exposed to light, photodiodes produce a current that is directly proportional to the intensity of the light. This light-generated current flows in the opposite direction to the current in a normal diode or an LED. As more photons hit the photodiode, the current increases, causing a voltage across the diode. As the voltage across the diode increases, the linearity decreases.

In addition to emitting light, an LED can be used as a photodiode light sensor/detector. This capability may be used in a variety of applications including ambient light level sensor and bidirectional communications. As a photodiode, an LED is sensitive to wavelengths equal to or shorter than the predominant wavelength it emits. A green LED would be sensitive to blue light and to some green light, but not to yellow or red light. For example, a red LED will detect light emitted by a yellow LED and a yellow LED will detect light emitted by a green LED, but a green LED will not detect light emitted by a red or yellow LED. All three LEDs will detect white light or light from a blue LED. White light contains a blue light component that can be detected by the green LED. Recall that visible light wavelengths can be listed from longest wavelength to shortest wavelength as red, orange, yellow, green, blue, indigo, violet (remember the mnemonic ROYGBIV). Violet is the shortest wavelength light with the most energetic photons and red has the longest wavelength light with the least energetic photons of all the visible colors of light.

LEDs with clear plastic encapsulation will be more sensitive to broad-spectrum illumination (like general room lighting) than LEDs with colored encapsulation (such as those included in the ADALP2000 analog parts kit).

To use the LED as an optical detector, do not forward bias the LED into Quadrant 1 of the current-voltage (I-V) curve (Quadrant 1 is when the operating voltage and current are both positive). Allow the LED to operate in the solar cell mode, Quadrant 4 (operating voltage is positive, current is negative), or in the photodiode mode, Quadrant 3 (operating voltage is negative, current is negative). In the solar cell mode, no applied bias voltage is used. The solar cell (or LED in this case) generates its own current and voltage.


  • ADALM2000 Active Learning Module
  • Solderless breadboard
  • Jumper wires
  • Two 2N3904 NPN transistors (or SSM2212 NPN matched pair)
  • One 100 kΩ resistor
  • One 2.2 kΩ resistor
  • Three LEDs (multiple red, yellow, and green colors)
  • One infrared LED (QED-123)


On your solderless breadboard, construct the LED light sensor circuit as shown in Figure 1. Notice that the LED diode, D1, is reverse-biased, that is, opposite to how it would be connected as a light emitter. The photo-generated current will flow into Q1 as base current and will appear in the collector multiplied by the current gain, ß, of the transistor.

Figure 1. An LED and single common emitter NPN light sensor.

Hardware Setup

Use the variable positive power supply from the ADALM2000 module set to 5 V to power your circuit. Use Scope Channel 1 to monitor the voltage at the collector node of Q1.

Figure 2. An LED and single common emitter NPN light sensor breadboard circuit.


Insert a red, yellow, or green LED into the circuit as shown one at a time. Try exposing the three different color LEDs from your ADALP2000 analog parts kit to different light sources such as standard incandescent, fluorescent, and LED lights held at differing distances from the LED sensor. Observe the voltage waveform seen at the collector of Q1. Try inserting the infrared LED from your kit and observe how it responds to the light from the different sources. Try increasing the sensitivity or gain by increasing the value of RL to 200 kΩ or 470 kΩ.

Scopy plot examples are presented in figures 3, 4, and 5.

Figure 3. A red LED and single common emitter NPN light sensor–LED light at max distance.
Figure 4. A red LED and single common emitter NPN light sensor–LED light at medium distance.
Figure 5. A red LED and single common emitter NPN light sensor–LED light at min distance.

Step 2 Directions

Change the circuit on your breadboard to the Darlington configuration shown in Figure 6. Be sure to turn off the power supply before making any changes to the circuit. With the Darlington-connected transistors, the emitter current of Q2 becomes the base current of Q1 such that the photo-generated current from the LED D1 is now multiplied by ß2 and will appear in the load resistor RL from the collectors of Q1 and Q2. Because of this much higher current gain, we can use a much lower value load resistor.

Figure 6. An LED and Darlington-connected NPN light sensor.

Step 2 Hardware Setup

Breadboard connections are presented in Figure 7.

Figure 7. An LED and Darlington-connected light sensor breadboard circuit.

Step 2 Procedure

Repeat the same procedure of inserting the various LEDs into the circuit for D1 and measuring the response to the various light sources.

Scopy plot examples are presented in figures 8, 9, and 10.

Figure 8. A red LED and Darlington-connected light sensor–LED light max distance.
Figure 9. A red LED and Darlington-connected light sensor–LED light medium distance.
Figure 10. A red LED and Darlington-connected light sensor–LED light at min distance.


In order to act as an optical detector, in what modes should an LED operate? You can find the answer at the StudentZone blog.


Doug Mercer

Doug Mercer

Doug Mercer received his B.S.E.E. degree from Rensselaer Polytechnic Institute (RPI) in 1977. Since joining Analog Devices in 1977, he has contributed directly or indirectly to more than 30 data converter products and holds 13 patents. He was appointed to the position of ADI Fellow in 1995. In 2009, he transitioned from full-time work and has continued consulting at ADI as a fellow emeritus contributing to the Active Learning Program. In 2016, he was named engineer in residence within the ECSE department at RPI.

Antoniu Miclaus

Antoniu Miclaus

Antoniu Miclaus is a system applications engineer at Analog Devices, where he works on ADI academic programs, as well as embedded software for Circuits from the Lab®, QA automation, and process management. He started working at ADI in February 2017 in Cluj-Napoca, Romania. He currently holds an M.Sc. degree in software engineering from the Babes-Bolyai University and a B.Eng. degree in electronics and telecommunications from the Technical University of Cluj-Napoca.