Electronic Components
- Home|
- Switch Control|
- IRF520 N-channel MOSFET Module
IRF520 N-channel MOSFET Module
Voltage: 0 - 24v Output load current: Less than 5A (At greater than 1A continuous load it is recommended that a heat-sink or PWM / or both be used to avoid overheating of the MOSFET) Arduino Pins (Mosfet Board): 5v (VCC) / GND (GND) / Pin (SIG) Using IRF520 Power MOS, you can control DC Motor speeds / led brightness using PWM control.
- Code
- Questions & Answers
- Specifications
basic Arduino Code for IRF520 N-Channel MOSFET Module
FUNCTION: The inbuilt LED and the Mosfet Ov (GND) output will fade up and down repeatedly If you open the Serial Port at 9600 Baud: You will see a text confirmation of the PWM value (0 - 255)
/* BASIC PWM Program for IRF520 MOSFET module *************************************************** WIRING: 5v pin on the Arduino to VCC on the Mosfet board GND pin on the Arduino to GND on the Mosfet board Pin 11 on the Arduino to SIG on the Mosfet board *************************************************** FUNCTION: The inbuilt LED and the Mosfet Ov (GND) output will fade up and down repeatedly If you open the Serial Port at 9600 Baud: You will see a text confirmation of the PWM value (0 - 255) */ int pwmPin = 11; // declare pin 11 as the pwm pin int pwmValue = 0; // pin 11 pulse rate (0 - 255) int pwmCount = 5; // the vale to count up / down // Setup runs once when you press reset or re- power the board void setup() { // Set the Serial line to 9600 baude Serial.begin(9600); // declare pin 3 to be an output: pinMode(pwmPin, OUTPUT); } // the loop routine runs over and over until it is re-programmed void loop() { // Start pin 11 at 0 analogWrite(pwmPin, pwmValue); Serial.print("PWM value: "); Serial.println(pwmValue); // change the pwmValue for next time through the loop pwmValue = pwmValue + pwmCount; // flip the count direction of the pwmCount to remain within (0 - 255) if (pwmValue == 0 || pwmValue == 255) { pwmCount = -pwmCount; } // wait for 50 milliseconds between counts (changes to count) // Change this number to alter the speed at which pwmValue is changed // a higher number equals a slower change to pwmValue delay(50); }
IRF520 N-channel MOSFET Module
It can be controlled directly with 5v logic signals from a micro-controller or TTL drivers. 3 Pins: VCC / GND / SIG (Connection instructions are in the comments at the top of the example code). Active High HIGH = On /5 volts at the SIG pin will turn the Mosfet ON LOW = Off /0 volts at the SIG pin will turn the Mosfet OFF However this module is best utilised via PWM (See Code Below)