Teensy based synth with CV inputs

Hi guys,

I am new here, so please be gentle.

I want to build a mozzi synth on a teensy and control it via CV input. Every time I DIY from scratch, I blow something up, or let out the evil magic smoke, so I thought I would ask here …

Can someone show me what I need to do to convert and protect an analogue pin from eurorack levels…

I know I am supposed to clamp using diodes and do something with resistors. Some stuff says I need opamps too?

I have a handful of optoisolators about, is it enough just to use one of these between gate and digital pin?

In a nutshell, what are the simplest input methods for CV and gate?

1 Like

Check out the schematic here:

It has some CV inputs (0 - 10V) and divides that down to 5V for interfacing to the atmega, and includes protection diodes feeding a rail to rail op-amp mcp6004.

The optoisolators are probably not the best solution, most of them are mainly for digital signals.

Cheers

3 Likes

Hi B.rock, welcome!

I recently asked the same question, here is my topic: How to prepare a signal for an ADC?

I actually managed to do this yesterday evening and I verified that the voltages would stay inbetween 0 and 3.3V no matter what kind of input you give. I used the following schematic (Opamp = MCP600x):

The thing that makes this a bit complicated is that you need a few different voltages. 12V and -12V are not enough.

I used an L7805 voltage regulator to step 12V down to 5V. I’m not using the 5V line provided by my frequency central power supply because it only supplies 100mA and a teensy needs about 100mA (its not very efficient unfortunately :neutral_face: ). So I rather take some power from the 12V line instead.
I use this 5V to power my teensy.

Secondly, you need 3.3V. You can either take this from the voltage regulator on the teensy or you can use an LM1117 voltage regulator to take your 5V line and turn it into 3.3V. I did this becuase the power lines of the teensy are probably quite noisy and I wanted some stable power for my opamps.

As you can see, I also use -5V to bias my opamp properly. I created this voltage from -12V using an LM4040. You can find more details in my topic.

here is the breadboard I’ve built so far. Doesn’t have a teensy yet:

I used a breadboard with interrupted powerlines. This allowed me to have one half of my breadboard have 3.3 power on the sides while the other half has 12 and -12 :slight_smile: I am using an MCP6004 to create 4 distinct CV / Audio inputs. I’m still working on this so will share more findings as they come in.

6 Likes

For gates and triggers:

image

7 Likes

If you want a ±5 V CV to map onto 3.3 V to 0 V, using the full range of the ADC for maximum resolution, you could use 33k for R3 and 100k for R2.

Or better yet, you could do this, which doesn’t require a -5 V reference:

image

If you want to stay a little away from the rails you could reduce R3 a little, to say 30k. That would give you a 3 V swing, using 90% of the ADC range.

(With 33k, if someone tried to connect -12 V to the input, the inverting input pin would go to about -0.4 V, which is still within spec (1 V below the - rail))

3 Likes

In my schematic, I accounted for 14V p/p to have some extra headroom on top of the 10 V p/p that is considered standard in eurorack for audio. I found that within my system, audio quickly gets louder and I rather waste some ADC resolution than to deal with clipping all the time.

Or better yet, you could do this, which doesn’t require a -5 V reference:

In the other thread, you suggested that using a stable voltage reference was probably a bit better because of possible noise on the -12V line, so I went for that solution to get a sticker :wink:

I wonder, could the R2 / R4 voltage divider you created be used for all opamps on the MCP6004 (in the same configuration ofcourse). I guess, because opamps draw (almost) no current. That would give you a pretty low component count for 4 CV inputs to the teensy :+1:

2 Likes

Thanks guys… I ordered up some of those there opamps!

2 Likes

Are you sure that will work? Because I build it and negative voltages all stayed at the same voltage reading (2V if I remember correctly).

Just using Ohm’s law along with basic properties of op amps:

With 3.3 V on R2, the + input is at 3.3*(180/(300+180)) = 1.2375 V. Same at the - input.

Then the current through R1 is (V1-1.2375)/100k which equals the current through R3, (1.2375-Vo)/33k. So (V1-1.2375)*33k = (1.2375-Vo)*100k or Vo = -V1*33k/100k + 1.2375*(1+33k/100k) or:

Vo = -.33*V1 + 1.646.

With V1 = 5 this is -0.004 V. Really 0 V because that’s the limit due to the 3.3 V, 0 V power.

With V1 = -5 this is 3.296 V.

In between the output is linear in the input.

If you’re seeing otherwise there’s either a mistake in the circuit build or a bad op amp.

5 Likes

Something to consider seriously. It could be bad, or a sub-spec chip deliberately mislabelled.

4 Likes

Found my problem: I had a jack-connector in it that was shorting.
After solving that, it works really great!

5 Likes

@analogoutput do you also have a suggestion for 0…3.3V => -5…+5V?

Would this work in practice? (circuitjs by falstad)

regards!

Any updates? Just wondering how you fared.

1 Like

Doesn’t work on a breadboard: output is -2.5…2.5V.

1 Like

Could you maybe elaborate on that, you answer is a bit short. What I’m curious about is whether you have succeeded in building yuo primary goal which was the ‘mozzi’ synth on a teensy with CV input. You seem to have found a short in a jack-connector and then reported that everythong was working well.

Can you upload a schematic of the circuitry as a whole?

No I only wantet to solder the opamp that @analogueoutput suggested.