I am designing a circuit so that I can mute/unmute a microphone using an Arduino/Raspberry Pi.
I am using a dual rail power supply with +9 and -9 V on the CD4051.
pin 16 = +9 V
pin 7 = -9 V
pin 11 = audio select (low 0 V = active, high 9 V = inactive)
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.
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.
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
Why use an IRLZ34N?
Because thats the only TTL N-channel MOSFET I currently have.
Here is a photo of the prototype:
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
- BS170 is a better suited mosfet for this application since the IRLZ34N is intend for high current
- +9V/-9V is not required for the CD4051
- Logic Level Conversion is not necessary since the CD4051 logic can be controlled with 3.3v
- I should add bypass capacitors to the power rails of the CD4051
Video of working circuit: https://www.youtube.com/watch?v=3zxkHmgybTc