MOSFET for little project

Hello,

i'm new on this forum ( so sorry if the question is already answered I try to find a similar one but didn't succeed )

Here is my problem, i'm relatively new on Arduino ( some skill learned at school but electronic was not the main subject , so we made some stuff without really do things nicely, like powered component from GPIO )

But I want to improve my skills and I started a little project : A connected alarm using an ESP32

The components of the project are the followings :

  • a Piezzo ( between 4v and 8v to run and need 25mA )
  • 2 Led ( one red and one green )
  • 2 Switch ( a "normal" one and a magnetic one )

So basically I used the 5v Output of the ESP32 to directly power the led ( with some resistor )
And I want to use it to power the Piezzo but I need to run the piezzo only when the magnetic one is triggered

So for that I think about using a MOSFET N type but Im a really big newbie on that stuff and I learned a lot about it but I think I miss some part

I selected one : https://asset.conrad.com/media10/add/160267/c1/-/en/000160861DS01/fiche-technique-160861-infineon-technologies-irf1324pbf-mosfet-1-canal-n-300-w-to-220ab.pdf

After a long research, and following these informations :

VDSS 24V -> Enough for my 5v supply
RDS(on) 1.2mOhms/1.5mOhms -> low enough not to lose too much
And a VGS(th) between 2v and 4v -> low enough to be triggered by 3.3V GPIO

So here is the question I am doing right or I miss some information ... Im not full confident on my choice or at least on the way I choose it

Like I succeed to read the technicals data sheet ( I think ) : https://asset.conrad.com/media10/add/160267/c1/-/en/000160861DS01/fiche-technique-160861-infineon-technologies-irf1324pbf-mosfet-1-canal-n-300-w-to-220ab.pdf

But definitely failed reading the graphicals part !
Like the Fig 1. Typical Output Characteristics with Tj = 175C is my MOSFET will reach this temperature or is it just the graph showing me how it will react on this temperature ahah ?

Sorry If I made mistake on my question ( missing something ) as I say its my first post here, but let me know how I can improve myself !

Thanks a lot for your help I really want to improve myself on doing thing right and cleanly and not following bad practice just to get quick and bad result in time !

These are MOSFETs that I often use:

Make sure you can solder the form factor you choose.

Search for a "logic level" mosfet.

Adafruit has this one: https://www.adafruit.com/product/355
Sparkfun has this one: https://www.sparkfun.com/products/10213

A few notes:

  • Can you power your whole project with 5V ? That is easier.
  • The characteristics of a mosfet can change a lot when it gets warm. The 175°C is the limit that is important for circuits that can push it to its limits (not your circuit).
  • A 30A mosfet for a 50mA load is okay, nothing weird about that. But a mosfet might have a leak current.
  • A mosfet needs a resistor to its gate (for example 1kΩ) and a resistor to keep the gate off during reset and power-up (often 10kΩ).
  • Normal NPN transistors are not a bad choice, sometimes a better choice than a mosfet.

Most mosfets are fully on at about 9V gate voltage, the one that you selected have a lower voltage, but it is better to have a bunch of "logic level" mosfets. For small currents, probably any random mosfet will work.

If you want to output 25kHz to keep cats and dogs out of your garden, then you need to step up your design, because that is not easy to do.

I might be wrong but my ESP32s have 3V3 volts from the port not 5V. It will still drive the LED but your resistor value will be lower. You can use a transistor or MOSFET to drive the buzzer. The MOSFET you chose will probably not work, the Vgs (Voltage gate to source) is not at the 3V3 point. Putting a resistor from the gate to ground will act as a voltage divider if you also connect it to the port pin with a resistor. Always put the pull down resistor at the port pin.

The bar graph just shows what to expect, that parameter is also guaranteed to be met by the OEM. You can use the voltage drop across the MOSFET and Ohn's law to determine how hot it will get. The package will dissipate a given amount of power as watts per degree C, that is the temperature rise. Remember to add ambient temperature to that to determine the actual temperature.

I disagree with you on the last statement you are doing it properly, you are doing the research, and admit your lack of experience and knowledge. Some people say a mistook is FAIL which actually means Forward Action In Life.

thanks I will take a look on it !

Yeah I think I could by using a power supply of 5V and 1A ( directly connected to the wall )

Okay thanks for all your informations so whats the main difference between using a NPN transistor and a MOSFET ( Mosfet are just logic-level transistor ? Or did I understand wrong )

Yeah I saw that too !
I think it should be better to get a 5v External power supply and power the whole circuit with ( including the ESP32 ) what do you think ? ( I found one adapter to connect directly to the wall electrical outlet, but its say 5v and 1A is this enough to power the whole circuit ? )

Oh okay so even if my pin provide like 3.3v, with the gate resistor it will divide this value, so it could not be enough to activate the MOSFET ?

Wow thanks for these information ! This help me a lot !

Yeah I try to thanks !

1 Like

A normal NPN transistor is not the same as a MOSFET (and is not the same as a vacuum tube :rofl: ). They are build in different ways.

A transistor needs a base current, which is amplified to the collector current. It is a current amplifier.
A mosfet needs a gate voltage, and can drive larger currents. It is a fluent controller of current.

In your project with small currents, the end result will be the same for a transistor or mosfet.

Small transistors have trouble with higher currents and mosfets have trouble with high frequenciess and they can leak current. Have you heard of a IGBT ? That is a combination of a transistor and a mosfet, trying to get the best of both worlds.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.