Something I just cannot grasp regarding Mosfets and PWM.

Thread Starter

DavidBean

Joined Jul 11, 2023
23
we have a lightbulb whose brightness is controlled via a PWM signal from 0-10v.

As arduino can only provide 0-5v pwm directly, we would have to apparantly use a logic level MOSFET to control full 0-10v signalling/brightness.

In a simplified way I am "imagining" this works like the following

We provide 0.1v from the arduino to the mosfet gate, which then actually provides 0.2v,
and thus when arduino provides 5v, mosfet actually gives 10v.

Is this how it works?

The common literature im finding online is such that the mosfets gate may need 10v to open, but then in this case, we would only get full brightness and not be able to achieve lower voltage signals...

I just cannot get my head around this
 

Papabravo

Joined Feb 24, 2006
22,064
That is not at all how a MOSFET works. What you describe is a linear model where the Drain to source voltage is 2 x the gate to source voltage. There are at least two problems with that view:
  1. MOSFETS are nonlinear devices.
  2. MOSFETS have a threshold gate to source voltage. Below the threshold that present a large resistance and conduct a very, very small current. Above the threshold the relationship is quadratic. That means that the drain current is proportional to the square of the gate to source voltage.
  3. There is an inversion. As the gate to source voltage rises, the drain current increases, and the drain to source voltage drops toward 0.
Don't know where you got your notions about how a MOSFET works, but I think you need to get some new reference material.
 

ElectricSpidey

Joined Dec 2, 2017
3,315
A logic level MOSFET doesn't need the full 10 volts to turn on.

One thing you need to understand about PWM is that the voltage is an "average" because of the nature of PWM being an ON/OFF process, And is normally described in terms of duty cycle instead of voltage.
 

Thread Starter

DavidBean

Joined Jul 11, 2023
23
A logic level MOSFET doesn't need the full 10 volts to turn on.

One thing you need to understand about PWM is that the voltage is an "average" because of the nature of PWM being an ON/OFF process, And is normally described in terms of duty cycle instead of voltage.
In terms of it being "normally" described in terms of duty cycle, it would be my own view thats distored things.

I read the lightbulbs brightness is controlled via the amount of voltage(which is used as a signal)

Now to adjust my mental grasp of this in relation to your comment.

If the PWM signal from arduino(5v) is "averaged" at half, IE 2.5v, then the mosfet(10v) would see half of whatever voltage it has readily available, IE 5v
Is this correct?
 

ElectricSpidey

Joined Dec 2, 2017
3,315
The PWM signal is "averaged" at 2.5 volts by having a 50/50 duty cycle. (on half of the time and off half of the time)

Then if the MOSFET supply is 10 volts the load will see an average of 5 volts.
 

BobTPH

Joined Jun 5, 2013
11,480
we have a lightbulb whose brightness is controlled via a PWM signal from 0-10v.
Often, LED drivers can be controlled by either 0-10V OR PWM. Perhaps you are misreading the specification.

Can you link to the document where you got this info?
 

Thread Starter

DavidBean

Joined Jul 11, 2023
23
Then if the MOSFET supply is 10 volts the load will see an average of 5 volts.
ElectricSpidey, Where you say the 5v average is generated simply by the MOSFET supply voltage(10v),
Papabravo states the "average" will be tgenerated by the Square of the source voltage.

This would mean different output voltage in most cases... what is missing here?

  1. MOSFETS have a threshold gate to source voltage. Above the threshold the relationship is quadratic. That means that the drain current is proportional to the square of the gate to source voltage.
  2. There is an inversion. As the gate to source voltage rises, the drain current increases, and the drain to source voltage drops toward 0.
 

Thread Starter

DavidBean

Joined Jul 11, 2023
23
Often, LED drivers can be controlled by either 0-10V OR PWM. Perhaps you are misreading the specification.

Can you link to the document where you got this info?
BobTPH, its just an example, can be replaced with Motor, etc.
Im trying to correctly grasp how mosfets are able to amplify a voltage signal, many of the videos and content i read says they can do it, but not really the details.
 

Ya’akov

