ESP32-powered 24v attenuator

Thread Starter

snolahc

Joined Nov 9, 2022
2
Hello everyone.

I'm stuck with something that feels very easy but that, in fact, destroys my mind.
I got a 24V power input. I want to modulate it to a 0-24V output, with an ESP32 microcontroller.

I can have a Pin going from 0 to 3.3V.

What i try to achieve is :
- When my Pin is 0V, my power output is 0V.
- When my Pin is 3.3V, my power output is 24V.

I've tried IRL540N transistor and a bunch of others, but for reasons i don't achieve this result. For now i can go from 0 to 2.2V, which is weird, compared to the datasheets.

Someone could please put me on the right way, right documentation/wiki so i get to understand where i get it wrong and how to achieve it ?

Thanks a lot !

snolahc
 

LowQCab

Joined Nov 6, 2012
2,650
Does the 24-Volt Power-Supply use the same Ground as the ESP-32 Power-Supply ?,
or, must they have separate Grounds ?

How much Peak-Current will be drawn from the 24-Volt Power-Supply ?

Does the Current need to be limited as well as the Voltage ?

Are You building a "Bench-Power-Supply" ?, if not then
what does the 24-Volt Supply provide Power for ?
.
.
.
 

Thread Starter

snolahc

Joined Nov 9, 2022
2
Hello :)
Thanks for your reply !

Does the 24-Volt Power-Supply use the same Ground as the ESP-32 Power-Supply ?,
or, must they have separate Grounds ?

How much Peak-Current will be drawn from the 24-Volt Power-Supply ?

Does the Current need to be limited as well as the Voltage ?

Are You building a "Bench-Power-Supply" ?, if not then
what does the 24-Volt Supply provide Power for ?
.
.
.
+24V and ESP32 share the same ground.
I guess modulating voltage is enough, as the powered device will always have the same resistance.
The aim is to modulate brightness of a white analog LED strip, max 1A, from the ESP32.
This circuit seems so simple that i become crazy not achieving it :/ I read about NPN/PNP, Bipolar/MOSFET transistors, and i feel more lost than before :3
Thanks :)
 

seanstevens

Joined Sep 22, 2009
164
Isn't that the same as saying you want to use PWM to vary the brightness of your LED strip that takes a maximum of 1A?
If so, search for a low Vgs MOSFET that can handle a few amps and feed the PWM into its gate via a 10R resistor or so and your strip would be in series with the MOSFET and 24V.
Search for PWM LED with ESP and you will find a lot of circuits that may give you an idea.
 
Top