Friday, 9 August 2013

Working with MOSFET


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.


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:Concerning Polarization:                                                   P-Channel                       N-Channel Another more known type of transistor, the BJT (bipolar junction transistor),  also has three terminals: Base, Collector and Emitter. The current to be supplied to the circuit, which will circulate between Collector and Emitter of the BJT, is controlled by the current of the Base terminal, unlike a MOSFET, which is controlled by the voltage. This is one of the main differences between them, causing a TBJ to be generally applied in circuits with a low value of current, and a FET not only for these ones but also for applications with higher values of power/current.Application Examples of MOSFETsOne of the most common applications for MOSFETs is on CMOS circuits (see the reference link at the end of this tutorial for more details). However, there are also others, for example:- Voltage Controlled Resistance- Power Switching Circuits- Frequency Mixers- Etc. Example: Turning a DC motor on with a MOSFET (MOSFET as a switch) and the Arduino.Components:Arduino Board MOSFET Transistor (N-channel) - 1 MOSFET Transistor (P-channel)- 1 DC motor (5V - 1A)Jumpers for Connection- 1 Resistor of 200 Ohms- 1 5V - 1A Source Hardware:

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