Help/advise - amplifier auto switch

Hello,
I ran across this project on instructables and want to build something similar:

I have an amplifier based on this kit:

41Hz AMP32

So the instructables project uses an IR emitter to turn the amp off. I want to use a transistor to turn the power on/off.

I ordered the following parts:

DC Boarduino
N-channel power MOSFET - 30V / 60A

I am a new to this, so I appreciate any help. :smiley:

I want to power the arduino with the same power supply the amp uses. It's a Mean Well RS-25-12 (12V). I chose the DC Boarduino because it has a 5V regulator, this should work, right?

I want to use the transistor as it's used in this example:

http://itp.nyu.edu/physcomp/Tutorials/HighCurrentLoads

It is rated 30V / 60A, so I shouldn't have any problems switching 12V / 2A maximum correct?

Example 3.1 on that tutorial adds a diode, would I need a diode in my application? This is the explanation:

FInally, add diode in parallel with the collector and emitter of the transistor, pointing away from ground. The diode to protects the transistor from back voltage generated when the motor shuts off, or if the motor is turned in the reverse direction.

My last question involves this note on the instructables project:

I found it mandatory to use a load resistor on the A0 and A1 since when the Nova amplifier is off, the ADC on the Arduino is reading very random numbers. Using the load resistor to ground (10K Ohm) made the samples when amplifier is off to 0 (good!).

He is using the line-level output of his amplifier to measure for a signal, but my amplifier does not have a line-level output. I was going to split the input and run that into A1 and A0, but would it have a detrimental affect on the audio putting a 10k resistor across signal and ground?

In doing some more research it looks like running AC in the arduino's analog inputs is a bad idea. I guess I need this?

Thanks,
Jake

Is there a good reason you're not just using a simple relay?
http://www.mdfly.com/index.php?main_page=product_info&cPath=9_138&products_id=647\

$6 with cheap shipping....

According to data-sheet PA chip has two inputs, MUTE and SLEEP.
IDD,MUTE Mute Supply Current MUTE = VIH 5.5 7 mA
IDD, SLEEP Sleep Supply Current SLEEP = VIH 0.25 2 mA
Why do you need to cut off power? Wouldn't it be easier to put it in sleep mode?

MrSaveloy:
Is there a good reason you're not just using a simple relay?
http://www.mdfly.com/index.php?main_page=product_info&cPath=9_138&products_id=647\

$6 with cheap shipping....

I am only switching 12V/ <1A, if I understand correctly a $1 transistor should do it just fine. The relay is both more expensive and less reliable. If I were trying to switch more I would choose an SSR over a relay.

Magician:
According to data-sheet PA chip has two inputs, MUTE and SLEEP.
IDD,MUTE Mute Supply Current MUTE = VIH 5.5 7 mA
IDD, SLEEP Sleep Supply Current SLEEP = VIH 0.25 2 mA
Why do you need to cut off power? Wouldn't it be easier to put it in sleep mode?

That is a good point, but this project is only phase 1, I would eventually like to scale it to the following:

4 x T-amp guts
powering 4 zones of distributed audio in my house
audio source is an airport express / airtunes
in addition to auto on/off based on source, I would also like to write a small iOS app to turn the zones on and off individually

I would use the t-amp because they are cheaper and pre-assembled, but I already have an AMP32 I built to use for the test. I don't think the t-amp has a sleep pin.

O'K, than.

I want to use the transistor as it's used in this example:
Lab: Using a Transistor to Control High Current Loads with an Arduino – ITP Physical Computing

No you can't disconnect audio equipment like this, you need "high-side" switch:
http://ruggedcircuits.com/html/circuit__19.html
And

In doing some more research it looks like running AC in the arduino's analog inputs is a bad idea. I guess I need this?

also not good idea. Look at the schematic.

Thank you.

Would you mind explaining the diagram you posted? It looks like it is half the bridge rectifier (fix the AC problem), and this: "A capacitor from the input to ground will also smooth out the variations of the audio signal" I understand. What do the resistors do? Is a schottky diode specified just for the extra efficiency?

I am not questioning you, just trying to learn/understand.

Would you mind explaining the diagram you posted? It looks like it is half the bridge rectifier (fix the AC problem), and this: "A capacitor from the input to ground will also smooth out the variations of the audio signal" I understand. What do the resistors do? Is a schottky diode specified just for the extra efficiency?

No problem. There is just one rectifying diode (left most), instead of bridge. You should keep in mind , that your AC source is not completely isolated, like it shown on your diagram with bridge, where two wires mark by ~ sign coming from transformer. In audio one wire already connected
to DC side ( negative terminal - or ground). So if you use a bridge, only two diodes would work (left side), one rectifying positive half-wave to DC, and another shorting negative half-wave to ground and creating huge amount of distortion (even with resistor in series). This is why only one diode on my drawings.
Resistor in series with diode preventing input signal from distortion, that would otherwise generated due over-loading AC source by cap's charging current.
Resistor to ground help to discharge cap and form "time constant" of envelope detector.
Diode connected to ground is zener 5.1V, help to protect arduino inputs, could be omitted if AC source never goes higher 3 VAC.
Circuit is simple and isn't perfect, as it starting to operate when input at least 0.4V (this is why schottky, with regular Si diodes situation would be worse, 0.7V starting point).
There is one more envelope detector that doesn't have this shortcoming, build around transistor.

Thank you again, I really appreciate the help. I would have got this totally wrong by myself.

