Running a 5V MOSFET with a 3.3V MCU?

Thread Starter

LikeTheSandwich

Joined Feb 22, 2021
164
TL;DR: Can I make some sort of differential voltage read with an MCU and some basic components, such that MCU with output LOW would result in a reading of 2.5V, but MCU output HIGH would result in 5V on the gate pin? This is using a 3.3V MCU (and a separate 5V power supply) and basic components such as resistors, capacitors, and diodes.

I have a MOSFET that I'm going to use for a synthetic load tester like the one seen here. Based on my testing I need to operate the MOSFET I have between 3V and 5V. I was planning on just using an RC low-pass filter to make an effective voltage. I have AVR 5V MCUs (Arduino Nano, Uno, ATtiny85), but the analog read/write resolution on these (at least as far as I've seen) is 10 bits or less. I'd rather use something like my SAMD21 based boards which can go up to 12 bits in some scenarios, but they only output 3.3V. I know of opamps and MOSFET drivers, but I really have no money to spend right now. Is there any way this can be done with just resistors, capacitors, and diodes, of which I have plenty? I was thinking about if I used some high value resistors to make a voltage divider of some kind, then connect 5V to the gate then to some resistors to an output on the MCU then pull the MCU low, the MOSFET might read 2.5V, and then as I raised the output it would raise up the gate voltage?

EDIT: Or is there a differential mode one the SAMD21 chip such as QT Py and Seeduino Xiao, or even on the RP2040 (I have a couple RP2040 boards)?
 
Last edited:

Alec_t

Joined Sep 17, 2013
14,314
Without an op-amp and an accurate voltage reference only an approximation of a constant-current and/or constant-voltage would be possible IMO, because the properties of a MOSFET (or other semiconductor device) are temperature-dependent.
So, what are your load requirements (A,V) and allowable tolerances?
Which MOSFET?
 

BobTPH

Joined Jun 5, 2013
8,964
Agree with @Alec_t . The gate voltage on MOSFETs for a given current varies way too much to control current with gate voltage. You need a proper opamp circuit with feedback to do this, especially since you want better than 10 bit accuracy.

Bob
 

Sensacell

Joined Jun 19, 2012
3,448
The project that the OP refers to seems to utilize a software driven control loop to generate the actual gate voltage / current.
A Hall effect device measures the current, this signal is fed into an ADC input, the output is a PWM signal that gets integrated into a DC gate voltage.

Seems like it could work, but would be very slow in the face of a rapidly changing input.
 

Thread Starter

LikeTheSandwich

Joined Feb 22, 2021
164
The project that the OP refers to seems to utilize a software driven control loop to generate the actual gate voltage / current.
A Hall effect device measures the current, this signal is fed into an ADC input, the output is a PWM signal that gets integrated into a DC gate voltage.

Seems like it could work, but would be very slow in the face of a rapidly changing input.
I won't have a rapidly changing input, slow changing like batteries.

Agree with @Alec_t . The gate voltage on MOSFETs for a given current varies way too much to control current with gate voltage. You need a proper opamp circuit with feedback to do this, especially since you want better than 10 bit accuracy.

Bob
The MCU will handle the feedback and adjust the PWM duty cycle accordingly.
Without an op-amp and an accurate voltage reference only an approximation of a constant-current and/or constant-voltage would be possible IMO, because the properties of a MOSFET (or other semiconductor device) are temperature-dependent.
So, what are your load requirements (A,V) and allowable tolerances?
Which MOSFET?
Allowable tolerances, probably relatively high, I don't need to be super accurate. I forgot the other reason I want to use SAMD21 is it actually has an analog output so I don't the low pass filter.
 

Thread Starter

LikeTheSandwich

Joined Feb 22, 2021
164
If you lack a source of voltage high enough to drive the gate, a charge pump circuit might be the answer.

https://en.wikipedia.org/wiki/Charg...is a,while being electrically simple circuits.
I have a separate voltage source that is high enough, I'm wondering if I can control that with a 3.3V MCU somewhat easily and with parts I have lying around. I did just find some logic level converter chips though so I'll probably just use that with an RC low pass filter.
 
Top