3
\$\begingroup\$

Please, bear with me, I'm a real rookie at electrical engineering. So please be easy on me. ;-)

I've got the following circuit. I have a 5 seconds HIGH / LOW interval on D5 and am seeing the voltage drop to near 0 and rise to 12V when measuring with my multimeter on the terminals of the speaker. Still, my Piezo speaker won't make a sound. When connecting it straight to the 12V source, it works as perfectly. What am I missing? Current at the source of the MOSFET I guess? But, why? Did I connect it wrong?

P.s. also tried connecting a LED with a 470 ohm resistor after the MOSFET, but that does not turn on either. And this also simply works directly on the 12V power source.

Circuit

\$\endgroup\$
  • 2
    \$\begingroup\$ You aren't using your MOSFET correctly. The connections are all wrong. For an NMOS, the so-called source terminal doesn't actually connect to the + positive source pin. In fact, the way you have it is a short-circuit since MOSFETs only block current in one direction. \$\endgroup\$ – DKNguyen Feb 18 at 21:42
  • 3
    \$\begingroup\$ Note that when you start CircuitLab using the button on the editor toolbar you can edit your schematic, press "Save & Insert" and an editable schematic will be saved in your post. No account. No screengrab. No image uploads. No background grid. \$\endgroup\$ – Transistor Feb 18 at 21:49
6
\$\begingroup\$

First, you should start by drawing the schematic in the "standard" way: from left to right. The first item should be the power supply and then the rest of the components.

Also try to isolate the circuits in small functional parts. I mean, one can suppose that the Wemos and the 7805 will work as expected.

So I would draw the schematic for your questions like this:

Your circuit rearranged

Here you will see that the N-MOSFET is not in the lower side so

First problem: You are using an N-MOSFET as a high-side switch

Changing the components, and placing the IRF520 as a low-side switch gives us this circuit

One option

However, the IRF520 if not guaranteed to work with 3.3V of the Wemos so it may or may not turn on. The Vgs of the IRF520 is between 2 and 4 volts, sometimes 2, sometimes 4.

To sum up:

  • Problem 1 Your IRF520 should be used as low-side switch
  • Problem 2 You will have to use a buffer for the IRF520 or use another transistor.
|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ Thanks for the suggestion on the "standard way" of drawing circuits! That's a useful side note and I did not know that. Also thanks for drawing me a new one, that clears up a lot. I'll be trying to switch my IRF520 to the low-side. Any chance you can explain to me why I measure a full 12V after the MOSFET and still get no current? I also notice that you changed one of the resistors to 100Ohms instead of 1K, should I replace that as well? I'll be trying all later, if it works I'll accept the answer! :-) \$\endgroup\$ – Ambidex Feb 19 at 7:23
  • \$\begingroup\$ Why did you decrease the 1000-ohm resistor to 100 ohms? \$\endgroup\$ – user253751 Feb 19 at 10:22
  • \$\begingroup\$ About the resistor, It was an error, since my point was about the position of the elements sorry about that. Thinking about it I would increase the resistance of it to 10K-100K in order to avoid lowering the voltage at the base when the D5 is high. About he 12V I am completely lost, sorry about it. but keep in mind that just placing the IRF520 on the lower side, do not fix the second problem: the wemos may fail to turn the mosfet on because of its 3.3V. \$\endgroup\$ – LaboratorioGluon Feb 19 at 12:16
  • \$\begingroup\$ Thanks @AngelGz for the tips. I’ll consider getting logic transistors. For now, I’ll first be adjusting my circuit based on your diagram. \$\endgroup\$ – Ambidex Feb 19 at 19:12
  • \$\begingroup\$ I blew my Wemos tonight 😞 So i cant verify the solution at this point. I’ll revisit this when I get a replacement. \$\endgroup\$ – Ambidex Feb 19 at 21:59
3
\$\begingroup\$

I see 2 problems:

  • You seem to be trying to use an N-channel MOSFET as a high-side switch. To avoid a complicated driver, N-channel MOSFETs are more easily used as low-side switches.

    (As commented by DKNguyen, the existing connections are wrong, even for a high-side switch.)

  • That MOSFET has a Vth of up to 4V. The Wemos D1 mini Lite documentation states that it has 3.3V logic level outputs. So you need a "logic-level" MOSFET, with a much lower Vth.

|improve this answer|||||
\$\endgroup\$
0
\$\begingroup\$

You could use a pull-up resistor divider on the MOSFET gate to say 10V, and use another transistor like a 2N7000 (yes, high Vth, but it doesn't have to sink much current), or even BJT 2N3904 or whatever, to pull the gate low (inverted). An opto-coupler also works.

Most logic-level MOSFETs for 3.3V with a 1V or less Vth are going to be surface mount.

|improve this answer|||||
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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