
Video: Daylight Sensor - Minecraft Redstone Tutorial by TT Lemon
How to build it
- Place the Comparator in Subtract Mode
Place your redstone comparator on the ground facing the direction you want your final output to go. Right-click (or interact with) the comparator once so its front torch turns on, putting it into subtract mode.
- Attach and Fill the Container
Place a block with an inventory directly behind the rear input of the comparator; a hopper works best because it only has five slots. Fill the container halfway—for a hopper, put in 2.5 stacks of normal 64-stackable items.
- Connect the Side Input Dust
Place a single piece of redstone dust directly next to either side of the comparator so it feeds into the comparator's side (B) input.
- Add the Daylight Detector
Place your daylight detector adjacent to the redstone dust so it powers that dust line. Alternatively, for an even tighter footprint, you can place the daylight detector directly against the side of the comparator without the dust.
- Connect Your Output
At sunset, the front of the comparator will emit a weak redstone signal. For survival lighting or note block alarms, place a redstone repeater directly in front of the comparator to boost the signal to full strength (15), or place a command block there in creative mode.
How it works
This circuit relies on comparator subtraction logic and container signal strength:
- Rear Input (Signal A): A half-full hopper (2.5 stacks of items) outputs a constant, fixed redstone signal strength into the back of the comparator.
- Side Input (Signal B): The daylight detector measures the current sky light level and sends that strength into the side of the comparator.
- Subtraction Mode: When the front torch on the comparator is lit, it calculates
Output = Rear - Side. During the day, the daylight detector's signal is stronger than the hopper's signal, resulting in an output of0(off). - Sunset Trigger: Just before sunset, the daylight detector's signal drops below the hopper's fixed signal strength. The comparator can finally let a signal through, turning on your street lights or command block right as dusk arrives.
Tips & variations
- Ultra-Compact Variant: You can omit the redstone dust entirely and place the daylight detector directly against the side of the comparator for an even smaller footprint.
- Decorative Hiding: If you use the redstone dust layout, you can surround the wiring with half-slabs or elevate the dust on a slab so only the daylight detector pokes out flush with the ground.
- Adjusting the Trigger Time: By adding or removing items in the hopper, you change the threshold signal strength. More items make the circuit turn on earlier in the evening; fewer items make it wait until deeper into the night.
- Creative Eternal Day: Place a command block directly in front of the comparator with the command
/time set 3000to automatically reset the world to morning as soon as dusk hits.




