The sunlight sensor is used to detect the time in the game Minecraft which is done by measuring the level of sunlight, then emitting a redstone current that has the same strength as the sunlight. This sensor can also be turned into a nighttime sensor using some smart redstone. This means, these sensors can be used to make automatic lights, time bombs, alarm clocks, and other created things.
Step
Method 1 of 4: Basic Alarm Clock

Step 1. Place the sunlight sensor under a clear block or place it where there is no block on it

Step 2. Create a redstone trail leading to the machine which must be activated with redstone

Step 3. The engine will activate when sunlight shines on the sensor
Method 2 of 4: Time Bomb

Step 1. Lay down a block of TNT

Step 2. Hide the TNT well

Step 3. Place the sunlight sensor on top of the TNT block

Step 4. Watch as the sun shines, the TNT explodes
Method 3 of 4: Night Sensor

Step 1. Place the sunlight sensor

Step 2. Press the 'Use' command when your character is near the sensor

Step 3. The sunlight sensor will turn blue
Now the item has turned into a night sensor and can only be activated at night!
Method 4 of 4: Auto Light

Step 1. Place the sunlight sensor on the roof

Step 2. Change it to a night sensor using the 'Use' command

Step 3. Follow the redstone trail to place the lamp where you want it

Step 4. Place the lamp over the hole in the ceiling

Step 5. Notice that the lights will turn on when the sun goes down

Step 6. Note that the lights will turn off at sunrise
Tips
- Redstone has a weak signal with little light, and this light cannot reach the same distance as a redstone wire.
- Try hiding the redstone.