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.

I did some further debugging tonight. Unfortunately it raised more questions than it answered! I seem to be finding analogue electronics rather tricky :slight_smile: I’ll document my investigations here incase it’s of interest. I plan to go back to my breadboard tomorrow to try and reproduce the problem there. Here are some fun images from my Fisher Price oscilloscope :slight_smile:

Here’s a 440Hz square wave going into the input jack

and here it is after the first capacitor C1

I was not expecting it to distort like that? I would have thought a 0.1uF capacitor would discharge much faster than that, to only filter out very high frequencies.

Here’s the 5V line with the sensitivity turned up to 10mV. You can see a lot of noise, but the amplitude is reasonably small (less than 10mV), although it will get amplified by the output stage. I may try experimenting with a voltage reference like this http://uk.farnell.com/texas-instruments/lm4040ciz-5-0-nopb/voltage-ref-shunt-5v-to-226aa/dp/1564659

I use this very simple R-C filter calculator: http://www.muzique.com/schem/filter.htm
On quick glance, it shows your input HP filter’s cutoff frequency is around 200hz which is certainly much higher than usual for audio. Try a 1u cap to get it down to around 20hz.

2 Likes

Oh, right, 200Hz would be rather high, thanks! I got that value from one of the audio circuits in Ray Wilson’s Make: Analog Synthesizers book, but maybe there’s something else going on there that I’d missed. How did you enter those values into the calculator though, as I don’t have a resistor going to ground? What value did you use for resistance?