6v output with ESP32

Thread Starter


Joined Feb 9, 2021
Hey there,
For my project, I generate a pulse wave (3.3v), and that GPIO pin is connected to another device that needs 6v to work.

I'm having some troubles trying to get those 6v from my ESP32 3.3v/5v pin. I tried amplifying the output with 2N2222 and BC548 transistors, but I can't get it to work. All my designs so far, work for small signals, but get really distorted when the input is 3.3V.

So, I basically need a voltage gain of 2, with the only supply sources being 3.3v and 5v from the Vin pin. Is it possible? I just don't know what I'm doing wrong.

Thanks in advance!


Joined Feb 24, 2006
You do not need amplification. This is not a linear signal.
You need an open collector NPN transistor switch and a source of +6V on the board you are sending the signal to.

Edit: I'm feeling big hearted tonight. The transistor can be any convenient one that you have.
One more thing. Your GPIO signal is now inverted. When GPIO=HIGH (3.3V), the input to your board, IN=LOW(0.0-0.2V), and when GPIO=LOW(≈0V), then IN=HIGH (≈6V)


Last edited:

Thread Starter


Joined Feb 9, 2021
Thank you! It's working.
In the end, I changed some values and replaced the 6v with a 9v battery since I need it already to supply other things.

I guess I could add an opamp to invert the output but I don't think it's that necessary for this project in particular. I can easily get the same result by changing the code.

Thanks again, I was really stuck there.
Captura de pantalla (1841).png

Deleted member 115935

Joined Dec 31, 1969
Just to avoid confusion going forward,
You use the word amplifier,
as highlighted above,
this is logic so the transistor is either on or off,