One caveat is that ADC’s need a low impedance input and by adding the resistor you could slightly distort the input signal. Would the following approach fix that?
The remaining problem is the voltage range. suppose you work with audio (10Vpp), you’d need to squeeze that into 5-0V range. So I cooked up the following while trying to merge everything together. Because it is audio, I don’t really care that the signal is inverted, which can be easily fixed in software anyway. here it is:
I just found out that the Teensy ADC works in the 0.0 - 3.3V range, so I need to scale down a bit more. It will accept voltages up to 5V, but I’m pretty sure I want protection in case it goes higher or lower.
You designed a 10k input resistor. I’d suggest you switch that to a 100k. Just imagine what will happen to your gain ratio if the output impedance of the other module is 1k in each scenario.
It’s better to use Schottky diodes for clamping, for their lower forward drop.
The location of your clamping diodes is wrong. The opamp will keeps it’s inverting input on GND, so nothing will ever be clamped.
A 10vpp signal is typically -5 to +5v. Your current design (if you fix the above issue) leads to simply clipping the bottom half, which is probably not what you want. It looks like you wanted to add a negative bias, but if anything you’d need positive one.
Okay, I realise those are mainly stating what you shouldn’t not, not what you should do. So here’s my advice: use a rail-to-rail opamp like the MCP600x. Power that from a regulated 3.3v rail, and you can be absolutely sure you won’t damage the Teensy. You will still need some gaining, and biassing, possibly clamping, but it’ll be much easier. Also, no need to reinvent the wheel; eg MI schematics are full of these type of arrangements.
You sure? I’d think you would want a negative bias on the input, to put the output above zero (if using an op amp powered by 3.3 V and 0 V).
You’d want some protection on the op amp input if the gain were high enough, because if the input gets connected to a ±12 V source and the output voltage is limited to 0 V to 3.3 V, the voltage on the - input pin could be driven beyond the (0-1) V to (3.3+1) V absolute maximum range. But if you’re scaling 10 Vpp down to say 2 Vpp then R2/R1 = 0.2 and that should be safe. Pretty sure… but check!
I agree with what @TimMJN said, use a MCP600x. This is from the mutant grids:
This way the potentiometer works as a bias as well, so the value from the CV input and the voltage from the pot is added together.
It’s for Arduino, so 5V and not 3.3, but I guess you would only need to change the reference voltage from -5V to -3.3V (fits with what @analogoutput mentioned: you want negative bias, to make the output positive )
Ahh you guys are right, I had a non-inverting configuration in mind. I agree, negative bias and a inverting configuration is more convenient if you can simply flip it in firmware.
Thanks for all your replies! I had some time to look into this again.
I’ve ordered some MCP600x chips to try out this schematic. But I forgot I also needed components to create a -3.3V reference voltage
Do I really need that? I played around in circuitlab and since the MCP400x are rail-to-rail, I could perhaps do something like this. This way, I don’t need any other reference voltage and I can use the 3.3V regulator on the teensy which can drive up to 250mA.
This will scale a +/-5VP signal nicely inbetween 0 and 3.3V. Even when you turn the bias knob, it will stay inbetween the rails. Signals over 10V pp will clip.
I see there is also a 10n cap in the original schematic. Does that serve as some kind of low-pass filter ?
There’s a mistake in your simulation, the pot has name 100k and value 100R, presumably it should have a name like R3 and a value of 100k.
Not entirely sure what your design goals are here, in particular what your 0 to +3.3 V bias is for and whether that is large enough with your presumably 10 Vpp signal input. But if that’s what you want then this will work.
Using the -12 V rail and the +3.3 V regulator in principle isn’t as good as using voltage references, which would be less noisy and more accurate than the regulators, but for most purposes that’s probably all right. (Your -12 V rail in particular may be a few tenths of a volt lower especially if you have diodes or 10R resistors on your rails, and might vary if the module’s current draw varies, and might have high frequency noise from the Teensy.)
The 10 nF capacitor lowers the gain for high frequency signals, so helps suppress high frequency oscillations one sometimes gets. The RC cutoff frequency is only 159 Hz so presumably that circuit is intended for use with slow control voltages. If you’re dealing with an audio signal you’d probably want something more like 10 pF. You might not need it at all, but if it does oscillate, you could add it.