Elektronik | Funk | Software

Der Technik-Blog

  • Social Media


    New Posts


    • Keine zukünftigen Events vorhanden

    The Tech-Blog

    Arduino IRFZ44N PWM MOSFET Load Control

    Arduino MOSFET Control

    Alex @ AEQ-WEB

    Microcontrollers like the Arduino or an ESP are certainly the cheapest control components on the market. You can easily control loads with these development boards or microcontrollers. However, if you want to switch large loads such as electric motors or powerful lamps, you can not do this without additional electronics, because the maximum output current of most microcontrollers are 50 milliamperes.In this article, we talk about MOSFET transistors and how they can switch large loads or regulate the power of a DC motor.

    MOSFET vs. Relay

    Relays are relatively simple. This makes it possible to switch galvanically isolated circuits and, depending on the relay type, even very large loads. The problem with the relay is that you can only switch loads on and off, but not regulate them. But often you want to dim a long LED strip, or let a large DC motor start slowly. This can be controlled with PWM signals via a MOSFET. In addition, MOSFET transistors are much smaller and cheaper than relays. For large loads, MOSFETs can get very hot, which is why very large heatsinks are often needed.?


    What is a MOSFET

    MOSFET stands for Metal Oxide Semiconductor Field Effect Transistor and is used to switch high currents. Although the transistor today contains polysilicon, the name has remained the same. Basically, this is a high power transistor that can switch very high currents and voltages. The control voltages are usually also higher in contrast to normal transistors such as the BC547. There are N-channel and P-channel types, but N-channel MOSFETs are increasingly being used because of better internal resistance. The MOSFET has the following PIN designations:?

    • S (Source): The source pin is the input from the MOSFET. With an active gate, the source voltage corresponds to the drain voltage.?
    • The drain is the output that goes to the load and thereby controls the load.?
    • G (Gate): The gate (control electrode) is the control input from the MOSFET, which controls the current flow between source and gate.? ?

    MOSFET at Arduino

    Basically, the MOSFET can be connected to a digital pin of the Arduino without any additional components. The I/O pin is connected directly to the gate. The ground of the power supply and the Arduino is connected to the source pin of the MOSFET. The ground from the motor is connected to the drain. If the load is to be controlled with the positive pole instead of the ground, then a P-channel MOSFET must be used. In addition, a pre-circuit of an NPN transistor at the gate is required because the Arduino switches only a positive voltage at the I/O pin. Between the gate pin and the source pin is still a resistor, which ideally has a value between 1K and 10K. This resistor turns the gate to ground so that the MOSFET immediately shuts off after a voltage drop from the gate and stops pervading for a period of time.?

    Power control with PWM?

    Most microcontrollers have one or more I/O pins that can support PWM (Pulse Width Modulation). The power can be controlled with PWM over a MOSFET. This allows you to start an electric motor slowly, regulate the power of a heating coil or can dim a lamp. ?


    Arduino Source Code?

    The example code drives the MOSFET via the digital PIN 6. The Serial Monitor will enter a value between 0 and 255, which will then be sent to the PWM pin. The end user can then, as in our example, be an electric motor that runs at different speeds depending on the given value.

    int PWM_PIN = 6;
    int pwmval = 0;
    void setup() {
      Serial.println("Send a value between 1 and 255");
    void loop() {
      if (Serial.available() > 1) {
          pwmval =  Serial.parseInt();
          Serial.print("Set Speed to: ");
          analogWrite(PWM_PIN, pwmval);

    Info: This page was automatically translated and may contain errors

    About the Author

    Alex, the founder of AEQ-WEB. He works for more of 10 years with different computers, microcontroller and semiconductors. In addition to hardware projects, he also develops websites, apps and software for computers.

    Top articles in this category:

    Arduino LM358 PT1000 Sensor Converter

    PT1000 Converter for Arduino

    • Video
    • DE/EN

    PT1000 sensors can not be measured directly analog with a microcontroller. How to build a PT100 Converter with LM358 and Arduino?

    read more
    Arduino LCD Interface - TFT Display Elegoo

    Arduino LCD Interface

    • DE/EN

    On this page we show you how to create an interface for a TFT display with an Arduino. You can download source code and library here

    read more

    Social Media


    New Posts


    • Keine zukünftigen Events vorhanden