I’m trying to build a very simple, stupid light switch for my grow light. Essentially, I want to turn on the light, if it gets too dark outside, so that my plants can survive the northern winter.

Since I’m a software guy, my first thought was an ESP32, but that seems excessive.

My current approach would be something like this: https://www.ebay.com/itm/313561010352 In conjunction with a relay, both powered by a USB-PSU.

If the light level is low enough, the logic DO pin should send a signal and that should be enough to trigger a small relay, so that the relay then closes the circuit to switch on the lights.

Is that idea completely stupid? With electronics, I’m usually missing something very obvious.

The lights themselves are already just usb powered and only draw 5W, so that shouldn’t be problem.

What I’m concerned with is the actual switching. Is the logic signal “strong” enough to activate a relay? Would simple transistor maybe sufficient?

  • montar@lemmy.ml
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    3 months ago

    First thing that comes to mind is ye olde cheap opamp and a potentiometer. This aritcle claims hysteresis can be done with a resistor. Opamp output is not meant for relay, but it can control a transistor which in turn can control your relay just fine.

    Edit: i’ve just re-read your post, there’s no need for relays if you have low voltage, just get a transistor rated for more than 5V and make sure it wom’t overheat.

    • nilclass@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 months ago

      there’s no need for relays if you have low voltage

      That’s a good point. Also makes me wonder if those lights will actually make a difference when it comes to plant growth, given the low power.

      • montar@lemmy.ml
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 months ago

        Ppl do it with UV LEDs and they claim it works. I never tested it, i’m dried-a-cactus kind of guy.