Mosfet

This module switches a high current load using a high power transistor. Unlike a mechanical relay, this is capable of high speed switching for use with PWM.

Output: This module lets you control devices operating at a maximun of 24VDC with an Arduino pin. To wire the module, connect the power supply for your device (max 24 V) to the V+ and GND terminals. Connect the device to M+ and M-. Be aware of your circuit’s polarity, you could damage your components if it is not wired correctly.

Module Description: This module features an IRF520 power MOSFET transistor, a kick-back diode, a standard TinkerKit 3pin connector,a signal amplifier, a green LED that signals that the module is correctly powered and one yellow LED whose brightness depends on the input signal received by the module.

Available methods

TKMosFet mos(O0);
on() switch the MosFet on
off() switch the MosFet off
state() return the value of the current MosFet state
write( value ) passing HIGH or LOW value switch the MosFet on and off
passing an analog value from 0 to 1023 you can vary the PWM duty cycle

 

// include the TinkerKit library
#include <TinkerKit.h>
 
TKMosFet mos(O0);         //create the mos object
TKPotentiometer pot(I0);  //create the pot object
 
void setup() {
  //nothing here
}
 
void loop() 
{
  int val = pot.read(); //assign to a "val" variable
                        //the potentiometer values

  mos.write(val);       //assign the values to the mosfet
  
  delay(10);            //rest for 10 milliseconds.
}