Voltage divider and op amp

operational-amplifiervoltage divider

when ldr is in dark, all voltage drop is across the ldr, so how does voltage at inverting input becomes negative when it is supposed to be 0V or (x)mV?

and when ldr is in light, all voltage drop is across resistor R1, so why voltage at inverting input is -7V?

note: i tried this on livewire simulator and got these values negative and -7Venter image description here

Best Answer

You have no feedback on your op-amp circuit and it is running with 'infinite' (well, very high) gain and basically operating as a comparitor.

The way the op-amp works is that if the + input is higher than the - input then the output will go high and vice versa.

Look up 'inverting op-amp circuit' and you will find plenty of circuits showing how to adjust the gain of the circuit to give desired results.