J2 connects an external LDR, with no invented mechanical LDR footprint. The upper divider branch is a fixed 10 kΩ resistor plus the LDR; the lower branch is 10 kΩ. With a 5 V supply, the resistor library gives 2.381 V at a sample LDR resistance of 1 kΩ and 0.417 V at a sample 100 kΩ. These resistance points are assumptions, not universal bright/dark specifications for a particular photoresistor.
The fixed series resistor limits the sense voltage to 2.5 V even if the LDR resistance approaches zero. This matters because a classic LM358’s input common-mode range does not extend to its positive supply. The reference divider uses 20 kΩ above 10 kΩ, giving 1.667 V. Both inputs stay away from the positive rail in this nominal design. Check your actual LM358 variant’s pinout and electrical limits.
The reference goes to the noninverting input, and the light-sensitive voltage goes to the inverting input. Darkness increases the LDR resistance and lowers the sense voltage below the reference, driving the output high. That output drives the 2N3904 through 4.7 kΩ. The emitter is grounded, the collector switches the LED, and a 100 kΩ base pulldown defines the off state.
Assuming a 2 V LED drop and 0.2 V collector-emitter saturation drop, the 1 kΩ LED resistor gives 2.8 mA. At an explicitly assumed 2.5 V op-amp high level and 0.7 V base-emitter drop, the switch library computes 0.383 mA through the fitted base resistor, before the 0.007 mA pulldown current. This exceeds the nominal forced-beta-10 requirement of 0.280 mA for that LED current. It is a component calculation, not a guaranteed LM358 output swing under every load and temperature; check the actual device.
The unused amplifier is connected as a ground-referenced follower, with its output joined to its inverting input and its noninverting input grounded. Its inputs do not float. This circuit deliberately has no hysteresis, so an LED near the threshold can flicker. An LM358 used open-loop is appropriate only for this slow demonstration, not a substitute for a fast comparator. Use isolated pads and insulated jumpers; there are no stripboard cuts.