Getting +/-5v audio signals into the Teensy 3.x analog inputs

Status
Not open for further replies.

adamski

Active member
Hi all

I'd like to get modular synth audio signals into a Teensy for processing (pitch detection) but I'm green when it comes to electronics. Currently thinking I need to offset the +/-5v to 0-10v, then voltage divide that down to 0-3.3v. Is this correct, and is there a way of doing this without a -5v reference?

I'm looking at this schematic from the Ornament and Crime module for its CV inputs, however that seems to be using a -5v reference from the eurorack power source, and I am trying to avoid that at this stage - I am powering the Teensy from USB and if its not too complicated I want to keep it that way whilst prototyping the code.

Does anyone have an example of such an offset circuit, or how to calculate one? I have some of the MCP6004 op-amps as used in the O&C module.

Thanks in advance !
 
Thanks Paul, that not-as-good way you linked to looks like a good starting point. Note in this instance I want to get audio input in rather than CV, if that makes a difference.

I was just looking at this schematic for an offset circuit:
yIERi.png
(from endolith's answer at http://electronics.stackexchange.com/questions/5315/how-to-read-an-audio-signal-using-atmega328)

...and starting to learn how to use Circuits Cloud to try things out.



Yep, that opamp circiut is the good way to do it, especially if the offset is a highly stable & accurate reference voltage.

This would be the not-as-good way...

https://www.dorkbotpdx.org/blog/paul/control_voltage_cv_to_analog_input_pin

More detailed discussion is here:

https://forum.pjrc.com/threads/28423-Audio-Adaptor-Board-to-manipulate-cv-signal
 
Last edited:
I've attempted to combine your not-so-good offset and scaling schematic with a 16hz high-pass filter:
Screen Shot 2017-01-08 at 00.26.17.jpg
 
Last edited:
Hi all

I'd like to get modular synth audio signals into a Teensy for processing (pitch detection) but I'm green when it comes to electronics. Currently thinking I need to offset the +/-5v to 0-10v, then voltage divide that down to 0-3.3v. Is this correct, and is there a way of doing this without a -5v reference?

I'm looking at this schematic from the Ornament and Crime module for its CV inputs, however that seems to be using a -5v reference from the eurorack power source, and I am trying to avoid that at this stage - I am powering the Teensy from USB and if its not too complicated I want to keep it that way whilst prototyping the code.

Does anyone have an example of such an offset circuit, or how to calculate one? I have some of the MCP6004 op-amps as used in the O&C module.

if you want to omit the +/- 12 V bus, you'd have to bias the op-amp* differently, like so:

fig4.png

that's the circuit used at the O&C outputs, rather than inputs. in that case, V_out = - (R2/R1)*V_in + (1+R2/R1)*V_bias. R1 is typically/conventionally 100k ("high" impedance), so for a 10V input range, you'd pick R2=33k. the trick then is to come up with V_bias, which needs to be ~ 1.24V (= (1 + 33k/100k)*1.24V = 1.65V). in this case, a simple voltage divider should do: e.g., using the 3.3V supply, 49k9 and 30k would get you fairly close (= 30/(30+49.9)*3.3).


*you'll need a rail-to-rail one, so MCP6004 is fine; you'd power it off 3.3v so the teensy is protected from over-voltage.
 
if you want to omit the +/- 12 V bus, you'd have to bias the op-amp* differently, like so:

View attachment 9341

that's the circuit used at the O&C outputs, rather than inputs. in that case, V_out = - (R2/R1)*V_in + (1+R2/R1)*V_bias. R1 is typically/conventionally 100k ("high" impedance), so for a 10V input range, you'd pick R2=33k. the trick then is to come up with V_bias, which needs to be ~ 1.24V (= (1 + 33k/100k)*1.24V = 1.65V). in this case, a simple voltage divider should do: e.g., using the 3.3V supply, 49k9 and 30k would get you fairly close (= 30/(30+49.9)*3.3).


*you'll need a rail-to-rail one, so MCP6004 is fine; you'd power it off 3.3v so the teensy is protected from over-voltage.

Thank you, that is super helpful. Much appreciated.

I will be powering it off the 12v bus eventually, when I get round to installing the AD7367 I'm planning to try out for the CV inputs which needs 11-15v power.. (Need to get my SMT soldering skills up to scratch first!!)
 
Thank you, that is super helpful. Much appreciated.

I will be powering it off the 12v bus eventually, when I get round to installing the AD7367 I'm planning to try out for the CV inputs which needs 11-15v power.. (Need to get my SMT soldering skills up to scratch first!!)

note the schematic doesn't show the low pass / capacitor in the feedback path (it's value will depend on the sampling frequency; in case of OC: 560p ~ 8.6kHz cut-off / 16.7kHz Fs); also that's the kind of (DC-coupled) circuit you'd use for CV inputs rather than audio; i guess it'll do for testing purposes, but unless you actually intend to DC couple the inputs (choosing AD7367 suggests so?), eventually it might be preferable to AC-couple the inputs. the DLD schematic posted in the other thread has an example for AC-coupled inputs (see INA-1, INB-1).
 
note the schematic doesn't show the low pass / capacitor in the feedback path (it's value will depend on the sampling frequency; in case of OC: 560p ~ 8.6kHz cut-off / 16.7kHz Fs); also that's the kind of (DC-coupled) circuit you'd use for CV inputs rather than audio; i guess it'll do for testing purposes, but unless you actually intend to DC couple the inputs (choosing AD7367 suggests so?), eventually it might be preferable to AC-couple the inputs. the DLD schematic posted in the other thread has an example for AC-coupled inputs (see INA-1, INB-1).

I am planning to have 4 DC-coupled CV inputs (possibly via the AD7367), and 1 audio input. I'll have a look at the DLD schematic for the AC-coupling, cheers.
 
Status
Not open for further replies.
Back
Top