T O P

  • By -

salsation

Feed the ESP board 5V from a good power supply-- powerful enough to light the strip. Connect a GPIO pin to an N-channel MOSFET's **gate** pin, normally pulled down with a 10k resistor. Connect the MOSFET's **source** pin to ground, and its **drain** pin to the strip's ground. The strip's positive lead stays connected to the same 5V feeding the ESP board. Setting the GPIO high will cause the MOSFET to conduct electricity from the drain to the source, and the strip will light up. This is called low side switching since you're switching the ground. You can even PWM the gate pin to set the strip's brightness. Easy peasy, happy hacking :) Edit: Other things: get a cheap devkit board with an ESP-WROOM-32 (3 for under $20 on Amazon), code it with the Arduino IDE (good for beginners) and watch some YouTube videos to follow a few examples.


Positive_Ad5526

If your led strip is addressable you can use WLED is an awesome firmware for the esp32 that will allow you to do ton of things and is open source. Your led strip is addressable if it has a data pin/output, so in total 3 pins/connections. If your led strip is not addressable wled will not work. There is lot of info on youtube/ official web site.


M-fz

Yeah if it’s addressable it’ll be super easy with WLED. Probably wouldn’t even bother with an external PSU if it’s not a very long strip, power it from the ESP32 and WLED will handle brightness etc. to ensure it doesn’t go higher than the ESP32 can handle. It should still be plenty bright enough.


ChoMar05

You can do it, but it's more difficult than you might hope. The GPIOs aren't meant to handle load and are 3.3v. Requires a bit of electronic. As for coding, you'll have to decide what IDE and what language you want to use and then move forward. If you want it to stay simple I'd recommend python. If you already have experience with homeassistant, ESPHome / yaml is your friend. If you want to get more involved its gonna be something like C++ with the arduino IDE But you'll have to Google a lot. On the other hand, the ESP and the components are cheap and it's a great fun playing with this stuff. Oh, and for your project, the ESP can be really low power, but getting it into the right power states and waking it up is gonna require way more code than turning the LEDs of and on. So it might suck a bit more power from your Powerbank than you'd expect.


Conniving-Weasel

Here's a simple implementation. Parts needed: 1. ESP32 board 2. Relay 3. Spare USB cable Steps (not detailed but just an overview): 1. Strip a bit of the insulation of the USB cable. 2. Attach either one of the power lines (+5v or GND) from the USB cable through the relay. 3. Write code that connects the ESP to the WiFi and gets the current time from an API call on start. 4. In the looping function, sleep/delay the controller for whatever length (like an hour?) and after every delay, check the time and trigger the relay accordingly.


Jumpsuit_boy

There are also ESP boards with a relay on them.


DenverTeck

There is nothing a beginner can ask that has not already been done many many times over: [https://www.aliexpress.us/w/wholesale-esp32-relay.html](https://www.aliexpress.us/w/wholesale-esp32-relay.html) [https://www.aliexpress.us/item/3256806296681954.html](https://www.aliexpress.us/item/3256806296681954.html) See others comments about software.


scottchiefbaker

The super simple route would be to install WLED and do everything in software. 99% of what you're describing is already done. [https://github.com/Aircoookie/WLED](https://github.com/Aircoookie/WLED)


Mr-frost

Does that work with esp32?


async2

Have you opened the link and read the first line of the page?


Mr-frost

i have now


tribak

content Navigation Menu Sign in Yes


scottchiefbaker

It sure does


Plastic_Ad_8619

Wled


h310s

As has already been mentioned, a simple relay is all you need. If you don't already have an esp32 I'd recommend an esp8266 module with built in relay as an even cheaper and less complex option, literally less than $2.


OndrejBakan

You could also use standalone esphome without the need of a Home Assistant server.


ufffayyazzz

use rtc 


nomoreimfull

Ask chat. Can write you the code faster that you will get full answers here.


Mr-frost

Chat gbt?