Manage Portable Speaker Power From Arduino

In my arduino project I have a music shield that outputs to a 3.5mm jack. After experimenting I've decided to use portable speakers such as the XBoom rather than do my own amp circuit etc.. However, since these speakers will be inside my robot I don't want to turn them on/off every time. Is it feasible to replace the portable speaker's on/off switch with a MOSFET that the arduino could control? I have never used a MOSFET but it sounds like it does this.

Why do you think that you have to turn the speakers on and off?

You mean like to turn off the speaker's battery power?

CrossRoads:
You mean like to turn off the speaker's battery power?

That is correct. I want to turn on the speakers when my arduino powers up. Otherwise every time I want to use them I have to open my robot up and switch the on/off switch which would be pretty lame.

P-channel MOSFET between Battery and speaker +power would do it.
What's the battery voltage? Additional NPN may be needed if >5V.

CrossRoads:
P-channel MOSFET between Battery and speaker +power would do it.
What's the battery voltage? Additional NPN may be needed if >5V.

I'll have to check the voltage. The rechargeable battery is integrated into the speaker. My hope is that I can remove the switch and solder some wires off the speaker onto a pcb board where the MOSFET will be.

CrossRoads:
P-channel MOSFET between Battery and speaker +power would do it.
What's the battery voltage? Additional NPN may be needed if >5V.

It looks like it's 3.7v. The speaker wasn't difficult to take apart so I was able to replace the on/off switch with two wires that I run out of the speaker. I acquired a couple SparkFun p-channel mosfets "FQP27P06" which look like they should work. I'm going to do a bit more reading first, but it sounds like I will attach an Arduino pin to the Gate, the positive from the speaker to the Source, the negative to the Drain, and make a common ground. Does this sound about right? My expectation is that when I send HIGH to the Gate that the speaker will turn on.

I was able to get this working but I had to use an N channel MOSFET. I connected the arduino to the gate, the speaker's vcc to the source, and the ground to the drain. Then after making a common ground with the arduino I can power on by sending a High to the gate. There is also a 10k pull down resistor on the gate.

Upon further testing my initial setup was not working. I rewired to match the setup described in this article. However, then I found when I plugged the audio cable into the EMIC2 it got a ground ignoring the MOSFET presumably since the EMIC2 shared the same ground. So, I required my EMIC2 such that it's ground also went to the MOSFET tying the two together. This seemed to work except now when I unplug the arduino my speaker makes a repeated clicking feedback sound which I can't explain. If I could figure this out I think I would be good, but I don't even know where to begin with this issue. My only guess is I need a diode somewhere but based on that article the feedback it mentions should only be for a quick moment which sounds different than the continuous sound I'm getting. Any advice is appreciated.

Any number of strange effects can occur when an audio amplifier is powered on and off. Professional power amplifiers attach the speakers only when the supply voltage is stable, to prevent damage to the speakers by transient currents.

I wanted to circle back and post what ended up working in case anyone else is trying to do this. I used a relay instead of the mosfet which allowed me to isolate the two circuits. This resolved a number of problems due to a floating ground. The image doesn't show it but the audio cable goes between the Emic2 and the speaker.