Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

Compact Light Sensors, 1x/7x/12x/14x Sensitivity


  • Please log in to reply
248 replies to this topic

#1

last_username

Posted 24 September 2011 - 07:51 PM

*
POPULAR

As of the 12w39a snapshot, the 7x/12x/14x models are broken. However, I've got them working again with a few modifications. I'm going to hold off on a tutorial for now, in case Mojang makes more changes to the lighting engine.

These are day/night sensors. They switch a redstone signal on and off at dawn and sunset. There are currently five models: Pico (1x), Nano (1x), 7x, 12x, and 14x. The 12x is the newest model and the one I recommend for compact and reliable day/night detection.

The Pico and Nano use a single grass block to detect the outdoor light level. They have 23 grass source blocks, just under the maximum possible of 25.The Pico is a bit smaller than the Nano, but requires an ice block. They use the same basic mechanism as Etho's original light sensor but they are considerably more compact. They are very easy to build, but slow to react. They can easily take a couple of minutes to detect daybreak. The Pico is, IMHO, the smallest practical light sensor in existence right now. You can't get any smaller without sacrificing source blocks, which will slow the machine down a lot.

The larger models use 7, 12, and 14 grass blocks respectively to detect light and they will react roughly that many times faster than the small machines. At the same time, they are much more compact than simply chaining 1x sensors together. The 12x and 14x models typically react within seconds. They usually notice the sun rising before I do.

These machines can be tricky to build, even from instructions. Getting the smallest detail wrong can make them not work. If you're having trouble, describe the problem here, prefereably with some screenshots, and I'll help you figure out what's wrong.

Light Sensor Pico (3x5x3)

Posted Image



Light Sensor Nano (3x6x4)

Posted Image




Light Sensor 12x (18x6x8)

Posted Image

Video Tutorial



Light Sensor 7x (12x5x11)

Posted Image

Video Tutorial


Build Instructions (revision 2, for all versions of Minecraft)
Spoiler:



Light Sensor 14x (12x5x20)

Posted Image

Build Instructions (revision 2, for all versions of Minecraft)
Spoiler:



Troubleshooting

If your machine doesn't work, look for the following:
  • Repeaters set to the wrong delay
  • Missing/misplaced redstone dust or torches
  • Missing blocks that could allow light to leak into the machine
  • External light sources reaching the window
  • Obstructions between the window and sky
  • Grass where there shouldn't be
  • No grass where there should be
  • Chupacabras
If you can't fix it, post the symptoms and some screenshots in this thread and I'll help you out.

Note: up to Beta 1.8, Minecraft had a "sticky light" bug that affected this machine, but the bug is fixed in Minecraft 1.0



Schematics

Light Sensor Nano
Light Sensor Nano (underground)
Light Sensor 7x
Light Sensor 14x

(schematics for the newer models coming.. uh.. soon)

So, how does it work?

The nano/pico models use a single block of grass/dirt to detect light. During the day, the grass block is under water/ice, causing it to die as soon as it gets dark. This is detected by a T-BUD switch and the sensor block, which is now dirt, is moved out of the water/ice. It will stay dirt until morning when there is enough light for grass to grow on it. This is again detected by the T-BUD and the grass block is moved back under the water/ice.

The 7x, 12x, and 14x models actually contain two rows of sensor blocks: the one directly under the window detects nightfall, and the one on the other side detects daybreak. The night sensor has 7/12/14 grass blocks. When one of them dies, it switches the machine to night mode. It then spends the night regrowing grass on the block that died, and any others that might have died somehow. Meanwhile, the day sensor waits for one of its 7/12/14 dirt blocks to grow grass. When that happens, it switches the machine to day mode and spends the day killing off any grass that grew.

Each sensor spends half the day waiting and the other half resetting itself. If one of them doesn't fully reset, for whatever reason, the machine is just less sensitive for that cycle, and it will fix itself for the next cycle. For the machine to break, all blocks on one side would have to grow/die before any of them could be killed off/regrow.

