I have solar panels, and would like to be able to turn things off when the sun is not shining and on when it is. All the mains switches I can find will only work the other way round. Can anyone help please?

  • 1
    Have you considered using a photocell to drive the coil of a SPDT relay? Apr 3 at 1:53
  • Does it actually have to sense sunlight, or would "after dawn/before dusk" be enough? If the latter, many smart-home systems have that calendar/time correlation built into them.
    – keshlam
    Apr 3 at 2:15
  • 1
    You can use a smart home automation system to sense the daylight with a Lux sensor and a power switch Apr 3 at 2:35
  • @RohitGupta your suggestion is much more expensive compared to the first one: photocell and relay...
    – Solar Mike
    Apr 3 at 6:41
  • @ThreePhaseEel Exactly what I did, do stop the isolation transformer for our toothbrush/shaver socker humming all night (it's about 1' away from my head through a wall, when I'm in bed). But then I got annoyed with the constant clunking when it's cloudy and put a smart switch in there that has a timer (and a much quieter relay)
    – SiHa
    Apr 3 at 9:00

1 Answer 1


There are a few ways of going about this, depending on what you are really trying to do.

If you have a setup where DC solar power is converted to AC power that feeds through your main panel into the utility grid - i.e., effectively lowering your electric bill when the sun is shining - then you could sense the current running through that circuit and use that to activate/deactivate other circuits. That gets a little complex as some key pieces need to reside inside your main panel, so using products designed/tested for such use is a must.

On the other extreme, if you simply want to turn one circuit on/off based on sunlight, but not with respect to any particular amount of power being generated by your solar cells, you could hack together two standard photocell sensors:

  • Sensor A turns on circuit A powering light A when it is dark outside.
  • Sensor B is physically placed next to light A with blocking around it so that natural light does not get in. When Sensor B turns on circuit B when light A is off, which is when sensor A is off, which is when there is natural light (daytime).

That would require no special equipment, just two standard photocell-sensor controllers, with one of them (A) either controlling a circuit (i.e., whatever you want) wired to a light or directly controlling a light (i.e., an integrated unit) but the second one (B) having to control a circuit so that you can use the power as you please.

The in-between solution is to look for a normally open photocell sensor module. The standard is normally closed, so that in the dark (meaning photocell isn't doing anything) the circuit is closed = power flows to your controlled device, and in the light the photocell opens the circuit = power does not flow to your controlled device. Reverse it (normally open) and things will work the way you want them to work. The catch is that this requires finding somewhat more unusual parts (but still shouldn't be that big a deal) that you are not so likely to find at your typical hardware store or big box store. And unlike the first solution (solar circuit power monitoring) it is based on "it is light out so the solar should be working", rather than "solar is producing power so we can use that amount of power".

Not the answer you're looking for? Browse other questions tagged or ask your own question.