How does a photodiode work? How can you include it in your projects?


A photodiode is a semiconductor component capable of capturing optical radiation and transforming it into an electrical signal.

There are two other types of light sensor:

  • the photoresistor, which is a resistor whose value changes according to the light it receives.
  • the phototransistor sensor, which plays the same role as the photodiode. However, the phototransistor is more sensitive than a photodiode, and therefore more precise.
    The photodiode can be used for projects that make use of light, such as a darkness detector that turns on an LED when darkness reaches a certain threshold, or a sun tracker for solar panels.

How does a photodiode work?

Like many electronic diodes, it consists of a PN junction. Three parts can be distinguished:

  • A depletion and diffusion zone
  • N-type doped region
  • P-type doped region.
    In the absence of polarization, it creates a voltage. When reverse-biased by an external supply, it creates a current.

These diodes are designed to operate under reverse-biased conditions, meaning that the P side of the photodiode is associated with the negative battery terminal, and the N side is connected to the positive battery terminal.

Photodiode symbol

The photodiode symbol corresponds to that of the diode, with two arrows pointing towards the diode to show that light enters it.

You’ll find the same arrows for the photoresistor, with a resistor in place of the diode.

You can see the reverse symbol with a diode, and the arrows pointing outwards with the LED, which emits light rather than capturing it.

The different types of photodiode

There are various types of photodiode available on the market. They’re all very similar, but there are a few differences, which we’ll explain in detail below. Here are the different types of photodiode:

A) PN photodiode

The first type of photodiode to be developed is the PN type. Compared with the other types, its performance is not very advanced, but it is currently used in a number of applications. This diode is quite small, but its sensitivity is not excellent compared with the others.

B) PIN photodiode

The PIN photodiode is the most widely used. This diode collects more light photons than the PN photodiode, because the large intrinsic area between the P and N regions allows more light to be collected.

C) Avalanche photodiode

This type of diode is used in low-light areas because of its high gain levels. It also generates high noise levels. This technology is therefore not suitable for all applications.

d) Schottky photodiode

The Schottky photodiode features a small diode junction, which means there is a small junction capacitance, so it operates at high speeds. This type of photodiode is frequently used in high-bandwidth optical communication systems such as fiber-optic links.

Read photodiode value

We’ll now look at the different ways of obtaining the value of a photodiode. First, we’ll look at how to measure the voltage across the photodiode on a voltmeter. The second method is to use the Arduino board with its analog terminals and serial monitor.

a) The voltmeter

By connecting the voltmeter in parallel, you can measure the voltage across the photodiode by shining a light on it:

int photodiode = A0;// Lq photodiode pin
int photodiode_value = 0; // The photodiode value

void setup() {
  Serial.begin(9600); // Serial monitor initialization
  pinMode(photodiode, INPUT); // We initialize the photodiode as an input to retrieve its values.
void loop() {
   photodiode_value = analogRead(photodiode); // Retrieve the photodiode measurement
   // Display the value on the serial monitor
   Serial.print("The voltage value is:");
   Serial.println(" mv");
   delay(300);// pause between each measurement