top of page

 best view in  HD 1080p   FULL SCREEN

Priject Name : How to use a MOSFET transistor as a switch.

 

Project Description :

A led is connected to MOSFET transistor via "Source" and "Drain". The controlled "Gate" connected to pin #2 on the Arsuino.

changing the "Gate" voltage in respect to the "Source" from 0V to 5V actuate the switch ON and OFF.

 

Components Needed :

1. K2645 MOSFET or any one you have on hand.

2. Any LED.

3. 330 and 10K Ohm resistors.

 

/*
How to use a MOSFET Transistor
Created Feb 26th 2015
By Yohi Zucker
This program is in the public domain
*/

int led=2;//led connected to pin 2

void setup() {
 pinMode(led,OUTPUT);
 /*
 The loop write to the pin (2) that is connected to the
 MOSFET Gate leg via 10K ohme.I used K2645 MOSFET .
  This is an N-Channel MOSFET.
 The Source connected to 0V (GND), The drain to the high voltage side.
 In this example, the high voltage is 5V from the Arduino for blinking
 the led, but you can connect a hugher voltage to operate different devices.
 */
 

}

void loop() {
  digitalWrite(led,HIGH);
  delay(50);
  digitalWrite(led,LOW);
delay(2000);
}

bottom of page