Introduction
MOSFET or simply FET (MOS = metal-oxide semiconductor and FET = field effect transistor) is a type of transistor, a component used as a switch or an amplifier of electric signals.MOSFETs
A MOSFET usually has three terminals: Gate, Source and Drain. There are two essential types: N-channel and P-channel, which are basically different because of the polarization. The current to be supplied to the circuit, which will circulate between Source and Drain of the FET, is controlled by the voltage applied on the Gate terminal. This last one has a dielectric separation from the other two, generating therefore an almost-null current value on the Gate, and an electric field which influences in the Source and in the Drain. Below, we have these two basic types of FETs and their corresponding usual symbols:With a N-channel MOSFET:
With a P-channel MOSFET:
// Controlling a DC motor with a MOSFET transistor (basic application) for P-channel and N-channel// The motor used in this Firmware is of 5V - 1A// This hardware was not projected to control the sense of rotation of the motor (unless it inverts its polarity), only its speed.// Nevertheless, it can be controlled by a more elaborated hardware (an H bridge of MOSFETs for example)
#define GatePin 6 // Defines the pin to receive the signal in the Gate of the MOS
int GateSignal = 0; // Value that will be set in the PWM pin (0 to 1023) for controlling the speed of motor.
void setup ()
{pinMode (GatePin, OUTPUT); // Defines Arduino's pin 5 as an output}
void loop ()
{ while ((GateSignal <0) || (GateSignal >1023))
{ continue; }
analogWrite (GatePin, GateSignal); // But if it is in this range, the Arduino sends the signal to the "GatePin".}
Pay attention to the blue line of the code. In N-channel MOS polarization, the maximum rotation of the motor will be when the value of "GateSignal" is 1023 (therefore in N-channel the Gate terminal conducts with logic level "1"). However in P-channel, this rotation will be the maximum if the logic level of "GateSignal" is "0" (therefore in P-channel the Gate terminal conducts with logic level "0"). And the same happens with the minimum rotation.
No comments:
Post a Comment