ESP01 + IRFZ44N switch + external led
Posted: Sat Apr 04, 2020 6:37 am
Hello team, I need help with my configuration. I am trying to use one esp01 to turn on or off an external led using a mosfet IRFZ44N, however I am totally new to this world and I need assistance with that.
What is the exact scheme that I need to use? I don't have a pin board but I hame some female/male, male/male pin cables that I can use.
Can anyone please assist?
This is the code I am using:
Attached (sorry for the low quality and messy wiring) there's a picture of what I have tried
What is the exact scheme that I need to use? I don't have a pin board but I hame some female/male, male/male pin cables that I can use.
Can anyone please assist?
This is the code I am using:
Code: Select all
void setup() {
pinMode(2, OUTPUT); // Initialize the LED_BUILTIN pin as an output
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(2, HIGH); // Turn the LED on (Note that LOW is the voltage level
// but actually the LED is on; this is because
// it is active low on the ESP-01)
delay(1000); // Wait for a second
digitalWrite(2, LOW); // Turn the LED off by making the voltage HIGH
delay(1000); // Wait for two seconds (to demonstrate the active low LED)
}
Attached (sorry for the low quality and messy wiring) there's a picture of what I have tried