Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Sensors & Modules

LDR Photoresistor vs Phototransistor: Light Sensing Compared for Arduino Projects

LDR Photoresistor vs Phototransistor: Light Sensing Compared for Arduino Projects

March 11, 2026 /Posted byJayesh Jain / 0

Choosing between an LDR (Light Dependent Resistor) photoresistor and a phototransistor is one of the most common dilemmas hobbyists and engineers face when designing light-sensing circuits. Both components detect light, but they differ fundamentally in speed, sensitivity, spectral response, and interfacing requirements. This comprehensive guide will help you make the right choice for your Arduino project, IoT device, or any embedded electronics application in India.

Table of Contents

  1. What is an LDR Photoresistor?
  2. What is a Phototransistor?
  3. Key Differences at a Glance
  4. Speed and Response Time
  5. Sensitivity and Accuracy
  6. Spectral Response and Wavelength
  7. Interfacing with Arduino
  8. Practical Circuit Examples
  9. Power Consumption
  10. Real-World Applications
  11. Which One Should You Choose?
  12. Frequently Asked Questions

What is an LDR Photoresistor?

An LDR (Light Dependent Resistor), also called a photoresistor or photocell, is a passive component whose resistance changes in response to incident light. In darkness, an LDR can have resistance values ranging from 1 MΩ up to several MΩ. When fully illuminated, this resistance drops dramatically — typically to 1–10 kΩ, depending on the specific part.

LDRs are made from semiconductor material — commonly cadmium sulfide (CdS) or cadmium selenide (CdSe) — although RoHS-compliant alternatives using other materials are becoming more popular. The operating principle is simple: photons knock electrons into the conduction band, generating charge carriers that reduce resistance. This is called the photoconductivity effect.

Because LDRs are purely resistive devices, they are very easy to use. You do not need to worry about polarity (they are non-polarised), and a simple voltage divider circuit is all you need to read light intensity with any microcontroller including Arduino, ESP32, or Raspberry Pi Pico.

What is a Phototransistor?

A phototransistor is an active semiconductor device — essentially a transistor whose base region is exposed to light. In a standard NPN phototransistor, incident photons generate electron-hole pairs in the base, effectively acting as a base current that allows a much larger collector-to-emitter current to flow. This gives phototransistors inherent current gain, making them far more sensitive than a simple photodiode.

Phototransistors come in two-terminal (collector and emitter, with no external base connection) and three-terminal variants. Common phototransistor packages include the familiar 5 mm epoxy LED-style housing (e.g., L14F1, PT333-3C) and surface-mount packages. Many popular breakout modules — used with Arduino — include a phototransistor pre-wired with a load resistor for direct analog or digital output.

Compared to photodiodes, phototransistors offer higher sensitivity due to transistor gain, but at the cost of slower speed. Compared to LDRs, they are faster, more linearly responsive, and available in specific spectral variants tuned to infrared, visible, or UV ranges.

Key Differences at a Glance

Parameter LDR (Photoresistor) Phototransistor
Type Passive (resistive) Active (semiconductor)
Response Time Slow (10–200 ms) Fast (2–15 µs)
Sensitivity Good (broad, non-linear) High (linear, gain-amplified)
Spectral Range Broad visible (peak ~550 nm) Depends on type (visible/IR)
Linearity Non-linear (log scale) More linear over range
Polarity Non-polarised Polarised (CE orientation)
Cost (India) ₹2–₹10 ₹5–₹25
Circuit Complexity Very simple (voltage divider) Simple (load resistor)
Temperature Drift High Moderate
Best For Ambient light, auto-dim, day/night switches IR remotes, encoders, line followers, fast detection

Speed and Response Time

This is arguably the most important differentiator. LDRs are slow — their resistance does not change instantaneously. There is a lag as charge carriers are generated and recombine. Typical rise times (dark to light) for a CdS LDR range from 10 milliseconds to over 200 milliseconds depending on the illumination level. Fall times (light to dark) are often even slower — sometimes over a second.

