• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Circuit Ideas for You

Get free circuit ideas online.

  • Home
  • Privacy Policy
  • About
Home » Building an LDR Comparator Circuit using IC LM339

Building an LDR Comparator Circuit using IC LM339

Last updated on 1 August 2025 by Admin-Lavi Leave a Comment

Building an LDR Comparator Circuit using IC LM339 is useful and important in many electronic jobs like sensing and control.

Using LDR, resistors, LED and LM339 IC we can make a simple circuit to check light level and show light change.

LDR works like light sensor and its resistance changes when light changes.

Using preset and fixed resistor we can make voltage divider and this voltage changes when light changes.

IC LM339 compares this voltage with a fixed reference voltage from resistor.

If light goes above set level then comparator sends signal and LED turns ON to show light change.

This circuit shows voltage compare, sensing and output signal which is easy to build and is good for learning.

It is used in small light based tools or big systems.

IC LM339 with LDR is great example of simple parts doing useful work.

Circuit Working:

Building an LDR Comparator Circuit Diagram using IC LM339

Parts List:

ComponentValueQuantity
Resistors 33k 1/4 watt1
330Ω 1/4 watt1
Preset 10k1
LDR1
SemiconductorsIC LM3391
LED 5mm 20mA1

IC LM339 is quad comparator.

Only one comparator is used in this LDR circuit.

It works with 5V DC power.

LDR is light sensor and its resistance changes with light.

More light means less resistance.

Resistor R1 makes voltage divider and LDR connects to pin 4.

When light increases the LDR resistance drops and voltage at pin 4 goes up and pin 3 gives low output.

Pin 5 has variable resistor VR1.

If VR1 is low then voltage at pin 5 goes high.

To get good output in low light then pin 4 inverting input must stay below pin 5 voltage.

When LDR sees more light then resistance drops and output voltage increases.

Comparator changes output when pin 4 inverting voltage crosses pin 5 non-inverting voltage.

In dark the LDR resistance is high and LED turns ON.

Formulas:

Main formulas for LDR comparator circuit using LM339:

1. Voltage Divider for pin 4 inverting input:

Vpin4 = (RLDR / (RLDR + R1)) × VCC

where,

  • Vpin4 is the voltage at pin 4
  • RLDR is the LDR resistance which changes with light
  • R1 is the fixed resistor with 33k
  • VCC is the 5V supply

2. Voltage at pin 5 for non-inverting input:

Vpin5 = (R2 / (R1 + R2)) × VCC

where,

  • R2 is the VR1 for variable resistor setting
  • VCC is the 5V supply

3. LED Current:

ILED = (VCC − VLED) / R2

where,

  • VLED is the LED forward voltage to about 2V
  • R2 is the resistor to limit current for 330Ω

These formulas help to set correct voltage and current in the circuit.

We can adjust VR1 to change how sensitive the circuit is to light.

How to Build:

For Building an LDR Comparator Circuit using IC LM339 follow the below mentioned steps for connections:

  • Connect pin 2 of LM339 to +5V through LED and 330Ω R2 resistor.
  • Connect pin 3 to +5V.
  • Connect pin 4 to the point where R1 33k and LDR join.
  • Other end of LDR goes to GND.
  • Connect pin 5 to middle pin of VR1.
  • One side of VR1 goes to +5V and other side to GND.
  • Connect pin 12 of LM339 to GND.

Conclusion:

Building an LDR Comparator Circuit using IC LM339 shows how to compare voltage and detect light.

It checks light level using LDR and preset resistor and gives output like LED ON/OFF.

Circuit can be changed easily to use in other projects like relay or buzzer too.

It is good for learning basics and is useful for bigger sensing circuits later.

References:

Photocell comparator circuit using LM339


Filed Under: LDR Circuits

About Admin-Lavi

Lavi is a B.Tech electronics engineer with a passion for designing new electronic circuits. Do you have questions regarding the circuit diagrams presented on this blog? Feel free to comment and solve your queries with quick replies

Previous Post: « Battery Charger Circuit using IC TP5000
Next Post: Voltage Level Monitoring Circuit using IC LM339 »

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar




Categories

  • Alarm Circuits (33)
  • Amplifier Circuits (67)
  • Arduino Projects (36)
  • Audio Circuits (94)
  • Automobile Circuits (19)
  • Battery Charger Circuits (48)
  • Free Energy (13)
  • Heater and Temperature Controllers (10)
  • High Voltage (1)
  • Indicator Circuits (38)
  • Inverter Circuits (13)
  • LDR Circuits (15)
  • LED and Lamps (116)
  • Meters and Testers (28)
  • Motor Controllers (18)
  • Oscillator Circuits (34)
  • Power Supply Circuits (92)
  • Remote Control Circuits (6)
  • Security and Protection (25)
  • Sensors and Detectors (84)
  • Solar Circuits (17)
  • Timer Circuits (30)
  • Transistor Circuits (57)
  • Transmitter Circuit (12)
  • Tutorials (5)
  • Water Level Controller (4)

Recent Posts

  • Sound Sensor Circuit using IC LM393
  • Sound Sensor Direction Circuit using Arduino
  • Dancing Water Fountain Circuit with Arduino
  • Arduino Based Obstacle Avoidance Robot Circuit
  • Arduino Based Automatic Gate Opening and Closing Circuit

Recent Comments

  1. Admin-Lavi on Constant Voltage, Constant Current Battery Charger Circuit
  2. Bill on Constant Voltage, Constant Current Battery Charger Circuit
  3. Admin-Lavi on Long Range FM Transmitter Circuit (2km)
  4. Sina on Long Range FM Transmitter Circuit (2km)
  5. Admin-Lavi on Long Range FM Transmitter Circuit (2km)

Copyright © 2025 | New Circuit Ideas