Inverting PWM signal on RGB Light
Posted: Wed Jan 30, 2019 12:15 pm
Hello all, I'm testing the Light example
https://github.com/espressif/esp-mdf/tr ... _kit/light
I tried to compile this and attach an RGB in the Gpios and works great:
https://twitter.com/martinfasani/status ... 5026150400
And as I have a lot of P-Channel mosfets in my garage and RGB leds I though to make my own demo Lights.
So the idea was to receive the PWM signal in the documented GPIOS:
GPIO4 O PWM_R output control
GPIO16 O PWM_G output control; alternate UART interface (URXD)
GPIO5 O PWM_B output control; alternate UART interface (UTXD)
And use them to feed the gate of a Mosfet. The issue is, that this P-Channel mosfets that I have, are closed on HIGH (Also it will be turning off on high instead of ON )
So I though to ask here to the electrical minds more advanced than mine...What would be the best way to go ?
To invert the PWM signal and still use a P-Channel Mosfet ? (Is that possible to do in the ESP32)
To use a different Mosfet that will open on HIGH ? (Tell me what model so I will look in the datasheet)
Or just comment how you will do it or what is wrong in my approach. Basically I would like to use the PWM signal to control many leds instead of just one.
https://github.com/espressif/esp-mdf/tr ... _kit/light
I tried to compile this and attach an RGB in the Gpios and works great:
https://twitter.com/martinfasani/status ... 5026150400
And as I have a lot of P-Channel mosfets in my garage and RGB leds I though to make my own demo Lights.
So the idea was to receive the PWM signal in the documented GPIOS:
GPIO4 O PWM_R output control
GPIO16 O PWM_G output control; alternate UART interface (URXD)
GPIO5 O PWM_B output control; alternate UART interface (UTXD)
And use them to feed the gate of a Mosfet. The issue is, that this P-Channel mosfets that I have, are closed on HIGH (Also it will be turning off on high instead of ON )
So I though to ask here to the electrical minds more advanced than mine...What would be the best way to go ?
To invert the PWM signal and still use a P-Channel Mosfet ? (Is that possible to do in the ESP32)
To use a different Mosfet that will open on HIGH ? (Tell me what model so I will look in the datasheet)
Or just comment how you will do it or what is wrong in my approach. Basically I would like to use the PWM signal to control many leds instead of just one.