• 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 14 June 2026 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, also 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 and using preset and fixed resistor we can make voltage divider and this voltage changes when light changes.

Then IC LM339 compares this voltage with a fixed reference voltage from resistor and if light goes above set level then comparator sends signal and LED turns ON to show light change.

Hence, this circuit compares voltage, senses input, and generates an output signal; also it is easy to build, useful for learning, and applicable in both small light-based tools and larger systems.

Also, 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:

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

The LM339 is a quad comparator and this LDR circuit uses only one of its comparators, also it operates on a 5V DC power supply.

Further, LDR is light sensor and its resistance changes with light, more light means less resistance.

Then 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.

After that pin 5 has variable resistor VR1 and if VR1 is low then voltage at pin 5 goes high, so 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.

Now comparator changes output when pin 4 inverting voltage crosses pin 5 non-inverting voltage and 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 and 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:

  • First, connect pin 2 of LM339 to +5V through LED and 330Ω R2 resistor.
  • Next, connect pin 3 to +5V.
  • After that, connect pin 4 to the point where R1 33k and LDR join and other end of LDR goes to GND.
  • Now connect pin 5 to middle pin of VR1, one side of VR1 goes to +5V and other side to GND.
  • Finally, connect pin 12 of LM339 to GND.

Conclusion:

Overall, 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.

We can easily modify the circuit for other projects like relays or buzzers, it also helps you learn the basics and supports development of larger sensing circuits later.
.


Filed Under: LDR Circuits, Mini Projects, Sensors and Detectors

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

  • 555 Timer Projects (123)
  • Alarm Circuits (75)
  • Amplifier Circuits (92)
  • Arduino Projects (103)
  • Audio Circuits (189)
  • Automation Circuits (113)
  • Automobile Circuits (38)
  • Battery Charger Circuits (86)
  • DIY Projects (368)
  • Free Energy (12)
  • Heater and Temperature Controllers (32)
  • High Voltage (23)
  • Hobby Circuits (198)
  • Indicator Circuits (62)
  • Inverter Circuits (18)
  • IoT projects (10)
  • LDR Circuits (45)
  • LED and Lamps (196)
  • Meters and Testers (43)
  • Mini Projects (299)
  • Motor Controllers (25)
  • Oscillator Circuits (63)
  • Power Supply Circuits (228)
  • Radio Frequency (7)
  • Remote Control Circuits (11)
  • Renewable energy (13)
  • Security and Protection (108)
  • Sensors and Detectors (224)
  • Solar Circuits (31)
  • Timer Circuits (62)
  • Transistor Circuits (176)
  • Transmitter Circuit (19)
  • Tutorials (29)
  • Voltage Regulator (38)
  • Water Level Controller (10)

Recent Posts

  • Low Current Controlled Battery Charger Circuit using LM723 IC
  • 741 Op-Amp Treble Booster Circuit
  • Simple Diode and Transistor Based Audio Limiter Circuit
  • Simple 500mW Speaker Driver Circuit
  • Easy DIY LM386 Audio Amplifier Circuit

Recent Comments

  1. Tony Gallegos on NTC Thermistor Based Temperature to Voltage Converter Circuit
  2. colin on Simple Single Transistor Audio Amplifier Circuit
  3. How to Make a Bird Chirping Noise Easily on Chirping Bird Sound Generator Circuit
  4. Transistor Based Medium Impedance Preamplifier Circuit - Circuit Ideas for You on Low Impedance Input Transistor Preamplifier Circuit
  5. Admin-Lavi on Alternate Red Green LED Flasher Circuit

Copyright © 2026 | New Circuit Ideas