# Arduino signal conditioning

I'm doing a project with an Arduino.

I read a voltage from a tachometer connected to a generator.

The nominal max output is 21V at 1000 rpm. The generator is managed so that the maximum tachometer output is 2.5V maximum. Therefore the signal voltage should NORMALLY be bounded from -2.5V to 2.5V, depending on the rotating direction.

But, as I said, I can have a spike and I want to prevent the Arduino's ADC converter from dealing with such a large voltage.

Here are some over-signal that I want to saturate:

Also everything should be translated to be within 0-5V:

So, summarizing, I need to clip the signal and then add 2.5V to it.

Searching online, I found some solutions using photo-couplers, but they address only half of my issue.

• See related Q&A here: electronics.stackexchange.com/questions/7583/… – PhilM Mar 22 '16 at 2:40
• I edited the language of your question, hopefully to make it more understandable. If I have mistakenly changed the meaning of the question, please correct my edits! – uint128_t Mar 22 '16 at 5:47

If I understand you correctly, you have an analog signal between -2.5V and +2.5V, but with the possibility to spike to +/-21V. You want to clamp the signal to +/-2.5V and add a DC offset of +2.5V so you can connect it to the ATmega328's ADC.

You can do the clamping part with a bog-standard diode clamping circuit: two of the following circuits, antiparallel: a Zener and a regular diode in series. You will have to experiment a bit with the Zener voltages to clamp nicely at +/-2.5V.

For the DC offset, a simple op-amp circuit and a 2.5V reference (a voltage divider is sufficient) will do. This app note is nice for offset stuff.

The resulting circuit will look a bit like this:

Note:

• This assumes your sensor can source at least 2mA or so.
• Creating a 2.5V "reference" is left as an exercise. A voltage divider and decoupling cap should be fine, but you'll have to manage the resistance values to keep things linear (a simulator is helpful for this).
• I've used an ideal op-amp. Substituting a real op-amp should be done carefully.
• The selection of the Zener diodes and regular diodes is tricky. Basically, at whatever the typical operating current is, you want the forward voltage of the silicon diode plus the breakdown voltage of the Zener to be just above 2.5V.
• To minimize non-linearity, R1 << R2 = R3.
• This circuit will exceed the Vin range of the ATmega ADC by ~500mV. This probably won't be a problem, but if it is (and it breaks your ADC), you need a more refined clamp circuit.

The DC transfer characteristic of the above circuit looks like this:

• 2.5 V reference, comparator... I was looking for something easy to realize. It is a bit too complicated :( It is hard to build. – Federico Munerotto Mar 22 '16 at 13:39

The solution here is perfect.

Is this sketch right?

simulate this circuit – Schematic created using CircuitLab

Thanks PhilM