Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Seeed XIAO SAMD21 to MOSFET 241028

Hello ETO 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

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


The expected result was D1 would oscillate in the circuit
with the MOSFET the same as D1 oscillated in the simpler
circuit.

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
}
 

Attachments

  • XiAO_simple LED_241028.jpg
    XiAO_simple LED_241028.jpg
    27.2 KB · Views: 22
  • XiAO_transistor_LED_241028.jpg
    XiAO_transistor_LED_241028.jpg
    39.1 KB · Views: 23
The threshold voltage 2-4V means that this FET starts conducting weakly at max. 4V and is fully on at ~10V gate voltage.
You need a logic level FET.
The resistor and led are wrongly connected.
The resistor at drain should be at 5V and the led cathode at drain.
 

New Articles From Microcontroller Tips

Back
Top