But how exactly do the 7x/12x/14x sensors work???

Ok, but first a quick review of the light/grass rules:
  • Sunlight is level 15 (or 10 during a storm), moonlight is level 4, torches are level 14
  • Light decays by one level for every step up, down, or sideways.
  • Light decays by an additional two levels for every water or ice block it passes through. The height of the water doesn't matter.
  • Light from the sky doesn't start to decay until it hits the first block that isn't fully transparent.
  • Grass can spread one block up, one block sideways, and three blocks down.
  • Grass can spread to a dirt block only if there is light 9+ above the grass block, light 4+ above the dirt block, and the block above the dirt does not decay light by more than 1.
  • Grass can die if there is light 3 or less above it and the block above it decays light by more than one.
Got it? Good.

So, the inside of the machine is light-proof, except for the window on top. During the day, both sensors are covered by a layer of water. The night sensor is directly under the window, so there is only one water block between the sensor and the sky. That means it gets light level 15-3=12 during the day (or 7 during a storm), which is not dark enough to kill it. At night, it only gets light level 4-3=1 and one of the blocks soon dies, triggering the switch to night mode. The day sensor is shifted 3 blocks away from the window, so skylight has to go through 4 water blocks to get to it. Even in daylight, it only gets light level 15-3-3-3-3=3 and so all the blocks die.

At night, the water shuts off. Now the night sensor is getting light 4 from the moon, which is just enough for it to regrow. The grass is spreading from the surrounding grass blocks, which are getting at least light 9 from the torches. The day sensor is still 3 blocks away from skylight, so it only gets light level 1 during the night, but when day comes it goes up to 12 and one of the dirt blocks quickly grows grass and switches the machine to day mode.

Infographic

This is a cross-section of the 7x and 14x models, looking down the length of the machine. The night detector block is on the left and the day detector is on the right. The numbers represent the light level at that block.

Posted Image

XBox360 Version

DewRadley explains how to make the 12x work on the XBox version of Minecraft, with a few small modifications:

http://www.minecraft...aynight-sensor/

Register or log in to remove.

#2

the2dcubeisflat

Posted 24 September 2011 - 07:55 PM

Wow...

#3

grandreaper
  • Location: USA

Posted 24 September 2011 - 08:03 PM

You deserve a  :Diamond: my good sir. Great Job
If it's not broken, fix it till it is!

#4

SpixPanda
  • Location: Mountains
  • Minecraft: spixpanda

Posted 24 September 2011 - 11:40 PM

This is just insane. Awesome job, must have taken ages to work out correctly.

~Puni Puni~


#5

last_username

Posted 25 September 2011 - 12:25 AM

Here are some important details I forgot to mention:

If it isn't obvious, the window on top needs a clear view of the sky -- no blocks above it that affect light propagation, which includes e.g. water and leaves.

Also, the level of artificial light right above the window can't be any higher than 8, or it will break the machine. At the same time, you want at least light level 9 above the grass blocks that surround the window, so they can contribute to the machine's sensitivity. If you build the machine above ground, and only place torches where I have, these conditions will be met.

But if you want to bury the machine and have the window at ground level, you'll need to place torches on the ground at just the right distance. Just place them 6 steps away from the space above the window, in every direction.

If you don't want any light above ground, you can build another layer above the top grass layer. Place torches on the grass and use slabs around the window to keep the light in:

Posted Image
Posted Image

And if you want to flood the ground with light, you can build a "light chimney" around the window, going up as high as you need to escape the light from below.

#6

AncBuggy
    AncBuggy

    Tree Puncher

  • Members
  • 25 posts

Posted 25 September 2011 - 01:12 AM

This is beyond me. I'll give it a build and see how I may incorperate it into some sort of context. maybe lights that automatically come on at  night. So much possibility. Great job!

#7

last_username

Posted 25 September 2011 - 02:16 AM

View PostSpixPanda, on 24 September 2011 - 11:40 PM, said:

