N-Mosfet Logic Level not turning off completely

I am using a n channel mosfet to act as a switch for some audio which is passing through the drain source. Im powering the gate of the mosfet through a microcontroller running at 3.3v and it is turning on correctly and passing the audio, however, when no power is applied to the gate, the mosfet cuts out most of the audio but for some reason if the volume is loud enough, parts of the audio (usually the bass) still makes it through. is there any component i should add to the mosfet circuit to make sure that the circuit stays off when no power is applied to the gate? i tried a pull down 100k resistor on the gate and it didnt seem to change anything.

A MOSFET is not an ideal switch, like a relay. It can only stop current from flowing in one direction (from drain-to-source). Source-to-drain current passes through a diode built-in to the MOSFET and you cannot block it. Perhaps you can show us your schematic and we can suggest a more suitable component (like an analog switch, 74HC4066 or similar).

-- The QuadRAM shield: add 512 kilobytes of external RAM to your Arduino Mega/Mega2560

oh dang, i thought mosfets are used for audio switches…

I attached my schematic and it would be great if you recommended something else, but what i really want is something that doesnt drain the battery on my circuit much since im running off of a coin cell. it also has to be logic level so it can be driven by the microcontroller and hopefully use little to no current to keep the audio connected. im staying away from relays since they are high power (in the terms of my project) and bulky, something small and in the end, surface mountable, is the best.

thanks alot!

I'm wondering why you need an "audio switch" at all. Whether or not there is audio present at your audio jack, it shouldn't be causing your circuit to be drawing current if the input impedance is high (which it should be).

-- The Flexible MIDI Shield: MIDI IN/OUT, stacking headers, your choice of I/O pins

its a bit hard to explain, but in my project there is audio almost always coming in through the audio input. also generally there will be headphones or speakers plugged into the circuit also but i dont want the audio from the input to be outputed through the speakers until my microcontroller allows it through. i just want to be able to start and stop the audio output, irrelevant of the source audio. does that make sense?

It sounds like you should be controlling the output then, not the input. What are you using for an amplifier? Perhaps there is some way to turn that on and off.

A complete schematic would be very helpful ;)

-- The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons

okay i should probably explain it better. I pretty much gave the whole schematic for my project. Let me explain what the project is doing.

There is audio input coming in from a male headphone jack and I want to be able to create an output (female audio jack) that simply repeats the sound from the audio input. However, I want to be able to cut the connection between the male jack and the female jack by controlling it with a microcontroller. Since the male jack is receiving audio from a line out, i am directly connecting it to the female jack without any amplification or anything. Essentially this could be very easily accomplished with a switch - push the switch and the male and female jacks are connected, release the switch and the audio doesnt pass through- , but i need a digital alternative to make it work with the microcontroller and preferably a component thats small (so it can be surface mounted) and low power consumption.

thanks alot for your help!

I think an analog switch might be a good choice then. Something like this:


-- The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected

im not exactly sure how analog switches work, but do they use low power? i think for example a mosfet only requires current to change from not conducting to conducting but after that it uses no current? does the analog switch work in the same way? my project is running off of a coin cell so each mA is crucial

The analog switch I suggested draws only 1 microamp at room temperature.

-- The Quick Shield: breakout all 28 pins to quick-connect terminals

im not the best at reading data sheets but did you get that number from the Icc on the sheet?

thanks alot! i wonder if there is a through hole version of this switch for testing purposes

also is there any DIP version of this that has just 1 channel? all the DIP ones i see are quad channels and i really need a smaller ic (4-6pin) to fit into my prototype before i go smd.