3
\$\begingroup\$

I am designing a circuit so that I can mute/unmute a microphone using an Arduino/Raspberry Pi.

I am using a CD4051 which is designed for controlling audio applications. The schematic is based off of this blog.

I am using a dual rail power supply with +9 and -9 V on the CD4051.

CD4051
pin 16 = +9 V
pin 7 = -9 V
pin 11 = audio select (low 0 V = active, high 9 V = inactive)

enter image description here

Because the Raspberry Pi GPIO pins use 3.3 V, but the CD4051 uses 9 V, I am attempting to use a IRLZ34N N-channel MOSFET as a logic-level converter.

Problem

This logic level circuit should allow a 3.3 V microcontroller to toggle a 9/0 V on the CD4051 (pin 11).

Yet when I prototype this circuit, I measure 3.3 V at pin mic_A (and pin 2 of the MOSFET). I've double checked my circuit, and even compared to this blog article.

enter image description here

This is how the circuit performs in the simulator (I am using 5 kΩ resistors instead of 10 kΩ, and using an IRLZ34N instead of a BS170)

What is wrong with this logic-level converter? Why am I not getting 9 V at pin mic_A?


Update

Why use an IRLZ34N?

Because thats the only TTL N-channel MOSFET I currently have.

Here is a photo of the prototype:

enter image description here

Update 2

After further experimentation, I was able to get this working and have the IRLZ34N to be switched with 3.3v logic.

However based on the comments, I have also learned

  1. BS170 is a better suited mosfet for this application since the IRLZ34N is intend for high current
  2. +9V/-9V is not required for the CD4051
  3. Logic Level Conversion is not necessary since the CD4051 logic can be controlled with 3.3v
  4. I should add bypass capacitors to the power rails of the CD4051

Video of working circuit: https://www.youtube.com/watch?v=3zxkHmgybTc

\$\endgroup\$
11
  • 1
    \$\begingroup\$ Use a bs170, not a irlz34. Two very different components. The cd4051 was not designed for audio applications - it just happens that being an analog switch will switch analog audio signals. There are better devices specifically for audio. \$\endgroup\$
    – Kartman
    Commented Oct 2, 2022 at 21:14
  • 1
    \$\begingroup\$ Would it be possible for you to upload a picture of your wiring? Out of curiosity, why are you using a high-power MOSFET for switching a logical input? \$\endgroup\$ Commented Oct 2, 2022 at 21:19
  • 2
    \$\begingroup\$ It looks like it should work. But the CD4051B will work with 3V logic input, so you don't really need the level shifter. It would be good to add bypass capacitors on the power supply rails of the IC, especially if you want to switch quickly. \$\endgroup\$
    – PStechPaul
    Commented Oct 2, 2022 at 22:29
  • 1
    \$\begingroup\$ Please measure the voltage on either side of the RH 10K resistor with control input 3.3V. Your breadboard looks a bit dodgy. \$\endgroup\$ Commented Oct 3, 2022 at 1:42
  • 1
    \$\begingroup\$ @PStechPaul You are right. I removed 9v and got this working on 5v only. Headphones I'm using are the ubiquitous iphone style earbuds, which should have a peak-peak of <3v. I replaced the 3.3v microcontroller with a 5v one and the IRLZ34N is now switching like I expect. (I know I've used 3.3 MC with that mosfet in the past). Without the 9v power the need for Logic Level conversion is moot. Video of circuit youtu.be/C-OuItKyJpg \$\endgroup\$
    – spuder
    Commented Oct 3, 2022 at 2:47

1 Answer 1

1
\$\begingroup\$

Checking the datasheets from both MOSFETS (BS170 vs IRLZ34) I see three main differences:

  1. Their \$t_{on}\$ and \$t_{off}\$ times, where the BS170 turns on in 10 ns (MAX). The IRLZ34 indicates a rise time \$t_r\$ of 100 ns (the datasheet does not indicate a specific \$t_{on}\$ rather a \$t_{d(on)}\$ or turn-on delay time of 8.9 ns (Typical))

BS170 schematic timings

  1. Their input capacitances. For the BS170, \$C_{in}\$ is 40 pF (MAX) while \$C_{in}\$ for the IRLZ34 is significantly higher at 880pF (Typical). Proving a slower response time from the latter.

  2. In terms of the \$R_{DS(on)}\$, the IRLZ34 outperforms the BS170, however, the test conditions and application scenario are abysmally different (low-voltage, low-current switching vs high-current switching).

These criteria are the ones proposed by Nexperia on its application note AN97055 for \$I^2C\$ Bi-directional level shifters:

Nexperia on MOSFET requirements for I2C shifters

Finally, this guide on MOSFETS parameters might help you to clarify all of these numbers.

The bottom line is: each type of transistor has its own application case.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ I think the signal is very low speed. The IRLZ34 should work, \$V_{gs(th)}\$ is max 2 V and it has much more than enough transconductance to switch signals at a measly 3.3 V gs. \$\endgroup\$
    – Oskar Skog
    Commented Oct 2, 2022 at 22:16
  • \$\begingroup\$ @OskarSkog that is correct, however, the higher input capacitance value might be preventing the MOSFET from fully turning on and/or for the CD4051 to register the logic level change. From personal experience, changing the type of component can make the whole difference. While these are similar technologies, their use case is different. Happened to me once using drop-in replacements from 2 Instrumentation Amplifiers on the same circuit obtaining completely different results simply due to their individual characteristics. Both chips were fully functional when testing them separately. \$\endgroup\$ Commented Oct 2, 2022 at 22:24

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.