Level translation problem

by triden
Tags: translation
 P: 173 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
Mentor
P: 41,258
 Quote by triden 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.
 P: 1,822 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.)
 Sci Advisor P: 1,724 Level translation problem 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.
 P: 173 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.
Mentor
P: 41,258
 Quote by triden 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.
P: 173
 Quote by berkeman 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?
Mentor
P: 41,258
 Quote by triden 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!
 P: 161 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.
 P: 173 Cool! Thanks everyone - very insightful.
 P: 1,822 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.

 Related Discussions General Physics 4 General Discussion 2 General Discussion 41 General Discussion 2