12v Monochromatic light with esphome

Im trying to setup a 12v single color strip LED with monochromatic light for dimming.

How can I go about this on an ESP32?

I tried positive to positive of the PSU and then - to the ESP32 GPIO19 and then gave the ESP a common ground to the PSU aswell.

Then powered the ESP off USB but it seems to have killed me ESP.

Do I need some kind of current limiting? Whats the best way to go about this?

Thanks in advance.

You need a 12V to 5V step-down converter and a PWM MOSFET with a control voltage of 3.3V.
Connect Esp32 to inverter power supply 5V and GNG, GPIO Esp32 to PWM control, PWM power supply 12V and GND, PWM output to LED and GND.
GND must be common for Esp32 and PWM.

Ok here an update.

I got one of these

IRF520 MOSFET field-effect transistor drive module | ePartners NZ

And it worked well, monochromatic light worked well however, both the FET and the LED strip got so hot, it melted the plastic roll that it was on, and the FET started burning.

So, I see the FET is only rated at 5A, I was power 2M of led strip at full brightness and I plan to power 12M of LED strip in total.

Im using a 12v 20A PSU

My questions.

  1. Why did the LED strip get so hot?
  2. Roughly what kind of current am I looking at for running 12M (2x 6M strips). 240LED /m 3014 white.

I have bought all 3 of these, not sure which is best to use but im guessing the highest current one.

Thanks