An easy method to calibrate the threshold would be to add an additional photoresistor that just serves as a reference value.