Learn how to wire day and rain sensors for automatic lights in Solarpunk so your base lights turn on at night or during rain and stay off on clear days.
This is one of those small smart-base circuits in Solarpunk that quietly does its job in the background. Instead of flipping your base lights on by hand, you let two sensors watch the world for you: one tracks whether it’s day or night, the other watches for rain. Combine them the right way and the lights come on at night or in a downpour, and stay dark on a clear day.
In Solarpunk you can make lights switch on automatically at night OR when it rains by wiring a day sensor and a rain sensor through two logic gates — invert the day sensor, leave the rain sensor normal, then tie both inputs together and both outputs together into a wireless light.
What this night-and-rain lighting setup does

The behavior you’re building is simple to describe and a little fiddly to wire. You want your lights on at night, you also want them on when it’s raining — even in the middle of the day — and you want them off on a clear, dry day when there’s plenty of natural light.
That “night OR rain” wording is the heart of it. This is an OR condition: either trigger on its own is enough to power the light, so a stormy afternoon and a clear midnight both end with the lights glowing. The trick is wiring two different sensors so they cooperate instead of fighting each other.
Parts you need and which sensor to invert
| Component | Inverted? | Role in the circuit |
|---|---|---|
| Day sensor | Inverted | Fires at night instead of during the day |
| Rain sensor | Not inverted | Fires directly when it’s raining |
| Logical gate (x2) | — | Combine the two sensor inputs and outputs together |
| Power source / batteries | — | Feeds power into the first switch |
| Wireless light | — | The output device the circuit turns on |
The build is short on parts. You need two logic gates, a rain sensor, a day sensor, a power source (batteries or whatever you’re running your base off), and the wireless light you want to control. The single most important detail isn’t which parts you grab — it’s the inversion state of each sensor, because that’s what flips the whole circuit from “on during the day” to “on at night.”
Wiring the sensors and logic gates together
Run the power in first, set up the day sensor on the inverted switch, then add the rain sensor and bridge the two together. Take it in order and it comes together quickly.
STEP 1/6
Bring power into the first switch
Run power from your batteries (or whatever you’re using) into the first logic gate.
STEP 2/6
Set the day sensor on the inverted switch
Connect the day sensor to that first gate and invert it so it triggers at night rather than during the day.
STEP 3/6
Place the rain sensor on the second gate
Add the other logic gate with the rain sensor, and leave this one not inverted so rain triggers it directly.
STEP 4/6
Tie both inputs together
Wire the second sensor’s input to the first input, so the two gates share their inputs as one.
STEP 5/6
Tie both outputs together
Join both gate outputs into a single line, the same way the inputs are joined.
STEP 6/6
Seed the output to your wireless light
Run that combined output to a wireless light — or any output device you want to drive.
The whole circuit hinges on one setting — invert the day sensor and leave the rain sensor normal. Get that backwards and your lights will burn during the day and switch off at night.
Why the day sensor is inverted and the rain sensor isn’t
Think about what each sensor does on its own. A day sensor reads “true” when it’s daytime — so if you wired it in untouched, it would dutifully turn your lights on during the day, which is exactly backwards from what you want. Inverting it flips that reading, so the sensor now fires at night, when you actually need the light.
The rain sensor needs no such trick. It already reads “true” when it’s raining, and “raining” is precisely the moment you want the lights to come on, so you leave it alone. No inversion needed.
Wire those two together with both inputs joined and both outputs joined, and you’ve built an OR gate by hand: the light comes on if the inverted day sensor is firing (it’s night) or the rain sensor is firing (it’s raining). Either condition is enough, which is exactly the “on at night OR when it rains” behavior you set out to build.
Frequently Asked Questions
Why is only the day sensor inverted and not the rain sensor?
Because the two sensors read the world in opposite ways relative to what you want. A day sensor fires during the day, but you want light at night, so you invert it to flip that timing. A rain sensor already fires when it’s raining, and raining is exactly when you want the light, so it stays as-is. Inverting both would break the logic.
What happens on a clear day with no rain — do the lights stay off?
Yes. On a clear, dry day, the inverted day sensor isn’t firing (it only triggers at night) and the rain sensor isn’t firing either (no rain). With neither input active, the OR condition isn’t met, so the wireless light stays off until night falls or the weather turns.
Can I use this same setup to power devices other than lights?
The output line can feed a wireless light or another output device, so in principle you can drive other things off the same trigger.
Do I have to use two logic gates, or can it be done differently?
This particular wiring uses two logic gates to OR the two sensors together.