Phototransistors, on the other hand, are orders of magnitude faster. A typical silicon phototransistor like the L14F1 or 3DU series has response times of just 2–15 microseconds. This makes them suitable for detecting modulated signals such as IR remote control pulses (38 kHz carrier), optical encoders on motors, and barcode readers — applications where an LDR would simply be too slow to track the signal.

For most ambient-light sensing applications — auto-dimming displays, outdoor lighting controllers, daylight harvesting in smart buildings — the slow response of an LDR is not a problem. But for anything involving pulsed light, high-frequency modulation, or fast-moving objects, you need a phototransistor or photodiode.

Sensitivity and Accuracy

LDRs exhibit a highly non-linear, roughly logarithmic relationship between illuminance (in lux) and resistance. This makes it difficult to do calibrated measurements. Two LDRs from the same batch can have notably different resistance values at the same light level. If you need repeatable, calibrated lux readings, consider a dedicated ambient light sensor IC like the BH1750 or VEML7700.

Phototransistors show a more linear relationship between collector current and illuminance in their operating region. The built-in gain (hFE) amplifies the photocurrent, so even low light levels produce a measurable output. However, phototransistors are also more sensitive to temperature changes in their operating characteristics (particularly dark current), which can add noise in high-temperature environments like industrial settings.

For general-purpose light detection where you only need to distinguish light/dark (a threshold), both components work well. For analog light level measurement, phototransistors connected to an ADC tend to give more reproducible results across components, especially when using a fixed load resistor and operating in the linear region.

Spectral Response and Wavelength

CdS LDRs have a spectral response that closely mimics the human eye, peaking around 540–560 nm (green-yellow visible light). This makes them excellent for ambient daylight sensing but poorly suited for detecting near-infrared (NIR) signals such as those from IR LEDs or TV remotes.

Phototransistors are available in specific spectral variants. General-purpose visible-light phototransistors peak around 700–750 nm (red visible). IR phototransistors (like the BPW77N, TSOP series) are tuned to 850–940 nm, exactly matching common IR LED emitters used in remote controls and proximity sensors. UV-sensitive phototransistors exist too but are specialty items.

This spectral specificity is a major advantage when you want the sensor to respond to a known light source while rejecting ambient light. For example, a 940 nm phototransistor paired with a 940 nm IR LED forms the basis of most reflective and break-beam obstacle sensors used in robotics and line-follower cars.

Interfacing with Arduino

LDR with Arduino

Connecting an LDR to Arduino is as simple as it gets. Form a voltage divider with the LDR and a fixed resistor (typically 10 kΩ), connect the mid-point to an analog pin, and read with analogRead().

// LDR on A0, 10k pull-down resistor
const int ldrPin = A0;

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

void loop() {
  int rawValue = analogRead(ldrPin); // 0=dark, 1023=bright
  float voltage = rawValue * (5.0 / 1023.0);
  Serial.print("Light level (0-1023): ");
  Serial.println(rawValue);
  delay(200);
}

Phototransistor with Arduino

A phototransistor needs a load resistor (typically 10 kΩ) between VCC and the collector, with the emitter to GND. The collector-to-load junction connects to the analog pin. Adjust the load resistor to set sensitivity — lower resistance = less sensitive but wider linear range.

// Phototransistor on A1, 10k load resistor
const int ptPin = A1;

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

void loop() {
  int rawValue = analogRead(ptPin);
  Serial.print("Phototransistor (0-1023): ");
  Serial.println(rawValue);
  delay(10); // faster sampling possible
}

Practical Circuit Examples

Day/Night Switch with LDR

One of the most popular uses for an LDR in India is building an automatic street light controller. When ambient light drops below a threshold (dusk), a relay turns on a lamp. A comparator IC like the LM393 or LM741 is often used to convert the analog voltage divider output into a clean digital trigger, driving a relay module.

