rooster
Posts: 100
Joined: Thu Aug 02, 2012 8:09 pm

audio output ac or dc

Wed Nov 13, 2013 4:11 pm

I want to use the audio out to control a relay (yes I know this isn't the best way but I am using the Pi to prototype something else) which controls the power to a device.

Is it possible for the audio output to output a DC voltage? If I make a wav file with a +32000 to -32000 sin wave, I get a tone. If I make a wav file with +32000 I get no sound (as expected) but would I get a constant voltage? - or is the audio out AC coupled?

R

rfasenmyer
Posts: 3
Joined: Wed Nov 13, 2013 3:34 pm

Re: audio output ac or dc

Wed Nov 13, 2013 4:21 pm

Audio is in the form of a sine wave so that translates to an AC signal. You could use a bridge rectifier http://en.wikipedia.org/wiki/Diode_bridge to turn AC to DC but the audio voltage would have to be greater than the voltage drop caused by the diodes in the bridge rectifier.

User avatar
Burngate
Posts: 6290
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: audio output ac or dc

Wed Nov 13, 2013 6:06 pm

Have a look at the schematic - http://www.raspberrypi.org/wp-content/u ... .2_027.pdf
The audio output circuit is Image so, yes, it's AC coupled.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: audio output ac or dc

Wed Nov 13, 2013 6:46 pm

It should be possible, however the Pi's output is weak so audio amplification would be required and a diode tank circuit to store any electrical charge (as shown below).
From the tank circuit the stored charge (from C2) would be connected to the relay's transistor driver circuit.

Image

Richard S.

rooster
Posts: 100
Joined: Thu Aug 02, 2012 8:09 pm

Re: audio output ac or dc

Fri Nov 15, 2013 10:50 am

thanks for the above replies

I'll try and put together something over the weekend!

R

User avatar
r4049zt
Posts: 113
Joined: Sat Jul 21, 2012 1:36 pm
Contact: Website

Re: audio output ac or dc

Fri Nov 15, 2013 11:36 am

The schematic posted above showed blocking capacitors in the audio output line, so it is ac only.
I think you'd be better off using one of the GPIO pins.
Look up how to program your pi to set one of those.
If you can get it to light an LED with 470 ohms in series below then you have a controllable voltage which can switch the base of a transistor such as a BC635 with its emmiter to ground, collector to relay coil, and relay coil to some external power supply such as a 6V 4xAA battery. From here you should be able to hear the click of the relay but check it with a multimeter first.

If you can switch the relay from the GPIO then you could activate the air raid siren or whatever else it is that you have to connect to the relay. A car battery and headlamp bulb might be a sensible demo.

Return to “Automation, sensing and robotics”