To help you debug it, I labeled all of the nodes in the circuit, and did two .DC simulations with the LDR dark >100KΩ (first set) and with the LDR fully illuminated <10KΩ (second set). I printed out both sets of expected node voltages so that you can compare to what you are getting. I think you have a bad transistor somewhere? Comparing your circuit voltages to what I just posted should help in figuring this out.
Since you are not using the relay I expected you to use (you keep changing things that are important without telling me), then make R5 about twice to three times whatever the resistance of the 12V relay coil is. If you are not using a 12V relay (but some other voltage), that changes how the relay is driven.
For example, look at V(c1), the collector voltage for transistor Q1, in both the dark and light tables. Note that it switches from completely off V(c1)=23.99V to completely on V(C1)=0.05V
Since you are not using the relay I expected you to use (you keep changing things that are important without telling me), then make R5 about twice to three times whatever the resistance of the 12V relay coil is. If you are not using a 12V relay (but some other voltage), that changes how the relay is driven.
For example, look at V(c1), the collector voltage for transistor Q1, in both the dark and light tables. Note that it switches from completely off V(c1)=23.99V to completely on V(C1)=0.05V
Last edited: