0

Hi there I got quite a project on my end I am using a mosfet specifically IRF4905 now the I want to turn on a 12 volts LED using this

I have the following materials

12v power supply pi pico w 12v LED IRF4905 10k Resistor

Wiring is as follows enter image description here

now base on what I read and research (I don't know if I understand correctly) to turn ON the mosfet you have to supply the gate a 0v and to turn it off you have to supply 2v or higher (again I'm not sure correct me if I am wrong)

now my code looks like this

from machine import Pin
import time
# Initialize GPIO 0 as an output pin
gpio_pin = Pin(0, Pin.OUT)

# Function to set the GPIO pin to high (3.3V)
def set_pin_high():
    gpio_pin.high()
    print("GPIO pin is set to 3.3V")

# Function to set the GPIO pin to low (0V)
def set_pin_low():
    gpio_pin.low()
    print("GPIO pin is set to 0V")

while True:
    set_pin_high()
    time.sleep(1)
    set_pin_low()
    time.sleep(1)

i don't know what is wrong but when I test the negative wire and positive wire of the out to LED still having 12v on the reading

1 Answer 1

0

The simple answer to your question is it won't work.

To explain requires an understanding of MOSFET operation and the limitations of the Pico which can only output 0/3.3V. You need >12-2V to turn it off and <12-Vgs to turn it on.

It IS possible with additional circuitry but frankly you would be better to look for a more conventional solution.

1
  • thank you for your comment I go for additional circuitry, I've updated my circuit schematics since I understand more for mosfet high side switching
    – Snow Angel
    Commented Aug 6 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.