Skip to content
DersTeders Log inSign up My panel

Light Detection with a Photodiode

Convert the current produced by a photodiode into voltage through a resistor and detect light.

Circuit diagram

Light Detection with a Photodiode — diagram of the arduino circuit built on a breadboard
Light Detection with a Photodiode circuit breadboard layout and connections.

Interactive circuit guide

Run the simulation, follow the build steps one by one and try it in our real app.

Real screenshot of our circuit simulator Stopped
Open in our app →

Step-by-step build

Open in simulator

You can open the same circuit in the browser-based circuit simulator without any installation and inspect the wires and components there.

Parts list

ComponentQtyDescription
Arduino Uno1Reads the photodiode voltage through the analog input.
5V reference connection1Supplies voltage to the sensing circuit.
10 kΩ resistor1Converts the photodiode current into voltage.
Photodiode1The component whose current increases with light.
Ground connection1The circuit's common 0V point.

Breadboard layout

The Arduino is on the left, the 5V supply at the top, the resistor and the photodiode in the same vertical column and the common ground at the lower right. The point where the resistor and the photodiode meet goes to Arduino pin 5.

Step-by-step build

  1. Place the Arduino Uno on the work area.
    Tip: The GND pin is index 0.
  2. Connect 5V to the first end of the 10 kΩ resistor.
    Tip: The resistor acts as the load that limits the current.
  3. Connect the other end of the resistor to the first end of the photodiode, and connect the same point to the analog input.
    Tip: Arduino pin 5 is used as the analog input.
  4. Connect the other end of the photodiode and the Arduino GND to common ground.
    Tip: The photodiode's orientation determines the sign of the measurement.
  5. Upload the code and change the light to watch the read value.
    Tip: A change in voltage should be observed as light increases.

How it works

When operated in reverse bias, a photodiode produces a current proportional to the light falling on it. Since on its own it behaves like a current source, this current must be passed through a resistor to be converted into voltage. The voltage across the resistor equals the photocurrent multiplied by the resistance value. This voltage is applied to the Arduino's analog input and converted into a number between 0 and 1023. As light increases, the current and therefore the read voltage rise; when the light is cut off, the value returns to its starting level. The photodiode's response time is shorter than that of an LDR.

What you will learn

  • Builds an interface that converts current into voltage.
  • Follows the photodiode's response to light with an analog input.
  • Understands the effect of the load resistor on the reading.

Expected result: As the light intensity changes, the value on the serial port related to the photodiode voltage changes.

Challenge

Light on/off detection: Compare the photodiode voltage with a threshold.

Goal: Different states appear on the serial port when the light is switched on and off.

Tips

  • The photodiode responds to light when connected in reverse direction.
  • Increasing the resistor value widens the readable voltage range.

Frequently asked questions

How does a photodiode differ from an LDR?

A photodiode behaves like a current source and has a shorter response time; an LDR is a component whose resistance changes.

Why is a resistor necessary?

The current produced by the photodiode is converted into voltage through a resistor; this voltage is read from the analog input.

Is the photodiode's orientation important?

In the template it is connected in reverse direction; the orientation determines the sign of the read voltage.

If you want to build this project in real life, you can get the parts from hobidevre.com. For more circuit ideas, visit the hobidevre.com blog.

Blog · Circuit simulator · KVKK Disclosure