Need Help with Level Translation for uC Input?

In summary: 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.
  • #1
triden
174
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
  • #2
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.
 
  • #3
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:
  • #4
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.
 
  • #5
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.
 
  • #6
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.
 
  • #7
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:
  • #8
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:
  • #9
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.
 

1. What is the level translation problem?

The level translation problem refers to the challenge of converting a signal or data from one voltage level to another. This is necessary when working with electronic systems that use different voltage levels, such as microcontrollers, sensors, and communication protocols.

2. Why is level translation important?

Level translation is important because it allows different electronic components to communicate and work together, even if they operate at different voltage levels. Without level translation, these components would not be able to understand each other's signals and data, leading to communication errors and malfunctioning of the system.

3. What are some common methods used for level translation?

Some common methods for level translation include using voltage level shifters, using resistors to create voltage dividers, and using transistors to create level shifters. Other methods include using specialized ICs designed for level translation, such as CMOS buffers and level translators.

4. What are the challenges of level translation?

One of the main challenges of level translation is ensuring that the translated signal maintains its integrity and accuracy. This can be difficult to achieve, especially when dealing with fast-changing signals or large data sets. Another challenge is selecting the appropriate method and components for the specific voltage levels and signals involved.

5. How can the level translation problem be solved?

The level translation problem can be solved by carefully selecting the appropriate method and components for the specific voltage levels and signals involved. It is also important to consider factors such as signal integrity, power consumption, and cost when choosing a solution. Additionally, proper testing and verification should be performed to ensure the translated signals are accurate and reliable.

Similar threads

Replies
3
Views
830
  • Electrical Engineering
Replies
5
Views
1K
  • Electrical Engineering
Replies
2
Views
2K
Replies
3
Views
4K
  • Electrical Engineering
Replies
13
Views
6K
Replies
9
Views
1K
  • Electrical Engineering
Replies
2
Views
3K
  • Electrical Engineering
Replies
2
Views
4K
  • Electrical Engineering
Replies
4
Views
7K
  • STEM Academic Advising
Replies
8
Views
933
Back
Top