1
\$\begingroup\$

I am trying to create an Arduino based music synthesizer. How can I safely generate line level output (+/- 2 volts centered at zero, with a frequency range from 20Hz-20KHz) from my Arduino using a minimal number of components? This is what I imagine the flow will look like, but please correct me if this is wrong.

  • Generate a sine wave tone using a DAC (I'm doing this already using MCP4725)
  • Level shift the signal -2.5 volts and lower gain

  • To perform level shifting I think I need to generate a negative 5 volts to supply to a dual supply op amp, but I'm not sure if this is correct

There is a lot of confusing/mixed information on line level requirements. I hooked up the output jack of my macbook pro to an oscilloscope and generated a square wave. It looks like the macbook pro puts out -2 to 2 volts, so I think this is where my target output voltage should be.

Edit: My target output voltage is 1.25VRMS, since I am using a QSC PLX3602 amplifier with an input sensitivity of 1.25VRMS.

Some questions:

  • How many milliamps do I need to be able to source for line level
  • Given that I am going to be outputting square waves (which can sometimes damage speakers), is there anything I should keep in mind? I am planning on matching my amplifiers RMS wattage rating with the speakers RMS rating. Do square waves produce higher current than RMS?
  • Can anyone recommend a schematic or components I can use to accomplish the signal conditioning needed to do this safely/without damaging audio equipment?
\$\endgroup\$
1

1 Answer 1

2
\$\begingroup\$

To perform level shifting I think I need to generate a negative 5 volts to supply to a dual supply op amp, but I'm not sure if this is correct.

It's much simpler than that. Just add a DC blocking capacitor in series with the output. We'll calculate the value in a moment.

It looks like the macbook pro puts out -2 to 2 volts, so I think this is where my target output voltage should be.

See Wikipedia's Line leve for more on this but that will be plenty.

How many milliamps do I need to be able to source for line level?

Use Ohm's law. You'll need to find the input impedance of what you are driving but it's usually > 10k so current drain won't be a problem.

Given that I am going to be outputting square waves (which can sometimes damage speakers), is there anything I should keep in mind? I am planning on matching my amplifiers RMS wattage rating with the speakers RMS rating. Do square waves produce higher current than RMS?

You're getting mixed up. An RMS measurement allows comparison between different waveforms. If they have the same RMS value then they will have the same heating effect or power as each other or a DC current of the same value.

The problem with squarewaves is that they are high in harmonic content and, theoretically, these continue up to infinity. You can get an understanding of this from the Fourier transform of a squarish wave.

enter image description here

Figure 1. Fourier transform from time domain to frequency domain. Source: unknown to me.

Can anyone recommend a schematic or components I can use to accomplish the signal conditioning needed to do this safely/without damaging audio equipment?

schematic

simulate this circuit – Schematic created using CircuitLab

The capacitor and amplifier input will form a high-pass filter. (Think: it blocks DC which is 0 Hz.) The cut-off value is determined by \$ f_c = \frac {1}{2 \pi RC} \$. You can read more and find a calculator on Learning Electronics.

\$\endgroup\$
7
  • \$\begingroup\$ My amplifier's input sensitivity is 1.25 Vrms at 8 ohms. Does this mean I need to be able to source 156 mA (1.25/8)*1000? \$\endgroup\$
    – circuitry
    Commented Jan 31, 2018 at 19:06
  • \$\begingroup\$ Surely the 8 Ω refers to the amplifier output impedance? \$\endgroup\$
    – Transistor
    Commented Jan 31, 2018 at 19:24
  • \$\begingroup\$ Hmm I'm looking at qsc.com/resource-files/productresources/amp/plx2/…, for PLX3602. It says "input sensitivity at 8 ohms", but it also says "input impedance 10 kohms unbalanced, 20 kohms balanced." \$\endgroup\$
    – circuitry
    Commented Jan 31, 2018 at 19:31
  • \$\begingroup\$ In that event it seems like I would do (1.25/10k)*1000, and the current would be 0.125 mA. I am going to be driving a 4 ohm speaker though so I'm not sure if that would change things. \$\endgroup\$
    – circuitry
    Commented Jan 31, 2018 at 19:33
  • \$\begingroup\$ That figure is telling you that you will get the rated output into 8 Ω speakers with that level on the 10 kΩ input. Your ear has a logarithmic response to volume. Double the volume requires ten times the power. Turn the volume down and plug it in. Given that you're generating the sound from an Arduino I'd say you or your audience aren't going to listen to it for very long so I wouldn't waste too much time on the calculations. \$\endgroup\$
    – Transistor
    Commented Jan 31, 2018 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.