Page 1 of 1

Daylight sensor

Posted: Mon Oct 21, 2019 12:57 pm
by judos
I created a small combinator circuit to measure the daylight with vanilla entities.

Output
One Signal N with a number between 1 and 101 (I didn't like 0 because then I can't see whether the signal is present anywhere or not)

Short explanation
The circuit uses the fact that combinators run slower the less power they have. So I connect one solar panel to entities such that a bit more than 60kW is used. During the day the combinator has enough power and runs on 60ticks. If solar only produces 30kW during dawn the combinator will run only 30 calculations. The transform is almost linear, less power -> less ticks on the combinator.
Meanwhile the main calculation (image on the right side) must always have enough power (main base power, or uninterrupted power supply)


Building requirements
17 Lamps
18 combinators (5 constant, 4 arithemtic, 9 decider)
2 electric poles (small do, if using medium make sure the one with the solar panel doesn't connect anywhere)
1 Solar panel

Additionally if you want the calculation on an uninterrupted power supply:
1 solar panel + 1 accumulator
daylight sensor vanilla.PNG
daylight sensor vanilla.PNG (1.07 MiB) Viewed 6324 times
Demo video 2MB mp4
Long combinator explanation
Blueprint string

Re: Daylight sensor

Posted: Thu Oct 24, 2019 1:12 pm
by AngledLuffa
I love it!

If it's not too much trouble to ask, would you post the blueprint with the red/yellow/green lights as well?

Re: Daylight sensor

Posted: Thu Oct 24, 2019 9:58 pm
by judos
Sure thing.
Hope it helps your base and you have fun with it :)
blueprint with lamps

Re: Daylight sensor

Posted: Sat Oct 26, 2019 6:22 am
by AngledLuffa
Definitely had fun with it!

I added an S-R latch and a pulse combinator so that it ticks once per day. I counted the number of ticks and added a constant for how many days I've been on the planet before starting the combinators.

I combined it with this display:

https://factorioprints.com/view/-LCBqlZMQrvROJunHaAU

As it turned out, I'm just a couple days away from 10000!

Actually, it's kind of horrifying to think my engineer has been stuck here for 27 years. Maybe days really are just 4 minutes long and his life hasn't been a meaningless existence of launching rockets.

Re: Daylight sensor

Posted: Fri Jan 24, 2020 12:10 am
by judos
Short update: since the circuitry is not very exact there is also a mod "Time Tools" which has a Clock Combinator which outputs the lightness as value between 0-100, additionally the mod has some gui to speed up time, if you don't need that it's also possible to disable:
/c remote.call( "timetools", "off" )

https://mods.factorio.com/mod/TimeTools

hf!

Re: Daylight sensor

Posted: Thu Nov 26, 2020 7:53 am
by dmikalova
Thanks, this worked for setting up Krastorio's transceiver in an all solar base. The transceiver acts as an accumulator that loses power when not being charged, and just putting it on an isolated network with a power switch that turns off when accumulators are less than 100% and with a few wind turbines to always have power doesn't work. It seems like in the same tick that the accumulators start losing power, the transceiver sees itself as not being powered which breaks it.