Help with options isolation

Hello.

I want to connect a 12v modular synth to the inputs of an Arduino nano. Then connect the outputs of the nano back into the modular synth. I want to protect the inputs from being damaged by the 10vpp output from the synthesizer.

My understanding is that it's best to use opto isolation. I understand the concept of the separation of the led controlling a transistor through light. The led connected to 12v synth side and transistor is connected to 5v Arduino side. Am I right in thinking because the transistor is connected to 5v. It won't produce more than 5v and won't allow any negetive voltage because it's not connected to the -12v of the synth.

But how does it distribute the 10vpp to 5v? Does it just limit. So it doesn't read signals beyond 0-5v?

Could anyone tell me which opto isolator is best for this job and is there anything else to consider?

Thank you.

I think a voltage divider + current limiting resistor is everything you need.

For more control over how the input voltage range is "mapped" to the 0-5V you need, look into OP-Amp circuits (inverting amplifier, non-inverting amplifier, offset are buzzwords you might need)

Really? Thank you.

Really?

Yes

The output of an opto isolator will only give you square waves output.

analog signals? audio signals? which synth? More information please.

Apologies if I did not give enough information. I want to connect a eurorack modular synthesizer to an Arduino. Synth runs off a 12v bi polar PSU. Outputs an average 10vpp and is used as a control voltage for the Arduino analog input. The synthesizer also has a 5v pulse output from a sequencer to use as a trigger. However, this 5v is not always garaunteed. Sometimes it can be up to 10v from certain modules in the synth. This will also be going into the Arduino.

So if opto isolation only gives a square wave. I should use this on the trigger input from the synth. And use a voltage divider current resistor on the control voltage input?

If I used opto on the control voltage input. Would it still produce 0-5v. Or just a 5v square? The control voltage varies in a stepped manner. (Switching between 8 outputs)?

Would the fact the opto is a square output make this stepped control vintage more stable?

Makes no sense to me.
What do you have, what do you want?

As an example:

I have: Analog signal, -10V...10V
I want: Analog signal, 0...5V

That's something we can solve.

You probably know what you are talking about when saying "the trigger input from the synth" or "The control voltage varies in a stepped manner. (Switching between 8 outputs)?"

I have no clue.

Would the fact the opto is a square output make this stepped control vintage more stable?

When I said an opto gives a square wave I was talking about feeding a sin wave into it. If you have a trigger input, which is a pulse you will get a pulse out of the opto. Think of putting an LED on a trigger input, that is the sort of output you get from an opto isolator, which I think is just what you want.

The analogue signals are a bit more problematic, an Arduino will not handle negative voltages so not only do you need to cut down the voltage to 2.5V peak to peak but you also have to a link a D.C. shift or bias to get the signal into the 0 to 5V the Arduino can handle.

This can be done in the simplest way with AC coupling, that is a seriese capacitor into equal size pull up and pull down resistors on the input. However if these signals have to be D.C. coupled then you need a more complex arrangement with operational amplifiers to get the signal into the right range.

Thank you for that information grumpy Mike about how to handle the negetive voltages. Can you elaborate please? I have just been putting a diode on inputs to deal with negetive voltages.

No. Optoisolators are analog devices. Like transistors. But digital geeks like us usually drive them to saturation. With some good knowledge of the input signal and not saturating it, you can get a hi-fi analog output from many types of optoisolators.

But is that even necessary? It sounds like digital is what is needed here. (Except for the part about the stepped control voltage.)

If you need to measure a control voltage that can take any value between -5V and +5V then you need to consider that most optoisolators are polarized. There is literally a diode inside. If you have access to the negative supply inside the rack then you can use that for the cathode of the optoisolator. So it never sees negative. -5V is actually +5V relative to the -10V rail. This is a good use for an optoisolator because you won't be connecting the Arduino to that negative voltage.

Standard opto isolators are very inaccurate in the analog domain, variability between devices is often
1:3 or so, and linearity is questionable. Special accurate analog isolators are available that have two
photodiodes, one used in a feedback circuit to compensate for variations and non-linearity.

Something like this: https://www.vishay.com/docs/83622/il300.pdf

You need an opamp on the driving side to drive it.

dionnaki:
Thank you for that information grumpy Mike about how to handle the negetive voltages. Can you elaborate please?

