Seeed XIAO SAMD21 to MOSFET 241028

Thread Starter

allenpitts

Joined Feb 26, 2011
182
Hello AAC forum,

This is not an Arduino microcontroller question but the Seeed XAIO SAMD21
is Arduino compatible, that is, it runs sketches written in the
Arduino IDE so it is hoped that this query will fit in this category.

Working with the Seeed XAIO SAMD21 to operate a
MOSFET AUIRF540Z by Infineon.

To make sure the sketch is correct a simple test circuit
XiAO_simple LED_241028.jpg
was breadboarded: XIAO_simple LED_241028.jpg
The circuit works as expected.
Sketch copied herewith below.

The MOSFET was added
XiAO_transistor_LED_241028.jpg
XiAO_transistor_LED_241028.jpg
The expected result was D1 would oscillate in the circuit
with the MOSFET the same as D1 oscillated in the simpler
circuit. But the actual result was D1 does not blink.

It is surmised that the XIAO pin 3 does not provide enough
voltage to saturate the MOSFET Gate. A review of the
AUIRF540Z data sheet indicates that the GATE Threshold Voltage
is between 2 and 4 volts. Since the XIAO pin 3 output
is measured at 3.3 volts it is thought that the output from
pin 3 should drive the LED.

What am I missing?

Thanks.

Allen Pitts


Code:
/*
241028
XIAO to transistor Tester. Turns on one LED.
 */

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize output pins.
  pinMode(3, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(3, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(2000);            // wait for two seconds
  digitalWrite(3, LOW);   // turn the LED off by making the voltage LOW
  delay(2500);            // wait for a two and a half seconds
}
 

panic mode

Joined Oct 10, 2011
4,873
as be80be stated, there is no power source in the LED circuit.
1730161725919.png

but that is not the only problem.
next issue is polarity. this is an N channel mosfet so S need to be connected towards negative side so for circuit in previous post to work Source and Drain would need to be reversed, otherwise you would see LED light up continuously due to internal diode in MOSFET. but you would not be able to control it.

the next problem is that this MCU seem to be really a 3.3V unit internally (it has LDO to drop from 5V to 3.3V). . if so then its outputs will never be able get higher than 3.3V (even though you power it from 5V supply). but for common Drain configuration, that would not work at all, specially since this transistor requires larger Vgs voltage (at least 5V, see the graph... data below 4V is not even shown...). well... that would be to really put this transistor to some good use. it may work well enough to light up an LED if wired correctly (keep reading...)
1730162529803.png
so in common Drain configuration, Vg and MCU output would need to be this 5V, plus the Vf of the LED, plus voltage drop across resistor... so at least some 6-7V. and clearly this is not going to work since MCU output is barely able to reach 3.3V.

you need transistor that can be triggered by lower voltage ....AND ...you must wire it in a common Source configuration (LED in drain circuit).

but that also means that LED polarity need to change, like this:
1730162343699.png
 
Last edited:
Top