Circuit: LDR + 10kΩ → voltage divider into LM393 comparator (non-inverting input). Potentiometer at inverting input sets the light threshold. Comparator output drives a transistor or relay module. This is one of the simplest and most satisfying beginner circuits you can build.

IR Obstacle Detector with Phototransistor

An IR LED (940 nm) emits a continuous beam. The phototransistor receiver, placed opposite or at an angle for reflection, detects whether the beam is broken (obstacle present) or reflected. This is the exact circuit used inside commercially available FC-51 and TCRT5000 infrared obstacle modules that are popular for line-follower robots.

Optical Encoder for Motor Speed

A phototransistor and IR LED pair placed around a slotted disk (encoder disk) mounted on a motor shaft. Each slot allows the IR beam to pass, generating a pulse that the microcontroller counts. With Arduino’s attachInterrupt() and a phototransistor, you can measure motor RPM accurately — something an LDR could never do due to its slow response.

AC 220V PIR Motion Sensor

AC 220V Security PIR Motion Sensor with LED

Ideal for automatic lighting control — pairs well with light-sensing concepts to create complete smart lighting solutions.

View on Zbotic

Power Consumption

LDRs are passive resistive devices but they do consume power because current flows through the voltage divider continuously. At 5V with a 10 kΩ fixed resistor and an illuminated LDR (say, 5 kΩ), total divider current is about 333 µA (1.65 mW). In darkness the LDR resistance is very high, reducing current further. This is acceptable for most mains-powered projects but may be a concern for battery-operated devices running 24/7.

Phototransistors in their natural state (measuring ambient light) consume very little quiescent current. However, if you are driving a load resistor continuously, the power draw is similar to an LDR voltage divider. The key advantage is that many phototransistor circuits can be read very quickly (µs) and the supply to the circuit can be switched off between readings to save power — a strategy that is difficult with LDRs due to their slow response when power is restored.

Real-World Applications

Where LDRs Excel

  • Automatic street lights and garden lights: Simple threshold switching for day/night detection
  • Display auto-brightness: Adjusting LCD/OLED brightness based on ambient light
  • Camera light meters: Analog lux level measurement
  • Solar charge controllers: Detecting if daytime to enable/disable charging
  • Cheap alarm circuits: Laser/LED beam-break burglar alarms where speed is not critical

Where Phototransistors Excel

  • IR remote control receivers: Detecting 38 kHz modulated signals from TV remotes (TSOP1838 module)
  • Line follower robots: Detecting black/white tape on the floor with reflective IR sensors
  • Optical encoders: Measuring motor RPM and position
  • Object counters on conveyor belts: Fast break-beam detection
  • Proximity sensing in phones: Detecting if your ear is near the screen during a call
  • Barcode scanners: Reading reflected light from printed codes
B2X2 PIR Infrared Sensor

B2X2 4-Element Infrared Motion Analog PIR Sensor

Advanced 4-element PIR sensor for precise motion detection — complements phototransistor-based light sensing in smart lighting systems.

View on Zbotic

Which One Should You Choose?

Here is a simple decision guide based on your project requirements:

  • Need to detect ambient light level for day/night switching? → Use an LDR. It is cheaper, simpler, and perfectly adequate.
  • Need to detect a fast-blinking or modulated light source? → Use a phototransistor (or photodiode). LDR is too slow.
  • Building a line follower or obstacle avoider robot? → Use a phototransistor-based module (TCRT5000 or similar).
  • Need precise lux measurement? → Neither — use a dedicated ambient light sensor IC like BH1750 (I2C).
  • Detecting IR remote pulses? → Use a TSOP module (integrated phototransistor + demodulator).
  • Very low budget beginner project? → LDR wins on cost and simplicity.
MQ-135 Air Quality Sensor

MQ-135 Air Quality / Gas Detector Sensor Module

