I’ve got a cheap salt lamp with a LED inside and it runs on a 5V wall wart. I think it originally had a USB plug but I cut that off and connected it to an old 5V power supply.

I’ve never used esp32, but I’ve been doing some reading and it seems like an esp32-c6 will allow me to do this with ZigBee.

Does this sound reasonable? Are there other options I should consider?

  • Grimy@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    15 hours ago

    Look into the Shelly relays. You can put them inline I’m pretty sure if you don’t want them in the socket.

    • GreatBlueHeron@piefed.caOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      13 hours ago

      I’m aware of Shelly and similar products. they are way overkill for this lamp - it’s literally 1 LED and was powered from USB before I modified it to run from a 5V wall wart. I’ve ordered a few ESP32 boards to play with. I’m pretty confident I can power my lamp from one because one of the tutorials I found for new users was literally making a light switch. The tutorial used a LED for proof of concept and said to replace the LED with a relay to switch a real light.

  • paf@jlai.lu
    link
    fedilink
    English
    arrow-up
    7
    ·
    1 day ago

    You can also use a ZigBee smart plug and connect your 5v power supply to it

    • GreatBlueHeron@piefed.caOP
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      1 day ago

      I have a bit of an aversion to smart plugs - they seem like a bit of a kludge. I totally understand there are lots of cases where there’s no other option, but I don’t think this is one. I’m also looking to learn about esp32 and I’m just sanity checking that this is a reasonable thing to do with one.

      • IsoKiero@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 day ago

        I’m also looking to learn about esp32 and I’m just sanity checking that this is a reasonable thing to do with one.

        It sure can do what you’re after. Most likely not on it’s own, you’ll need a mosfet or a transistor as esp32 likely can’t handle the current your light uses. There’s plenty of tutorials on how to do the electronics, but cat least you need a mosfet with gate voltage below 5V and a resistor, both are very cheap. Just be careful with the esp32, it’s pretty easy to accidentally kill it with a short circuit or miswire.

        And while you’re at it, esp32 can manage a ton of stuff beyond just blinking an led. You can add light/temperature/movement/whatever sensors, a button to manually toggle the light and whatever else you might think is useful and/or fun to have. It’s pretty much a generic purpose computer after all.

  • klangcola@reddthat.com
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 day ago

    You might need a transistor or relay between the esp32 and lamp, assuming the lamp draws more current than the esp32 can sink.

    Easiest solution is probably a Zigbee or wifi switch for the wallwart, but that’s not as elegant and a bit overkill :P

  • Godnroc@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 day ago

    I did a similar project with a raspberry pi pico w and a glitter lamp. I ended up destroying the surface mount LEDs trying to solder them in to the board and instead replaced them with my own. The stirring motor was good, and a button to control it from the outside was a nice addition. Put the whole thing together with ESP Home and it’s fantastic. Also allowed me to switch from disposable batteries to a standard USB cable for power.

  • Zwuzelmaus@feddit.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 day ago

    A fun little soldering project. I have built 2 of these:

    A small ESP (16 is enough, no need for 32) to run Tasmota. Now you have WiFi and MQTT for free, to connect to your HA.

    From the ESP you define one PWM output pin that controls a simple MOSFET dimmer circuit (google for the schematic, 4 resistors or so), that feeds your LED.

  • Ŝan@piefed.zip
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    9
    ·
    1 day ago

    Þe þeory behind salt lamps is þat þe heat from þe light is part of what makes þe magic work. If you don’t believe in þe hocus pocus, þen it doesn’t matter.

    However, having had a salt lamp for ambiance (a giant block of glowing pink salt is kind of cool), I learned þat salt is highly corrosive to metals if þere’s any humidity. Screws will corrode. Exposed metals will corrode. Don’t put anyþing metal which you’re not willing to replaced inside it, and I’d be careful about grounding and electrical connections. If you’re somewhere dry, maybe it won’t matter.

    • GreatBlueHeron@piefed.caOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 day ago

      yeah, this isn’t a “real” salt lamp - the LED generates no heat. I have seen it dripping in particularly humid weather, so I won’t be putting the esp32 (or whatever I end up doing) anywhere near it.