3.3V microcontroller, 5V analog sensors

Hi,

I use a 3.3V microcontroller, and somehow I need to sample 5V analog sensors…

I have 5V available on the board, I guess I see several ways of handling this, since I really want to keep the 3.3V microcontroller. The microncontroller’s pins are 5V tolerant.

  1. Use an amplifier with a gain of 3.3/5.

  2. Use a 5V A/D converter, with an SPI or I2C interface that is 3.3V compliant

  3. Use a resistive bridge.

Solution 1) would be fine since I have 5V on the board and won’t be saturating the amplifier. It’s just a pain though to add another component to the board…

I like 3) because it does not add real-estate to the PCB. However, I’m concerned with noise issues and impedances though.

  1. on top of adding a component to the board, it seems like double use since my microcontroller has an on board A/D converter.

What are your thoughts? How are you guys handling this conversion on your designs?

Thanks!

Use resistive dividers to scale the 5V inputs to 3.3V?

Leon

I think you’ve answered your own question. If you can tolerate the impedance issues, then just use a resistive divider. If not, then use the amplifier.

Option 3 is a common approach, but it depends somewhat what you are measuring.

Make sure the bridge doesn’t sink so much current that the sensor can’t maintain an accurate output.

Also consider calibration, especially if using 5% tolerance resistors. Some will say precision resistors get around this issue but in general you will always need to calibrate out inaccuracies due to component tolerance, track imperfections, and of course the sensor itself.

Yes, that’s what I meant by “impedance issues”. Precision resistors should remove the need for calibration, except for the issues I mention below…

ADCs like to be driven from a low-impedance source (due to internal sampling capacitance). A high-impedance resistive divider doesn’t provide this. Adding a ceramic capacitor to the ADC input pin provides a low impedance, but limits the maximum frequency that can be measured. There’s also the leakage current into the ADC input to consider - this is highly dependent on temperature, and can become significant if a high-impedance resistive divider is used.

If in doubt - use an amplifier!

I’m not expert so this may be a silly suggestion, but a 2V Zener?

How does that help?

Leon

You will drop 2V over the zener diode so 5V in ends up as 3V once at the uC?

The voltage across a zener varies with current, and wouldn’t be accurate enough I think.

What if the sensor supplies 2V?

Leon

Well thanks for all the input.

I was going to go for the resistive bridge, with a high impedance, but then realized this may not work with the impedance of the ADC. For now I’m thinking the amplifier may be the safest solution…

By any chance would any of you know where to find the impedance of the ADC on the LPC2129? The user manual does not provide that many insights on the electrical characteristics of the device.

It’ll be in the data sheet. It’s 40k for the LPC2148, it’s probably the same as that. A couple of resistors will work OK.

Leon

leon_heller:
It’ll be in the data sheet. It’s 40k for the LPC2148, it’s probably the same as that. A couple of resistors will work OK.

Leon

Interesting, may have to look closer… Didn’t find it the last time I looked in the user manual…