Reduce active region of NPN transistor
Something like this







simulate this circuit &ndash; Schematic created using CircuitLab

================================================

I added VDD label on the top-wire; thank you for noticing.

Notice I added R5 on the left. Without R5 demanding current to produce a Vbe (which varies with collector current and with temperature and with Beta), a reliable trip point (light level) will not occur.

This is better, and more like a standard comparator, thus easier for you to tweak in simulation.







simulate this circuit