Why use a mosfet here

Still learning laying out board (and electronics :slight_smile: )
. reading documentation on a SMT32 chip example to do this;

why use a mosfet in LED management ?? for such small size.
I could understand on large led(s) but here is a very small status led…
not sure why, can someone please explain ?


Could be just the habit, or personal prejudice, of the circuit designer.

Could be a need to conserve the drive capability of the “PC1” signal. MOSFET’s have lower steady-state drive requirements than BJT’s, but there should be a few hundred ohms of series resistance in the gate circuit to limit the capacitive inrush current.

Could be there was a leftover MOSFET in an array.


1 Like

More speculation here, microcontrollers not only have a per-pin current limit, but a total current limit. Perhaps using a mosfet here (which should have negligible gate current, that 1M resistor probably passes more current) is to preserve available total current available for other pins? Why waste power budget on an indicator light?

As @dchisholm mentions above, there could be many reasons, it’s difficult to comment on this particular example as we don’t have the rest of the schematic. The STM can drive +/- 8 ma on it’s GPIO pins, and up to +/- 20 ma with relaxed Voh/Vol specifications, and the LED in this example draws less than 6 ma, so technically it would be possible to drive the LED directly. But there may be other things to consider. We don’t know what “VIN” is but it is possibly the supply voltage before the regulator. In the case of many LEDs this would draw all of the LED current from the main supply and not add additional load to what might be a small LDO powering the STM32.

1 Like

What is this on ? What is VIN vs MCU Vdd ?
Is it on an Eval PCB ?

Possible reasons :
To have the LED current draw from 5V, to allow accurate MCU current reading.
To allow the pin to be used as IN, without a LED loading.

You do have to check that the MOSFET is guaranteed to turn on with a logic high, not certain as Vdd comes down

?? …

If Vdd of the SMT32 chip is lower than Vin if the circuit, Vdd (the maximum logic high possible from the STM32) might be below the turn-on threshold of the mosfet. That’s all the caution means.

Yes, of course, but “Vdd comes down” is what doesn’t make any sense. There is no Vdd on the schematic, if he his referring to Vdd of the STM32 it would have helped to be specific. But still, “comes down”? Vdd is what Vdd is and if it isn’t constant then the Vgs of the MOSFET is the least of the problems.

That is what I meant. The STM32 can operate at 2V, not enough to be certain to turn on several common mosfets. Level shifting requires some thought,.

He confirmed my suspicion. And it isn’t like we were provided with a full schematic. Even you brought that point up. We don’t even know which document the OP pulled that schematic part out of.

We are all speculating on very incomplete information. But that’s what is fun, isn’t it?

Agreed, but the OP’s question was

why use a mosfet in LED management

The circuit presented is perfectly valid if the components are properly selected. It could have been suggested that a BJT might be more applicable to this application but delving into a complete circuit analysis and component selection is not only not possible with the limited information but entirely beyond the scope of the OP’s question.

Hi guys thanks a lot for your help and many replies.
to add more details, it’s an evaluation board witch has an even more weirder ‘power plan’
it manages the battery charging and output with a mosfet again :slight_smile: —more on that to come later.
the chip itself has pretty basic needs. but the evaluation boards schematic will help me make sure I give it what it needs to work properly.
I’ll draw the power part soon as I have other questions for it too :slight_smile:
since it’s under nda I can’t share the original and need to redraw my own before sharing.

but the VIN comes from a 3.3v LDO (that comes from either usb/battery/VCC)
I think I should really post it in two or tree questions as it might become complex to reply to each small parts. (and it will hopefully help other starters like me to better understand shematics)

Careful there. Sharing only parts of the design, even if you re-draw them, may still violate the NDA. Because the design is under NDA I think your questions should probably go to the designers, not to an outside group of people (us). They may be doing something quite clever that they are testing out while and/or prior to submitting patents.

Thanks for the heads up. I got an nda for general stuff with them but I think this part of the board design is not so critical. (that’s part of their dev board)(witch I think if anyone asking about how to use it should receive a copy of what I have used to redraw and ask this questions) not so much about the main chip(witch is their bread and butter. but you are right. I’ll be careful. I`ll ask them tonight about what can be shared exactly.

I feel like they might laugh at me if I ask too much beginners questions and possibly loose interest…so I try to find my answers elsewhere first.

What color is the LED?

it’s blue… about as small as a 1206 or 0805… got to check physically but it’s small :slight_smile:
would that change anything ?


A red LED typically drops 1.8 volts, but voltage drop normally rises as the light frequency increases, so a blue LED may drop from 3 to 3.3 volts.

A human may not be able to see the LED illuminate in normal lighting with the specified R1 value and Vin.

Of course that changes things. It also casts doubt on ‘VIN’ being only 3.3 V. It more likely comes from the input of that LDO and is more likely to be 5V.

One of my last projects used a bought in CPU board with a three colour status led running off 3V3 I/O. The blue one could not turn on.

1 Like