Build a complete environment monitoring station — pair light sensing with air quality detection for a comprehensive smart home sensor node.

View on Zbotic

Frequently Asked Questions

Can I use an LDR with a 3.3V Arduino (like Due or ESP32)?

Yes. The LDR voltage divider works at any voltage. Use 3.3V for VCC, the same 10 kΩ resistor, and read the analog pin normally. The ADC reference should match — for ESP32 the ADC is 12-bit (0–4095) and the reference is 3.3V.

Why does my LDR reading fluctuate so much?

LDR readings can fluctuate due to: (a) AC flicker from fluorescent or LED lighting at 50/100 Hz, (b) shadows and moving objects, (c) temperature drift — LDRs are sensitive to temperature. Averaging multiple readings in code helps. Consider using constrain() and map() to normalise values.

Is a phototransistor the same as an IR receiver module (TSOP)?

No. A TSOP module (like TSOP1738 or TSOP4838) contains a phototransistor, an AGC circuit, and a 38 kHz bandpass demodulator. It outputs a clean digital signal decoded from IR remote bursts. A bare phototransistor gives raw analog output and requires external processing for remote control decoding.

Can an LDR detect infrared light?

CdS LDRs have very low sensitivity to near-infrared wavelengths (>700 nm). They respond primarily to visible light. If you need to detect IR, use a phototransistor or photodiode specifically rated for the IR wavelength you are working with.

What is the best replacement for an LDR in RoHS-compliant designs?

Standard CdS LDRs contain cadmium, a restricted substance under the European RoHS directive. Alternatives include: photodiodes (faster, no cadmium), phototransistors, or dedicated ambient light sensor ICs like VEML7700 or TSL2561 (both I2C, highly accurate).

Which is better for a solar tracker project — LDR or phototransistor?

For a simple two-axis solar tracker comparing light between quadrants, LDRs are traditionally used because they are cheap, available in matched pairs/quads, and the solar panel moves slowly enough that response time is not an issue. However, phototransistors offer more consistent matching across units if you buy from a trusted supplier.

Shop Sensors at Zbotic
Looking for LDRs, phototransistors, PIR sensors, proximity modules, and more? Browse the full Sensors & Measurement collection at Zbotic.in — India’s trusted source for quality electronics components with fast shipping across India.
Tags: Arduino light sensing, LDR photoresistor, light sensor comparison, photoresistor circuit, phototransistor Arduino
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
CNC vs Laser Engraver vs 3D Pr...
blog cnc vs laser engraver vs 3d printer which machine to buy first 596349
blog transistor as switch npn and pnp circuit explained 596354
Transistor as Switch: NPN and ...

Related posts

Svg%3E
Read more

Encoder Module: Position and Speed Measurement with Arduino

April 1, 2026 0
A rotary encoder converts the angular position and rotation speed of a shaft into electrical signals that Arduino can count... Continue reading
Svg%3E
Read more

Infrared Obstacle Sensor: Line Follower and Object Detection

April 1, 2026 0
Infrared obstacle sensors are the building blocks of line-following robots, edge detection systems, and proximity triggers. These tiny modules emit... Continue reading
Svg%3E
Read more

Rain Sensor and Raindrop Detection Module: Arduino Guide

April 1, 2026 0
A rain sensor module detects the presence of water droplets on its surface, giving Arduino a simple signal to trigger... Continue reading
Svg%3E
Read more

LiDAR Sensor TFmini: Distance Measurement Beyond Ultrasonic

April 1, 2026 0
When ultrasonic sensors hit their limits — range too short, accuracy too coarse, outdoor sunlight causing interference — LiDAR sensors... Continue reading
Svg%3E
Read more

Pressure Sensor BMP280: Weather Station and Altitude Meter

April 1, 2026 0
The BMP280 barometric pressure sensor by Bosch measures atmospheric pressure with ±1 hPa accuracy and temperature with ±1°C precision. These... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now