Thanks a lot for this amazing explanation and hands on experiments. Interesting that video has 5k+ views and zero answers to the question 😃 If I understand this correctly, the photo resistor is connected to ground in the “prebuilt sensor” , where in the manual implementation we had photo resistor connected on the 5v side. Therefore the readings go up when the light turns off and go up with more light. So it works in reverse and we had to change the logic from “< threshold” to “> threshold”