Audio Bias.jpg

I have just been putting a diode on inputs to deal with negetive voltages.

That dosn't deal with negitave voltages it blocks them and so causes severe distortion of the signal.

The big problem is that you are flayling about with so little knowledge and you have not said what you want these analogue signals for, so are response is can only be limited.

Audio Bias.jpg

Apologies again. I thought I said what I wanted the analog signals for in first post. The analog signal goes from my synth into the Arduino and back into the synth. The Arduino controls the voltages sent to the synth. The synth operates at -5 to +5 or 0 to +10v in some circumstances on both the pulse and control voltage inputs. I just want to protect the Arduino from damage.

Am I missing something in my explanation?

And also, apologies for my lack of knowledge. This is just something I started a few weeks ago because I need a controller that is not available on the consumer market. I have almost finished with next to no knowledge. I am not an electrical engineer. I am a musician and not a very good one. Haha.

Also to add. This device does not actually have any audio involved. It controls say the pitch of the audio or the rate of an lfo in the modulation of the audio. So it's all DC right? Not sure if this matter.

The device chooses one of eight preset voltages. Which can then be played by pushing buttons like a keyboard or it can be chosen via an external sequencer.

After the Arduino it gets put into an attenuverter which attenuates and inverts the 5v signal from the Arduino. Back to -5v to +5v. Then goes back to the synth for control.

Ok, it gets a bit clearer now, but I still think a quick handdrawing would make all of this wayyy easier to understand for us.

Draw the devices involved (as far as I understand there's only the synth and the arduino?) and all signals with direction.

Then describe what the synth outputs (voltage range etc) respectively what the synth expects.

Also to add. This device does not actually have any audio involved. It controls say the pitch of the audio or the rate of an lfo in the modulation of the audio. So it's all DC right? Not sure if this matter.

Yes it matters. It means you can't use the simple circuit I showed to give a DC bias.

The synth operates at -5 to +5

So are you expecting the Arduino to output voltages over the range -5 to +5? That is a lot more complected.

What sort of resolution do you need?
When you put an analogue voltage into a digital system it turns that voltage into a number. For the Arduino those numbers go from 0 to 1023, to represent an input voltage of 0 to 5V. Is this granularity good enough for you?

When an Arduino outputs a voltage it only has a granularity of numbers 0 to 255 to represent voltages 0 to 5V.

These last two factors can be changed but only by adding external hardware.

After the Arduino it gets put into an attenuverter which attenuates and inverts the 5v signal from the Arduino. Back to -5v to +5v. Then goes back to the synth for control.

So you have one of these attenuverter already or are you hoping to build one?

Grumpy_Mike:
When an Arduino outputs a voltage it only has a granularity of numbers 0 to 255 to represent voltages 0 to 5V.

... but even for that we need at least an RC-filter.

couka:
... but even for that we need at least an RC-filter.

Yes indeed but the OP is into a lot of external circuitry as I see it. The input voltage conditioning is going to need op-amps with controlled offset and gain and I don't think the resolution of input or output is going to be high enough for his needs.

He says:-

This is just something I started a few weeks ago because I need a controller that is not available on the consumer market.

And I think we both know why this sort of thing is not available as a consumer device.

Yes I have an attenuverter built. It works fine with Arduino outputs. The attenuverter accepts +5v and converts to -5 - +5. Which I scan through with a potentiometer on each stage.

Without adding a voltage input everything works as expected. The Arduino selects the stages and stages output to the synth the way they are supposed to. At the moment I am just using a potentiometer connected to the Arduino. To represent the control voltage stage. I am assuming that if I swap the pot for a jack for a control voltage. It should work.

I just need to protect the inputs of the Arduino from the synth and it's fully functional. If I use a module from the synth that is strictly 0 -5v. Everything is ok. But the main module I want to work with runs on 12v and outputs -5-+5 or 0-5v.

I will get a picture drew up and see is this helps.

The analog voltage is converted to 0-1023 divided between 8 stages selected via a switch statement in the code. I should be fine if I can limit the input voltage to Arduino range I reckon. As I said it works now with no input stage attached.

I am assuming that if I swap the pot for a jack for a control voltage. It should work.

Your assumption is incorrect.