This is just insane. Awesome job, must have taken ages to work out correctly.

Well, this is version 4.

Version 3 can be seen in the background of one of the screenshots above. It is more sensitive (12x) but enormous.

Version 2 was even bigger than that.

And version 1 was essentially the same as JL's light sensor array:


#8

ciberninja

Posted 25 September 2011 - 03:41 PM

sweet, I can use this to turn on lights and open/close my castle gate at night :)

#9

Dri0m
    Dri0m

    Zombie Killer

  • Members
  • 211 posts

Posted 25 September 2011 - 04:26 PM

i have little problem:

i built it, waited for night, RS nor switches.
waited for day, RS nor switches
waited for night, nothing happens  :SSSS:
Enderman is my retarded cousin...
http://www.voltage.g...minecraft-mapy/ - My Minecraft maps

#10

Lancelote123

Posted 25 September 2011 - 04:36 PM

Awesome!!! This is the best light sensor i've ever seen!!

  :Diamond: to you sir :D

#11

Dri0m
    Dri0m

    Zombie Killer

  • Members
  • 211 posts

Posted 25 September 2011 - 05:57 PM

View PostDri0m, on 25 September 2011 - 04:26 PM, said:

i have little problem:

i built it, waited for night, RS nor switches.
waited for day, RS nor switches
waited for night, nothing happens  :SSSS:

i removed "roof" glass and it works  :blink:
Enderman is my retarded cousin...
http://www.voltage.g...minecraft-mapy/ - My Minecraft maps

#12

boxmasterj

Posted 25 September 2011 - 06:08 PM

Hey man, can you let us download this? This is amazing.
Posted Image

#13

Wack_Waffee

Posted 25 September 2011 - 06:36 PM

Bookmarked for great justice.

#14

last_username

Posted 25 September 2011 - 08:06 PM

View Postboxmasterj, on 25 September 2011 - 06:08 PM, said:

Hey man, can you let us download this? This is amazing.

sure

http://extension.ws/...or_7x.schematic

#15

last_username

Posted 25 September 2011 - 11:49 PM

View PostDri0m, on 25 September 2011 - 05:57 PM, said:

i removed "roof" glass and it works  :blink:

That's odd. The glass shouldn't affect the machine, and you will probably want it to prevent mobs from falling in. You sure there wasn't too much artificial light near the window?

#16

ProNoob
    ProNoob

    Stone Miner

  • Members
  • 75 posts
  • Location: Groningen, the Netherlands
  • Minecraft: ProNoob13

Posted 26 September 2011 - 12:30 PM

Sick, dude. Awesome! :Diamond: :Diamond: :Diamond:

Posted Image

Quote

My life is all about punching trees, mining, crafting, building, punching spiders, fighting zombies, running from creepers, respawning, finding back my shelter and punching more trees. Yup, I wish I actually had a life.

#17

GWigWam
    GWigWam

    Gold Miner

  • Members
  • 388 posts
  • Location: I love how 90% of the people use this space as an extra signature.
  • Minecraft: GWigWam

Posted 26 September 2011 - 04:57 PM

Wow... That's so smart :D

have some: :Bacon:

#18

lasz
    lasz

    Carpenter

  • Members
  • 59 posts
  • Location: A small, but nice house in the middle of a swamp.
  • Minecraft: It's a secret.....

Posted 26 September 2011 - 05:17 PM

One word: Genius. Get some digital diamond and front page post.  :Diamond:

#19

darkbrewery
  • Location: Canada

Posted 29 September 2011 - 10:30 AM

This is awesome, I made an attempt a while ago at a 10-wide array of 2-wide light sensors using 1-wide bud's and t-flips. But this has had way more thought put into it, excellent.

Two things: here's another version I found on the tube:


And here's probably the most practical application for your creation: replace the 6-sensor setup on this clock:

#20

last_username

Posted 30 September 2011 - 03:33 AM

First post updated with new 14x sensitivity model