Skip to content
Home > Components > Sensors > Photodiode

Photodiode

A fast-acting semiconductor device that converts light into electrical current.

Component Preview

PhotodiodePhotodiode

Unlike a standard Photoresistor (LDR) which changes resistance, a Photodiode generates a small reverse current when exposed to light (often infrared or visible depending on the tint). It has a significantly faster response time than an LDR, making it suitable for optical communication and precise pulse detection.

SensorsLight

Overview

Photodiodes are directional, meaning they have an Anode and a Cathode. They are typically used in reverse-bias mode (cathode to positive voltage, anode to ground through a resistor), where the small leakage current increases proportionally with light intensity. The dark plastic casing helps filter out ambient visible light, often making it highly sensitive to infrared (IR).

Pin Reference

PinTypeDescription
AanalogAnode. The longer leg. Typically connected to an analog pin or ground.
CpowerCathode. The shorter leg (indicated by the flat edge on the package).

Configurable Attributes

AttributeTypeDefaultDescription
lightnumber0The simulated light level (0-100) hitting the sensor.

Wiring Diagram (Reverse Bias)

To measure the light, connect the Photodiode in reverse bias with a load resistor (e.g., 10kΩ).

  1. Connect Cathode (C) to Arduino 5V.
  2. Connect Anode (A) to Arduino A0.
  3. Connect a 10kΩ resistor from Anode (A) to GND.

Wiring Diagram

Example Arduino Code

cpp
const int sensorPin = A0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  // Read the voltage drop across the load resistor
  int sensorValue = analogRead(sensorPin);
  
  Serial.print("Light intensity reading: ");
  Serial.println(sensorValue);
  
  delay(100);
}

Simulation Notes

  • In the simulator, right-click the photodiode to open its context menu and adjust the light attribute.
  • As the simulated light level increases, a subtle glow appears on the internal silicon die.

Released under the MIT License.