I would like to switch an analog signal on and off at 10 kHz using an Arduino microcontroller. I have found the below diagram which shows a MOSFET used for switch analog signals. In place of the shown MOSFET I would be using an IRL540 because that's what I have in stock. This below diagram does not mention which point is Gate and which source and drain. I am not an electronics person, need help identifying these points.

enter image description here

I got this image here, but the original source I had seen at some point but didn't find again.

My Arduino is 5 V Arduino Nano.

Edit: Purpose of all this effort? I am trying to make a liquid level sensor. This sensor would have two electrodes. Both electrodes would be connected to Arduino 5V Pin. I need individual switches on the connection of these electrodes to the 5V pin via switches, so that I can program the microcontroller to supply voltage to one electrode at a time, alternating. On the electrode side, these electrodes would also be connected to an Analog Read Pin on the Arduino, through switches of course so that at a time one electrode's potential is being read by the analog pin, alternating. The idea is that these electrodes would be submerged in water. When 5V is being given to the first electrode, the second electrode would be connected to the Arduino analog read pin. Then when it alternates and the 5 V is now connected to the 2nd electrode, the first electrode would get connected to the Arduino analog read pin. If the water level changes between the electrodes, it would be read on the Arduino monitor via the change in voltage.

  • \$\begingroup\$ Please follow site guidelines, and reference where the diagram came from. It would also be helpful to provide more details on what you are trying to achieve: input voltage range, input source impedance, load impedance, logic levels used by your Arduino (5V or 3V3). In terms of the symbol, have a look at page 2 of this NXP doc nxp.com/docs/en/application-note/AN211A.pdf on FETs (of similar vintage to your diagram), which shows you how gate, source, drain and substrate map to the device symbol. \$\endgroup\$
    – colintd
    Nov 8, 2023 at 9:08
  • \$\begingroup\$ I suggest you do an on-line search for "How to read a MOSFET symbol ?" \$\endgroup\$
    – citizen
    Nov 8, 2023 at 9:10
  • 1
    \$\begingroup\$ Most MOSFETs have a body diode from drain to source; this one has an isolated body diode (as is found in transmission gates) so you need to use one with this feature for this application. An alternative is to use back to back MOSFETs so the body diodes do not conduct when the channels are off. \$\endgroup\$ Nov 8, 2023 at 9:14
  • \$\begingroup\$ Something like a 4066 cmos bilateral switch would be my first choice for switching audio, not a power mosfet. \$\endgroup\$
    – Kartman
    Nov 8, 2023 at 12:35
  • \$\begingroup\$ @Kartman It isn't Audio. I'll expand my question to give you an idea what I am trying to do. \$\endgroup\$
    – John Snow
    Nov 8, 2023 at 13:07

3 Answers 3


The 2N4352 FET shown is a 4-terminal type that can be used in either direction. It’s not generally available anymore, nor could you switch it with an Arduino as the gate voltage must be more positive than your highest analog voltage (they show 15V.)

The IRL540 could be used, but you need two of them back-to-back to defeat the parasitic diode.

But that still doesn’t solve the gate drive problem as your gate voltage has to be above the analog signal + threshold voltageb Since you mentioned switching 5V, you’d need 7V minimum.

Plus, it’s a big, expensive device for power applications. It’s not a good choice.

Two p-channel devices back-to-back could do this. These can switch 5V with a 5V logic level.

Best choice? Consider a CMOS analog switch instead, such as a CD4066.


Yeah, you can switch this MOSFET at 10kHz using an Arduino microcontroller. You can consult the IRL540 datasheet for the pin configuration. It's an N-channel MOSFET, so it's suitable for your application. In the provided image, the "Signal in" represents the drain, "Signal out" is the source, and "Control" is the gate.

enter image description here

Just like this image. However, since the Arduino operates at a 5V logic level, your PWM control may only reach 5V instead of the specified 15V. Ensure that your input signal voltage remains below 100V for safe IRL540 operation.

Additionally, it might be necessary to add a gate-to-source resistor to ensure the proper turn-off of the MOSFET. Refer to the mentioned blog for an understanding of why a gate-to-source resistor is required.

Blog Link: https://tahmidmc.blogspot.com/2013/02/n-channel-mosfet-high-side-drive-when.html


An IRL540 will not work in this role.

The shown image is a four terminal MOSFET. You can't buy these anymore.

If you want to block bipolar signals with FETs, you'd either have to use a JFET or two MOSFET, plus a little bit of conditioning circuitry.

You can also buy CMOS analog switch ICs, which integrate this functionality.

  • \$\begingroup\$ ok, thank you, I will look up these ICs. \$\endgroup\$
    – John Snow
    Nov 9, 2023 at 4:29

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.