Joined Jan 27, 2019
10,226
The point of PWM control is to manage the power delivered to something (light, motor, etc,) by altering the time the power supply is switched fully on. If you turn something on and off, with a switch that passes all the current or no current, the amount of power delivered to that thing will be the integration, over time, of the difference between how long it is on and how long it is off.

The PWM duty cycle is a description of the ratio of on to off, being expressed as the percentage of time it is on. If you use a PWM signal with a frequency much greater than the powered device's slew rate, that is, the ability to respond to being turned on and off, or in the case of, say, LEDs, our ability to perceive the on and off states, the result will be the equivalent of reducing the power by the inverse of the duty cycle.

So, a PWM signal isn't from 0-10V, it is some voltage (5V, say) in a pulse waveform, with a pulse width of an interval not less than 0 seconds and not more than the duration of the pulse according to its frequency. This is usually expressed as duty cycle which is a different view of the same thing.

The pulse train is sent edge-to-edge so if the duty cycle is 100%, the device will see the 5V (in our example). If it is 75% then 3.75V, 50% gets 2.5V, and so on.

[edited for typos]
 

Ya’akov

Joined Jan 27, 2019
10,226
BobTPH, its just an example, can be replaced with Motor, etc.
Im trying to correctly grasp how mosfets are able to amplify a voltage signal, many of the videos and content i read says they can do it, but not really the details.
There is no amplification, per se, in this case. The MOSFET is operating as a switch. In principle a fast enough electromechanical relay could serve the same function. The 5V would actuate the relay, and the larger supply connected through it's contacts would be used to power the load in a PWM fashion,
 

nsaspook

Joined Aug 27, 2009
16,266
BobTPH, its just an example, can be replaced with Motor, etc.
Im trying to correctly grasp how mosfets are able to amplify a voltage signal, many of the videos and content i read says they can do it, but not really the details.
Poor analogy time.
In this application a MOSFET is analogous to the handle of a wafer facet that only allows for full ON flow or OFF. A small force on the handle can control (via a mechanical advantage of a lever mechanism) a large force of pressurized water.
The amplification is not of the original signal getting bigger, the amplification of force is the control factor of 'handle' force to output flow.
 

Alec_t

Joined Sep 17, 2013
15,112
Im trying to correctly grasp how mosfets are able to amplify a voltage signal
For PWM they don't. They only turn current on and off.
If the gate-to-source voltage (Vgs) goes above a certain threshold (Vgsth) the drain-source path can conduct current. For non-PWM use that current can pass through a load resistor to produce a load voltage proportional to the current. The higher the resistance the bigger the voltage. Only a small Vgs change (above Vgsth) can produce a large current change and hence a large load voltage change. That's where you get amplification.
 

BobTPH

Joined Jun 5, 2013
11,480
BobTPH, its just an example, can be replaced with Motor, etc.
Im trying to correctly grasp how mosfets are able to amplify a voltage signal, many of the videos and content i read says they can do it, but not really the details.
You have a very basic misunderstanding of both PWM and of MOSFETs.

PWM has nothing to do with controlling voltage or current. Read and understand @Ya’akov post #9. It controls how much power is delivered by powering the the device a fraction of the time. The voltage and current (to a resistive load) remain the same as full power during the on part of the cycle and both are 0 during the off part of the cycle.

When using PWM to control a MOSFET to control a load it us turning on and off like a switch.

A MOSFET can also be used as a voltage amplifier, but that is an entirely different kind of circuit. In that usage the MOSFET is partially on all the time, with the current it passes being controlled by small changes in the gate voltage.
 

Thread Starter

DavidBean

Joined Jul 11, 2023
23
Ya'kov, thanks for the great description! its the type of post I needed.

nsaspook, I Dont see how its a bad analogy, My examples of both car lighbulb and motor are mentioned on many hobby forums, but the inner workings are not explained(only how to wire it up and make it work),
However I wanted to understand what exactly is going on
 

Thread Starter

DavidBean

Joined Jul 11, 2023
23
There is no amplification, per se, in this case. The MOSFET is operating as a switch. In principle a fast enough electromechanical relay could serve the same function. The 5V would actuate the relay, and the larger supply connected through it's contacts would be used to power the load in a PWM fashion,
Yes I understand now, somewhat an "illusion" of amplification from a point of view that an arduino cannot provide naturally >5v but we can achieve the bulb/motor full 10v worth via the mosfet
 

