Need Help with Level Translation for uC Input?

  • Thread starter Thread starter triden
  • Start date Start date
  • Tags Tags
    Translation
Click For Summary

Discussion Overview

The discussion revolves around methods for clamping or level translating an input signal to a microcontroller (uC) to prevent it from exceeding the maximum input voltage, particularly in the context of using a 12V signal with an ADC input. Participants explore various circuit solutions and their implications for signal integrity.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • Chris suggests using an emitter follower to clamp the signal to approximately 5V.
  • One participant proposes using a diode clamp to 5V, with a Schottky diode recommended to minimize forward voltage drop.
  • Another participant agrees with the diode clamp approach, arguing it is superior to using a 5.1V Zener diode due to tolerance and temperature stability issues.
  • A suggestion is made to use a voltage divider with specific resistor values to reduce the input signal to a safe level.
  • There is a discussion about using a unity gain op-amp with a 5V rail to ensure the output does not exceed 5V, while still allowing for varying analog input.
  • Concerns are raised about the need to clamp the input of a CMOS rail-to-rail op-amp, even if it has a high input differential voltage rating.
  • One participant emphasizes the importance of using a full set of clamp diodes to protect against voltage spikes from mechanical switches.

Areas of Agreement / Disagreement

Participants express varying opinions on the best method for clamping the input signal, with multiple competing views on the effectiveness of diode clamps, Zener diodes, voltage dividers, and op-amps. The discussion remains unresolved as no consensus is reached on a single preferred solution.

Contextual Notes

Participants note limitations related to the tolerance of Zener diodes, the temperature dependence of diode performance, and the potential need for additional protection against voltage spikes.

Who May Find This Useful

Individuals working on microcontroller input protection, circuit design involving ADCs, or those interested in signal conditioning techniques may find this discussion relevant.

triden
Messages
172
Reaction score
0
Hello,

I am in need of some form of "clamp" or level translation for an input to a uC. How can I prevent a signal from going beyond the VIH of the uC port? (approx 5.5vdc). The signal will be an ADC signal, so ideally the clamping circuit will not alter the adc input in any way. The reason I need a clamp is because sometimes a 12vdc switch is hooked up to the input which I need to limit to 5v. I was thinking of using an emitter follower to do this because the gain is ~1. Any other ideas?

Regards,

Chris
 
Engineering news on Phys.org
triden said:
Hello,

I am in need of some form of "clamp" or level translation for an input to a uC. How can I prevent a signal from going beyond the VIH of the uC port? (approx 5.5vdc). The signal will be an ADC signal, so ideally the clamping circuit will not alter the adc input in any way. The reason I need a clamp is because sometimes a 12vdc switch is hooked up to the input which I need to limit to 5v. I was thinking of using an emitter follower to do this because the gain is ~1. Any other ideas?

Regards,

Chris

Can you just diode clamp it to 5V? The cathode of the diode goes to the 5V rail, and the anode is connected to the input that you want to protect.

If the source of the voltage is low impedance, you may need a current limiting resistor in series with the source.


EDIT -- use a Schottky diode to keep the Vf voltage drop of the diode under the 0.5V.
 
I concur with Berkeman. This is a better solution than the other one frequently mentioned, that of a 5.1V Zener. The reasons it is better are these:

The Zener voltage typically has only a 10% tolerance. That means your actual voltage could be anywhere from 4.6 to 5.6 volts.

Zener diode voltage varies more than ordinary diodes over temperature. What may work at room temperature may not work at cold temperatures.

Diodes with 0.7 volts across them can handle more current than a Zener of the same power rating with 5.1 volts across it.

Diodes, particularly Schottky diodes, are a lot faster than Zeners and clip short voltage spikes better.

(I have used ordinary silicon diodes, not Schottky, and never had any problems.)
 
Last edited:
If you're just measuring the presence or absence of a higher-powered 12V (or thereabouts) can I suggest the use of a voltage divider? Using a 1k and a 3k will divide your input signal by 4 while only drawing 4 mA (48 mW). You can also use a DMM to find the exact ratio or resistors that give you a closer match (neglecting heating effects or resistor 'aging'). That or just use a 10k pot and tune it until you get your desired ratio.
 
Ah Berkeman, I think the schottkey diode trick the the answer. Using regular silicon diodes will take me over my maximum input ratings.

As an alternative, is it common to use a unity gain op-amp with the rail voltage at 5vdc? This way I can still have my varying analog input, but the output will never swing past the 5v rail. Just a thought.
 
triden said:
Ah Berkeman, I think the schottkey diode trick the the answer. Using regular silicon diodes will take me over my maximum input ratings.

As an alternative, is it common to use a unity gain op-amp with the rail voltage at 5vdc? This way I can still have my varying analog input, but the output will never swing past the 5v rail. Just a thought.

If you use a CMOS rail-to-rail opamp, you still need to clamp its input against the 12V fault.
 
berkeman said:
If you use a CMOS rail-to-rail opamp, you still need to clamp its input against the 12V fault.

If I were to use something like this (http://cds.linear.com/docs/Datasheet/14901afbs.pdf ) where the input differential voltage rating is 44v, should it not work? Is there still a need to clamp the input?
 
Last edited by a moderator:
triden said:
If I were to use something like this (http://cds.linear.com/docs/Datasheet/14901afbs.pdf ) where the input differential voltage rating is 44v, should it not work? Is there still a need to clamp the input?

Hah! That's an interesting part. I hadn't seen an opamp with that feature before. It does seem like it will work for you as a follower, limited to the 5V/GND supply rails that you give it.

Nice find!
 
Last edited by a moderator:
I'd go with the diode clamp - actually I'd recommend a full set since you can get some pretty nasty spikes with mechanical switches. The internal protection diodes of a mcu are notoriously slow - this is cheap insurance.
Example clamp diodes

Edit - in this case, your micro replaces the op-amp.
 
  • #10
Cool! Thanks everyone - very insightful.
 
  • #11
Notice at the very bottom of the datasheet there is a phone number. You might want to call the number and ask for an applications engineer for opamps.
 

Similar threads

Replies
3
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
3
Views
5K
  • · Replies 13 ·
Replies
13
Views
7K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
8K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 20 ·
Replies
20
Views
6K