How much noise are we talking about here?

Have you tried using the teensy’s ADC for anything else and comparing the noise?

1 Like

One trick from studying Olivier/Mutable Instruments. Once your signals are in teensy voltage range, use low voltage rail-to-rail MCP 6002/4 op amps with 3.3v power - they do the op amping but also clamp the voltages to protect your microcontroller.
This is from Clouds, I think.
Here, 0v = 1.65volts, and the signals are inverted - so the teensy will read 0 at +5v, 1024 at -5v.
The AREF-10v precision voltage reference is a tiny component that will help with calibration etc.
NB I haven’t built this myself, but the simulation looks good.

5 Likes

Yeah, I was going to link the exact thing @TomWhitwell did - I was looking at it only the other day (in the Rings) circuit.

What you’re seeing is, I believe but might be wrong and an idiot, using an opamp as a differential amplifier: the combination of a precise choice of resistors along with the -10V reference means that a single opamp both offsets and scales your voltage. The icing on the cake is that the 3.3V opamp limits the maximum voltage going into the Teensy.

If you have a look at the schematics for Rings, you’ll see that the modulation inputs are scaled from -8/+8, and the v/oct scales from -1.5-+5. Both scale down to a 0-3.3 range, though note that sometimes the scaling means the minimum possible voltage will be > 0V. Circuit simulators are a good way of testing the output range - stick a 16V p-p AC sine wave in at one side, and watch what comes out the other.

2 Likes

Are you using eagle for simulation?

No, EAGLE doesn’t do simulation. I tend to use Falstad’s “circuitjs”.

This is a demo of Olivier Gillet’s scaling circuit - and now I see Tom W posted effectively the same thing earlier.

It can’t handle certain things - notably, highly analogue behaviours, such as the way a biased diode makes noise - but it’s super handy for checking maths or confirming ideal op-amps behave like you think they might…

Oh weird, somehow I remembered that it could.

Pretty much what I had in mind.

Thanks everyone for your help. I already have some prototype PCBs made with this circuit, so I’m keen, if possible to identify the problem, rather than changing the circuit, in case it’s possible to fix by just adding a component somewhere. I shall go back to my breadboard, as I don’t remember the problem there, and try some of these things out.

So - this is Eurorack; what happens when the power enters the board? What filtering setup do you have? Just trying to identify where noise might come in, and so making sure there’s some belt-and-braces going on. Also - what PSU are you testing with? A bench supply, a Eurorack power lead?

1 Like

Could you describe the noise? When I experimented with audio in on teensy, there was a tonne of clipping/ distortion, because my scaling circuit was wrong (it was channels 2&3 of a maths!). Are you hearing that, or hiss (white noise) or something else. Are you able to check the noise is there in the analog realm, before it gets to the teensy?

1 Like

Here’s the power circuit I’m using. Adapted from the Radio Music. I’ve tried with both a bench supply and a Eurorack power lead.

It’s white noise I’m getting. When I look at it on my (crappy £10 kit) oscilloscope, I can’t see much noise, but there’s definitely some there. I’m going to try some more filtering on the 5V supply next.

I’m actually using 10uF for C6 instead of 1uF. Not sure how much difference that makes.

I wonder (this is just speculation, thinking through what I’d do in this situation) if there’s a gain issue somewhere - like you have to turn up the output mixer, so that’s causing the background noise to be much higher.
I remember someone having trouble with a noisy Radio Music module, and realised eventually that they’d just recorded their samples really quietly, so were turning everything else up really high.
Your circuit looks basically OK to me, so I’d think somewhere else - unless maybe you’ve put in a wrong resistor when building the circuit, so one stage is really low gain.

It won’t be that - that’s just doing filtering.

1 Like

One other really dumb question - are all the opamps definitely connected correctly? Sometimes EAGLE is funky about connecting nets; I tend to pick up components and jiggle them around on the SCHematic screen just to check that it’s not neglected one of the green lines.

My other question would be: what, specifically, is the -5V coming in top left coming from? Is it a LM4040-5, or just something like a 7805?

1 Like

But if the noise is on the 5V line (to be confirmed), would choice of caps here not affect that?

I’m fairly confident it’s connected correctly in Eagle, although I’ll double check. Voltage regulator is just a 7805, yeah.

Yes, although bigger should lead to less noise there - like, if you’re using 10u instead of 1u, I’d expect less noise. Let us know how you get on with filtering the PSU.

Alternatively, am happy to take a look at EAGLE files. My other question would be whether the grounding is behaving itself.

1 Like

I modelled it here, didn’t get 0-1.2v output from +5 / -5v input - I get a signal of about 250mv point-to-point, centred (rightly, I think) around 600mv.
http://tinyurl.com/y8ez5z6a
I wonder if it might be better to use the 3.3v reference than the 1.2v - so you’re only cutting the 10v point-to-point signal down to 3.3v point-to-point?

  • Playing with the simulation, changing R2 to 39k, R1 to 10k, R3 to 13k turns +/-5v into 0-3.3v (you might want to leave some headroom)
1 Like

Thank you for taking the time to do that, Tom! It confuses me that the outputs aren’t correct (they do seem correct when I test the board).

I was basing the circuit on this http://www.electronics-tutorials.ws/opamp/opamp_4.html

opamp13

So at +5V in

-Vout = 5*(1 / 8.3) + 5*(1 / 8.3) = -1.2V

at -5V in

-Vout = 5*(1 / 8.3) - 5*(1 / 8.3) = 0V

which is then inverted by the second op-amp. I guess something must be wrong with my understanding here?

According to the Teensy docs https://www.pjrc.com/teensy/gui/?info=AudioInputAnalog if you use the built in ADC you should use a 1.2V reference voltage.