I bought all the parts at my local electronics shop. They didn't have the TIP137 PNP that is spec'd in the high-side driver diagram and sold me TIP125 as equivalent. I built the circuit and tested with 3V battery and LED and it works great, but when I hook up my 12V power supply & amp, it stays on all the time.

Do you think the problem is the TIP125 or something else?

They also didn't have a good selection of schottky diodes. The lowest forward voltage I could find was 0.57V.

It works, but the sensitivity kind of sucks. I think I will order these:

TIP125 looks fine for me. In the link I posted above there are two transistors high switch, what about second one?

The NPN is a NT2222. That is the same as what is spec'd, right?

2N2222/2N3904

Does this Schottky diode look good?

http://www.vishay.com/docs/93419/95sq015.pdf

No , diode is not good for this application - reverse current is too high 7 / 350 mA.
Use a transistor

Edited: Just came to my mind, you can build nice audio detector with IC LM3914 / 3915 / 3916

jvdb,

Amazing! I just purchased a house with 3 sets of speakers in the wall (3 zones) and though of the same project that you are working on right now. Originally I was thinking about picking up a multi-zone receiver and then using arduino to control it through IR, but those receivers aren't cheap.

I am curious how your project is coming along? I was planning on trying to pick up 3 T amps off of e-bay and using an arduino with an ethernet shield to control the distribution of audio through a web service using a relay to control the power to the amps.

Have you had any luck with your project?

lapith:
jvdb,

Amazing! I just purchased a house with 3 sets of speakers in the wall (3 zones) and though of the same project that you are working on right now. Originally I was thinking about picking up a multi-zone receiver and then using arduino to control it through IR, but those receivers aren't cheap.

I am curious how your project is coming along? I was planning on trying to pick up 3 T amps off of e-bay and using an arduino with an ethernet shield to control the distribution of audio through a web service using a relay to control the power to the amps.

Have you had any luck with your project?

Yes, I got the high-side switch working and just received parts for the revised envelope detector today.

I will post more information when I have something working.

FYI, The T-Amp guts are on sale until Nov. 1.

http://www.parts-express.com/pe/showdetl.cfm?Partnumber=300-385

I bought 4 of them. At $15/ea.

Something like this Mean Well is perfect for driving 3 or 4 T-Amps:

http://powersupplyemporium.com/product_info.php?products_id=2047

Magician:
No , diode is not good for this application - reverse current is too high 7 / 350 mA.
Use a transistor

Edited: Just came to my mind, you can build nice audio detector with IC LM3914 / 3915 / 3916

I think you are right about using something like LM3915. I have built both envelope detectors and the sensitivity is low. It wouldn't normally be a problem, but I would like to be able to use volume control in itunes (lowers line-level signal strength), and neither can detect anything once volume is lower than about 3/4.

I have a few more questions:
LM3915 is rated 3V to 25V, can I power it directly off the 5V pin of Arduino?

How would I detect signal from LM3915? (I assume using pin that would turn on 1st LED - Pin 10)

What is the difference between LM3914 and 3915? In the specs it looks like 3914 requires 25V and 3915 will take 3V to 25V:

http://www.mouser.com/ProductDetail/National-Semiconductor-TI/LM3914N-1-NOPB/?qs=sGAEpiMZZMsE420DPIasPlogyTiw5LxrgTmIYEf%252bZPw%3D
http://www.mouser.com/ProductDetail/National-Semiconductor-TI/LM3915N-1-NOPB/?qs=sGAEpiMZZMsE420DPIasPlogyTiw5LxrWuB82zseJTQ%3D

I wonder if this would also be a good solution?

http://sensors.circuitlab.org/2011/05/op-amp-based-sound-detector-circuit.html

I'm not sure what I'd need to change to make it work with line-level input instead of condenser mic..

I wander, that sensitivity you observed is low. Theoretically circuit with transistor is sensitive as analog input ( 5 mV ), as it's voltage follower. I didn't test it, the issue could be with high value base resistor (510 k), try to lower it to around 100 k or so. The would be some offset voltage present at the arduino input, but you can negotiate it subtracting in software , and set trigger threshold ~ 10/50 mV ( 2/10 count analogRead ) to stay away from noise .

LM3914 and LM3915 differ not much, except linear / logarithmic scale.
You can use any output pins, 1 - is most sensitive , 10 - is least. Inverse output (Low- active).
5 V should be o'k for power , taken from arduino board.

I wonder if this would also be a good solution?
http://sensors.circuitlab.org/2011/05/op-amp-based-sound-detector-circuit.html
I'm not sure what I'd need to change to make it work with line-level input instead of condenser mic..

Not so good, you can "adapt" it adding resistor instead of mic, and changing configuration of output transistor like in one transistor circuit. Basically, OPA IC would allow to reach higher sensitivity compare single transistor.

I tried an 80k resistor instead of 510k. This is what's going on:

Input plugged into ipod headphone jack.
with music paused analog pin reads value of 230
with music playing full volume, values of 260+
with music playing and volume less than 3/4 reads ~230 (same as paused/off)

Same with 80k resistor; paused/off value is 570, with music playing it is 700+, but less than 3/4 volume it still reads 570.

I don't know if it will help, I took pictures of my breadboard.



And transistor is...?
Violet wire is ground?
One blue wire is +5V, and other is input?

Sorry,
transistor is PN2222A

black is shield from line level input
red wire (row 1) is right channel line level input
violet is ground to arduino
blue wire (row 7) is 5v from arduino (collector)
blue wire (row 5) is to a0 (emitter)