Ya’akov

Joined Jan 27, 2019
10,226
Yes I understand now, somewhat an "illusion" of amplification from a point of view that an arduino cannot provide naturally >5v but we can achieve the bulb/motor full 10v worth via the mosfet
Yes, but you have to be very careful with the word amplification which has important details to its meaning when dealing with transistors. All sorts of transistors can act as switches as well as amplifiers, but those two things are very distinct as you delve into them further.

So, yes, it looks like the MOSFET increases the voltage of the Arduino, but a closer examination reveals that it is much more like a relay, a remotely operated switch, for the purposes of this circuit. A relay can’t amplify but a MOSFET can. The relay turns on, there is no proportionality to the applied voltage, only a threshold.

In our circuit, the MOSFET shouldn’t have a promotional response. Ideally it turns on, full stop. It conduct everything fed to it minus the unavoidable loss caused by the RDS(on), the total resistance from Source to Drain when the MOSFET is fully turned on.

The MOSFET has a threshold, just like the relay, but it also has a range from where it will begin to conduct until where it is fully on, and in that range is acts like a variable resistor, changing output based on what is applied to the Gate. Mind you, this is all quite simplified and the details are important. But for the sake of this discussion, we can ignore that.

This need to fully turn on a MOSFET to get the expected output is actually a large part of the work in designing a good circuit. While it‘s not very difficult or complex, it can plague neophyte designers who aren’t clear on the details and can’t figure out why the MOSFET they carefully chose is so anemic.

In any case, rather than amplify we can see can say the MOSFET controls a larger signal with a smaller one, just like a relay. You may not know that relays were invented in the first half of the 1800’s to… wait for it… relay signals for telegraph systems. When the signal would get weak due to distance, a sensitive relay would be used to regenerate it much in the same way the MOSFET in our instant case is being used to make the Arduino’s signal stronger.

So there you have it—you are correct about appearances but keep your eyes on the ideas behind the curtains, that’s where the real understanding will be found.
 

nsaspook

Joined Aug 27, 2009
16,266
Ya'kov, thanks for the great description! its the type of post I needed.

nsaspook, I Dont see how its a bad analogy, My examples of both car lighbulb and motor are mentioned on many hobby forums, but the inner workings are not explained(only how to wire it up and make it work),
However I wanted to understand what exactly is going on
Any time you start to use water to explain electrical science you're on a bumpy road to confusion. To understand 'exactly' requires quite of bit of knowledge not directly related to electronic technology. To understand sufficiently to design with MOSFETS is a much better goal.
 

Jon Chandler

Joined Jun 12, 2008
1,568
Nobody has really talked about Pulse Width Modulation (PWM) here. I suggest you search for a PWM tutorial.

The mosfet input gets either a low signal (0 volts) or a high signal (5 volts) from the microcontroller. A low signal turns the mosfet off (i.e., thr load sees 0 volts) and a high signal turns the mosfet on (i.e., the load sees 10 volts).

Low = lamp off

High = lamp on.

Let's say we modulate this signal at a speed faster than the eye can see.

If we send the mosfet a square wave (on for a fraction of a second, off for the same fraction of a second), the bulb is on half the time and off half the time. It appears to be half as bright.

If the bulb is on for a longer period and off for a shorter period, it appears brighter. If the off period is longer than the on period, it appears dimmer. The on/off ratio is called the duty cycle.

Duty cycle = 100% --> bulb fully on

Duty cycle = 0% --> bulb off.

Note the the eye is highly non-linear, and it will take so large changes to duty cycle for the change in brightness to be evident.

SmartSelect_20230711_084557_Edge.jpg
 

crutschow

Joined Mar 14, 2008
38,389
Below is a sim that may help:
It shows the PWM duty-cycle of the control signal driving the MOSFET (green trace) going from low to high, with the corresponding current through the LED (red trace) doing the same.
The average current is shown by the low-pass filtered voltage across the resistor (yellow trace)

1689091114516.png
 
Top