{"product_id":"irf540n-mosfet-switch-module-1-channel","title":"IRF540N MOSFET Switch Module, 1 Channel, 9 to 24V DC Loads","description":"\u003cdiv class=\"nznpd\"\u003e\n\u003cdiv class=\"nznpd__lead\"\u003e\n\u003cp class=\"nznpd__intro\"\u003eA single MOSFET switch on a small board for turning a 12V or 24V DC load on and off from an Arduino, ESP32 or Raspberry Pi Pico. It suits LED strips, pumps, fans, small motors and solenoids, and it takes PWM, so you can dim a strip or set a motor's speed with analogWrite.\u003c\/p\u003e\n\u003cp class=\"nznpd__intro\"\u003eYour signal lights an optocoupler, and the optocoupler turns on the IRF540N from the load supply. So a 3.3V or 5V pin is all it needs, but the load supply has to be 9V or more. On a 5V LED strip or a 6V motor the MOSFET only half turns on and gets hot, so use our \u003ca href=\"\/products\/1-channel-5v-relay-module-with-high-low-trigger\"\u003e1-channel 5V relay module\u003c\/a\u003e for low voltage loads. It carries 3A continuously in open air at up to 24V. For bigger motors, or to run one in both directions, our \u003ca href=\"\/products\/bts7960-ibt-2-h-bridge-dc-motor-driver-module\"\u003eBTS7960 motor driver\u003c\/a\u003e is the step up.\u003c\/p\u003e\n\u003c\/div\u003e\n\u003csection class=\"nznpd__block\"\u003e\n\u003ch3 class=\"nznpd__h\"\u003eSpecifications\u003c\/h3\u003e\n\u003cdiv class=\"nznpd__specs\"\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eSwitch\u003c\/span\u003e\u003cstrong\u003eIRF540N N-channel MOSFET on the load's negative side\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eLoad supply\u003c\/span\u003e\u003cstrong\u003e9 to 24V DC, 12V or 24V suits it best\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eLoad current\u003c\/span\u003e\u003cstrong\u003e3A continuous with no extra cooling, 5A for a few seconds\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eControl signal\u003c\/span\u003e\u003cstrong\u003eS pin, HIGH turns the load on, 3.3V or 5V logic\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eControl connector\u003c\/span\u003e\u003cstrong\u003e3-pin latched header S, +, - (2.54 mm)\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eLoad connections\u003c\/span\u003e\u003cstrong\u003eTwo 2-way screw terminals: LOAD -, LOAD +, IN -, IN +\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003ePWM\u003c\/span\u003e\u003cstrong\u003eUp to about 1 kHz, so analogWrite on an Uno is fine\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eAlso fitted\u003c\/span\u003e\u003cstrong\u003eDiode across the load terminals for motor and coil kickback, indicator LED\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eBoard size\u003c\/span\u003e\u003cstrong\u003e47.9 x 30.4 mm, four 3 mm mounting holes\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\n\u003c\/section\u003e\n\u003csection class=\"nznpd__block\"\u003e\n\u003ch3 class=\"nznpd__h\"\u003eDatasheets\u003c\/h3\u003e\n\u003cdiv class=\"nznpd__ds\"\u003e\n\u003ca class=\"nznpd__dsbar\" href=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/MOD-IRF540-1CH-Datasheet-Rev1.pdf?v=1794855822\" target=\"_blank\" rel=\"noopener\" aria-label=\"Download the IRF540N MOSFET switch module datasheet (PDF)\"\u003e\n\u003csvg width=\"20\" height=\"20\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\u003e\u003cpath d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"\u003e\u003c\/path\u003e\u003cpolyline points=\"14 2 14 8 20 8\"\u003e\u003c\/polyline\u003e\u003c\/svg\u003e\n\u003cspan\u003eFull technical datasheet\u003c\/span\u003e\n\u003cspan class=\"nznpd__dsmeta\"\u003ePDF\u003csvg width=\"17\" height=\"17\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\u003e\u003cpath d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"\u003e\u003c\/path\u003e\u003cpolyline points=\"7 10 12 15 17 10\"\u003e\u003c\/polyline\u003e\u003cline x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\"\u003e\u003c\/line\u003e\u003c\/svg\u003e\u003c\/span\u003e\n\u003c\/a\u003e\n\u003c\/div\u003e\n\u003c\/section\u003e\n\u003csection class=\"nznpd__block\"\u003e\n\u003cdiv class=\"nznpd__qs\"\u003e\n\u003ch3\u003eWiring \u0026amp; getting started\u003c\/h3\u003e\n\u003cdetails class=\"nznpd__figbox\" open\u003e\u003csummary\u003eWiring diagram\u003cspan class=\"nznpd__codelang\"\u003eArduino Uno\u003c\/span\u003e\u003c\/summary\u003e\u003cfigure class=\"nznpd__fig\"\u003e\u003ca href=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/MOD-IRF540-1CH-wiring-uno.png?v=1794855822\" target=\"_blank\" rel=\"noopener\"\u003e\u003cimg src=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/MOD-IRF540-1CH-wiring-uno.png?v=1794855822\" alt=\"MOSFET switch module wired to an Arduino Uno: S to D9, + to 5V, - to GND; a 12V supply to IN - and IN +; the load to LOAD - and LOAD +\" width=\"690\" height=\"1112\" loading=\"lazy\"\u003e\u003c\/a\u003e\u003cfigcaption\u003eTap the drawing to open it full size.\u003c\/figcaption\u003e\u003c\/figure\u003e\u003c\/details\u003e\n\u003col class=\"nznpd__steps\"\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eConnect the load and the supply\u003c\/strong\u003e\u003cp\u003eThe terminals aren't labelled on the board, so hold it with the screw terminals at the top. The left pair is the load: LOAD - then LOAD +. The right pair is the supply: IN - then IN +. Use a 9 to 24V DC supply and tighten the screws firmly.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eConnect your controller\u003c\/strong\u003e\u003cp\u003eThe header reads S, +, - from left to right. S goes to an output pin (D9 on an Uno), + to 5V (or 3.3V on an ESP32 or Pico) and - to GND. Three female jumper wires push straight on.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eLoad the test code\u003c\/strong\u003e\u003cp\u003eUpload this sketch to an Uno. It switches the load on and off, then fades it up with PWM.\u003c\/p\u003e\n\u003cdetails class=\"nznpd__codebox\"\u003e\u003csummary\u003eExample Arduino code\u003cspan class=\"nznpd__codelang\"\u003eArduino C++\u003c\/span\u003e\u003c\/summary\u003e\u003cpre\u003e\u003ccode\u003e\u003cspan class=\"t-c\"\u003e\/\/ IRF540N MOSFET switch module test (MOD-IRF540-1CH).\u003c\/span\u003e\n\u003cspan class=\"t-c\"\u003e\/\/ Module S to D9, + to 5V, - to GND on the Uno.\u003c\/span\u003e\n\u003cspan class=\"t-c\"\u003e\/\/ Load supply 9 to 24V DC on the screw terminals.\u003c\/span\u003e\n\u003cspan class=\"t-k\"\u003econst\u003c\/span\u003e \u003cspan class=\"t-t\"\u003eint\u003c\/span\u003e \u003cspan class=\"t-v\"\u003eSIG\u003c\/span\u003e = \u003cspan class=\"t-n\"\u003e9\u003c\/span\u003e;  \u003cspan class=\"t-c\"\u003e\/\/ a PWM pin, about 490 Hz on an Uno\u003c\/span\u003e\n\n\u003cspan class=\"t-t\"\u003evoid\u003c\/span\u003e \u003cspan class=\"t-f\"\u003esetup\u003c\/span\u003e() {\n  \u003cspan class=\"t-f\"\u003epinMode\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003eSIG\u003c\/span\u003e, \u003cspan class=\"t-v\"\u003eOUTPUT\u003c\/span\u003e);\n}\n\n\u003cspan class=\"t-t\"\u003evoid\u003c\/span\u003e \u003cspan class=\"t-f\"\u003eloop\u003c\/span\u003e() {\n  \u003cspan class=\"t-f\"\u003edigitalWrite\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003eSIG\u003c\/span\u003e, \u003cspan class=\"t-v\"\u003eHIGH\u003c\/span\u003e);  \u003cspan class=\"t-c\"\u003e\/\/ load on\u003c\/span\u003e\n  \u003cspan class=\"t-f\"\u003edelay\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e2000\u003c\/span\u003e);\n  \u003cspan class=\"t-f\"\u003edigitalWrite\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003eSIG\u003c\/span\u003e, \u003cspan class=\"t-v\"\u003eLOW\u003c\/span\u003e);   \u003cspan class=\"t-c\"\u003e\/\/ load off\u003c\/span\u003e\n  \u003cspan class=\"t-f\"\u003edelay\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e2000\u003c\/span\u003e);\n  \u003cspan class=\"t-k\"\u003efor\u003c\/span\u003e (\u003cspan class=\"t-t\"\u003eint\u003c\/span\u003e \u003cspan class=\"t-v\"\u003eduty\u003c\/span\u003e = \u003cspan class=\"t-n\"\u003e0\u003c\/span\u003e; \u003cspan class=\"t-v\"\u003eduty\u003c\/span\u003e \u0026lt;= \u003cspan class=\"t-n\"\u003e255\u003c\/span\u003e; \u003cspan class=\"t-v\"\u003eduty\u003c\/span\u003e += \u003cspan class=\"t-n\"\u003e5\u003c\/span\u003e) {  \u003cspan class=\"t-c\"\u003e\/\/ fade up\u003c\/span\u003e\n    \u003cspan class=\"t-f\"\u003eanalogWrite\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003eSIG\u003c\/span\u003e, \u003cspan class=\"t-v\"\u003eduty\u003c\/span\u003e);\n    \u003cspan class=\"t-f\"\u003edelay\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e40\u003c\/span\u003e);\n  }\n  \u003cspan class=\"t-f\"\u003eanalogWrite\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003eSIG\u003c\/span\u003e, \u003cspan class=\"t-n\"\u003e0\u003c\/span\u003e);\n  \u003cspan class=\"t-f\"\u003edelay\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e1000\u003c\/span\u003e);\n}\u003c\/code\u003e\u003c\/pre\u003e\u003c\/details\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eCheck it works\u003c\/strong\u003e\u003cp\u003eThe load should come on for 2 seconds, go off for 2 seconds, then fade up. If it only glows dimly or the MOSFET gets hot, check the supply is 9V or more. With the load off, LOAD - still reads close to the supply voltage against IN -. That's normal, because the board switches the negative side, so measure across the load instead.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003c\/ol\u003e\n\u003c\/div\u003e\n\u003c\/section\u003e\n\u003cp class=\"nznpd__note\"\u003e\u003cstrong\u003eNote:\u003c\/strong\u003e DC only, 24V maximum. Never connect it to household power.\u003c\/p\u003e\n\u003c\/div\u003e\n","brand":"NZN Electronics","offers":[{"title":"Default Title","offer_id":67796158939232,"sku":"MOD-IRF540-1CH","price":6.49,"currency_code":"NZD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/HW197-MOSFET_01_hero-transparent.png?v=1794856968","url":"https:\/\/www.nznelectronics.co.nz\/products\/irf540n-mosfet-switch-module-1-channel","provider":"NZN Electronics","version":"1.0","type":"link"}