Hi everybody!
I'm designing a module for my modular synth.
I'm willing feed to my arduino an audio signal oscillating from +12v to -12v, biased around 2.5v.
I don't want to scale the signal down, I am interesting in zooming on the signal bias voltage of 2.5v, and I want to limit the number of components I'll use for the whole design.
I wonder what the best method is for input protection.
First I was thinking of series resistor plus 2 shottky diodes respectively from ground to pin, and from pin to +5v . Resistor not too big so the reverse current of the shottky doesn't apply too much of a voltage drop. Resistor not too small or it will add some noise in the suplly rail of +5v and I might need a dummy load.
Otherwise I was thinking of ditching the shottkys and using the diodes that are already built in the Atmega inputs. What would the max allowable current through those diodes be?
Since it's not very practical to test for this (don't want to burn 20 chips just for the sake of science ahah), I'd like to hear your take on that.
not clear to me what your design is doing or will do
you just want to limit. for what ? what arduino should do ? is not the same if you want to use your ADC , or just detect 0 to 5v input , please describe what´s expected...
"I'm willing feed to my arduino an audio signal oscillating from +12v to -12v, biased around 2.5v."
I'm going to use two Atmega328 chip in standalone.
On the first chip, i'm using the built in comparator input pin (be it the inverting or non inverting input, doesn't matter). On the second chip I am using the A0 ADC input pin.
the frist chip is (mainly) used for frequency detection as well as generating a 10bit analog volt per octave control voltage, the second chip is (mainly) used for generating an envelope detector as well as generating an 8bit envelope analog control voltage.
Resistor not too big so the reverse current of the shottky doesn't apply too much of a voltage drop. Resistor not too small or it will add some noise in the suplly rail of +5v...
Usually, the main consideration is the output impedance (or current capability) of the driving circuit. 10K will work for "almost anything", except where you have power line voltage and you might fry the resistor. A lower resistance will actually pick up less noise so if you can drive 1K that might be better.
Otherwise I was thinking of ditching the shottkys and using the diodes that are already built in the Atmega inputs. What would the max allowable current through those diodes be?
I'm not 100% sure about that either. The datasheet says "40 mA absolute maximum per I/0 pin" but I'm not sure if they really mean input... I'd assume you'd be OK with 12V and 10K.
A lower resistance will actually pick up less noise so if you can drive 1K that might be better.
I don't understand how this can be the case.
Maybe you are talking about the thermal noise of the resistor on the signal. I am talking about noise in the +5v supply rail or in the GND rail. In this case less current thus bigger resistance is better (as long as the reverse bias leakage current doesn't drop too much of a voltage across the resistor. Or am I missing something?
An app note claims 1mA continuous.
Thanks for the info. Could not find the app note. Can you please help me find it?
Anyway if this is actually true anything above 12k Ohms is ok.
You dont want to apply 9V directly to the I/O pins even through a resistor. The protection diodes are unlikely to respond quick enough to prevent the i/o circuitry seeing out-of spec voltage. If you know the i/o input capacitance then you might be able to use simple R/C filter and theoretically at least, prove that the input diode has been given ample time to go into conduction mode before the input would reach Vcc + 0.5V if the protection diode had not been there.
"The protection diodes are unlikely to respond quick enough to prevent the i/o circuitry seeing out-of spec voltage." is nonsense IMHO - the diodes are for ESD protection, they should be fast. AFAIK the voltage limits in datasheet are to protect the protection diodes from overcurrent. In fact input current limits would be more appropriate (and some datasheets list them).
Oh thanks I didn't catch that you attatched the PDF.
I do like the idea that I'm upgrading my current design to have less and less components in total on my future PCB. My concern really is to keep the +5v clean. If It fluctuates just a little bit, the volt per octave analog output signal is going to be slightly out of tune, and it is already the case on the breadboard (it fluctuates ever so slightly, it's usable but as a musician I can hear it). There is already a 10uF in place between +5v and GND. But my breadbord is using the +5v from the arduino (it self plugged to the old Ibook USB with cheap power supply), also my +5v is power the noisy LM311 comparator that I am currently using to convert from +/-12v to 0/5v. The whole point of using diodes is to get rid of the comparator and free some space on the PCB.
Do you think using shottkys instead of the internal diodes will give me cleaner +5v for the arduino? I can't put a big capacitor on the rails close to the diodes inside the arduino obviously.
Maybe 10uF is too small? Keep it on the board but add 100uF as well. Put 0.1uF caps as close as possible to the critical chips.
You cannot expect to get good analog performance from a breadboard. Invest in a cheap USB oscilloscope so you can start probing the circuit and work out what is going on. Then apply good analog design guidelines to your PCB design and the PCB performance will be much better than the breadboard.
Thanks for the advice, i'll try putting a bigger cap in parallel in deed. I have a 4 channel digital oscilloscope and am used to design analog audio circuitboards.
Currently learning how to use the atmega alone, before I was just using Arduino boards as a button box for my flight sim