Protecting Microcontrollers (was Re:[sdiy] converting a 10v p to p to a 0-5 volt signal)

Tom Wiltshire tom at electricdruid.net
Wed May 20 23:37:52 CEST 2009


You definitely need to add an offset if you want to turn -5 to +5  
into 0-5V. The pot shown on the schematic would do it. You can  
experiment changing the mixer input resistor (R1) for different  
voltage ranges. If you wanted different sockets, you could add more  
input resistors (standard op-amp mixer - add as many inputs as you  
like).

You should also check whether the following circuit (the one that  
takes 0-5V) is actually expecting a unipolar input. If it is, and you  
feed a 2.5V "zero" level into it, you'll shift the range of  
everything, even when you've got no modulation. Bipolar 0-5V inputs  
are pretty rare.

T.


On 20 May 2009, at 22:22, Dan Snazelle wrote:

>
>
> looks good but my first question is whether or not (before i build it)
> you have had luck with it working with other voltage ranges? (sure  
> would be nice if this would work for 0-5 or +/- 5 or +/-10)
>
>
> highly appreciate this!
>
>
>
>
>
> --------------------------------------------
> check out various dan music at:
>
> http://www.myspace.com/lossnyc
>
> (updated monthly)
>
> http://www.soundclick.com/lossnyc.htm
>
>
>
> http://www.indie911.com/dan-snazelle
>
> (or for techno) http://www.myspace.com/snazelle
>
> ALSO check out Dan synth/Fx projects:
>
> AUDIO ARK:
>
> www.youtube.com/watch?v=TJRpvaOcUic
>
> www.youtube.com/watch?v=BqIa_lXQNTA&feature=channel_page
>
> www.youtube.com/watch?v=V4nJPjGgOcU&feature=channel_page
>
> and soundtrack/design work:
>
> NEW: check out Dan's sound design from the 1998 award winning film  
> SAFARI by catherine chalmers
>
> http://www.catherinechalmers.com/videos.cfm
>
>
>
>
>
>
> ----------------------------------------
>> From: tom at electricdruid.net
>> Subject: Protecting Microcontrollers (was Re:[sdiy] converting a  
>> 10v p to p to a 0-5 volt signal)
>> Date: Wed, 20 May 2009 22:06:06 +0100
>> To: jason at redfish.net
>> CC: synth-diy at dropmix.xs4all.nl
>>
>> I've also used the rail limit of op-amps as a solution:
>>
>> http://www.electricdruid.com/PICCVMixer.png
>>
>> This has one mixer op-amp, which can't produce an output larger than
>> +/-15V whatever it does (lightning strikes and ESD spikes excluded, I
>> suppose).
>> This is followed by a precision half-wave rectifier which deals with
>> the -ve voltage, and the gain resistors are set for 1/3rd gain, so
>> the +15V in becomes +5V out.
>>
>> I don't know whether I think this is the best solution or not. Let's
>> just say that it's not a problem I've stopped working on.
>>
>> T.
>>
>>
>> On 20 May 2009, at 19:16, Jason Proctor wrote:
>>
>>> my amateurish solution was to power the opamps suitably. the
>>> scaling opamp is powered from +/-5v. i put trimmers in appropriate
>>> places and tested it with input voltages from +15 to -15. seemed to
>>> work ok.
>>>
>>> although i did forget about the opamp output DC offset Ray includes
>>> in his scale/bias page.
>>>
>>> (i've not blown the micro yet!)
>>>
>>>
>>>> Aside from range scaling, I'm still looking for a good protection
>>>> circuit
>>>> for microcontroller inputs. I want hard clipping at 0V and 5V to
>>>> protect the
>>>> micro. I've seen various solutions described on this list, but
>>>> when I put
>>>> them into SPICE I have always found some flaw, such as the lower
>>>> limit
>>>> actually being one diode-voltage-drop below zero rather than zero.
>>>> I'd be
>>>> very happy if I could find some nice solution to this problem so
>>>> that my
>>>> micro-based modules can protect themselves rather than having to
>>>> depend upon
>>>> my poor memory to avoid being subjected to unacceptable voltage
>>>> ranges. :-)
>>>>
>>>> Or, putting it another way: converting 10Vp-p to 0-5V with op-amps
>>>> is a fine
>>>> solution, but as soon as you add two 10Vp-p signals together (e.g.
>>>> mixing
>>>> two LFOs) the input range can easily exceed 10Vp-p and hence the
>>>> output
>>>> range will also exceed 0-5V.
>>>>
>>>> --Adam
>>>>
>>>>> -----Original Message-----
>>>>> From: synth-diy-bounces at dropmix.xs4all.nl
>>>>> [mailto:synth-diy-bounces at dropmix.xs4all.nl] On Behalf Of
>>>>> Jason Proctor
>>>>> Sent: Tuesday, May 19, 2009 6:50 PM
>>>>> To: synth-diy at dropmix.xs4all.nl
>>>>> Subject: Re: [sdiy] converting a 10v p to p to a 0-5 volt signal
>>>>>
>>>>> i did exactly this for my Arduino module. it bidirectionally
>>>>> interfaces a +/-5v signal to the micro's 0-5v range.
>>>>>
>>>>> turned out to be pretty easy - on the way in, chop the signal
>>>>> in half, and bias with +2.5v. then reinvert. on the way out,
>>>>> do the opposite. 1 dual opamp each way.
>>>>>
>>>>> lmk if you want the details.
>>>>>
>>>>> (i should also thank Tom Wiltshire here for his help getting
>>>>> me off the ground with this stuff.)
>>>>>
>>>>>
>>>>>> tonight i was looking at my scope
>>>>>>
>>>>>> Checking the input into a circuit that was only able to take
>>>>> 0-5 volts
>>>>>>
>>>>>> Sure enough, the signal was between 0 and 5 but the sawtooth
>>>>> was clipped.
>>>>>>
>>>>>> So i am looking for a input block that can take either
>>>>>> 5vp to p or 10v p to p (or any synth signal)
>>>>>> and spit it out as a 0-5 signal without squaring the top.
>>>>>>
>>>>>>
>>>>>> anyone know of a good circuit for this?
>>>>>>
>>>>>> thanks
>>>>>>
>>>>>> _______________________________________________
>>>>>> Synth-diy mailing list
>>>>>> Synth-diy at dropmix.xs4all.nl
>>>>>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>>>>>
>>>>> _______________________________________________
>>>>> Synth-diy mailing list
>>>>> Synth-diy at dropmix.xs4all.nl
>>>>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>>>>>
>>>>
>>>> _______________________________________________
>>>> Synth-diy mailing list
>>>> Synth-diy at dropmix.xs4all.nl
>>>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>>>
>>> _______________________________________________
>>> Synth-diy mailing list
>>> Synth-diy at dropmix.xs4all.nl
>>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>>>
>>
>>
>> _______________________________________________
>> Synth-diy mailing list
>> Synth-diy at dropmix.xs4all.nl
>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>





More information about the Synth-diy mailing list