Electronic – ADC for measuring 0-5V but connected to 3.3V device

adcbeagleboardvoltage measurement

I have a BeagleBone (BB) and want to connect the analog output of a motor controller to it. The motor controller creates an output in the range of -4V to +4V and the BB anlog inputs only accept voltages between 0V to 1.8V (digital pins run at 3.3V). I only have a comparably small limited space of perfboard available, but 4 motors to monitor. I can provide 5V and 3.3V supply and 1.8V ref Voltage.
Here are the options I found so far:

  1. Make an op-Amp circuit to convert [-4..4] to [0..1.8]. Probably a nice way, because I could use directly the BB-ADCs, but I am not to confident with these circuits (I found this example) and I would need one for every input which seems to be to many parts/space.
  2. Use an ADC and connect it via I2C: The Max127 seems to provide exactly what I want. Single 5V supply, analog input range between [-5..+5] and I2C interface. I would really like to use this one, the only problem I have is that according to the data sheet digital high is seen as 0.7*Vdd = 3.5V. I do not now if 3.3V would be detected correctly (anyone has experience with that?). Pulling up to 5V is not possible as the BB is not 5V tolerable.
  3. The Max1270 is basically the same as the Max127 but with SPI-interface. There the data sheet states the digit high threshold is 2.4V. I know that the I2C slave only pulls down. How does it work with spi, because the data sheet mentions digital outputs voltages (which are Vdd)?
  4. Lose some resolution and only use the output range from [0..4]V. That gives a larger variety of possible unipolar ADCs, but most of them have the same limitation with 0.7*Vdd for digital high signals.
  5. As in 4. But use ADCs with 3.3V supply voltage which have a range of [0..5], but I could not find any with 4+ channels.

I believe that I somehow going in circles. Does someone know a viable solutions or how to address the mentioned problems of (at least) one of the above described?
I would generally prefer through hole parts (as it's perfboard) but I could probably get some small breakout boards for SMD-devices as well.

Best Answer

  1. Although a passive solution is possible, often depending on your source impedance and ADC input impedance, it's usually a good idea to use an opamp for the level/gain shift. One option is an inverting circuit such as this:

    Inverting Shift

    Simulation:

    Inverting Shift Simulation

    The benefit is a very low output impedance to drive the ADC (many ADCs require a minimum signal impedance of <10kΩ)
    The input impedance is just R3 (133.2kΩ in this circuit) To prevent loading effects, you want your signal impedance to be less than 10kΩ or so. If it's higher, you can increase R3 and R2 to increase the input impedance (as long as the ratio remains the same, so does the gain)
    Some opamps don't like a gain less than 1, so you need to check the datasheet to make sure it will be stable in this configuration. Also a small capacitor across R2 is usually a good idea to control bandwidth appropriately.

    The readings will be inverted, but it's easy to correct for this in firmware.

    A quad opamp with a decent voltage reference IC and divider to provide the 735mV reference for all non-inverting inputs could be used. The opamp must be able to swing its output down to ground; some op-amps cannot do this, so check the datasheet.

  2. For the I2C and MAX127 (which looks fine) option, you could use a level shifter IC to convert between the 3.3V and 5V levels needed. There are quite a few such ICs designed for use with I2C. Have a look on Farnell, or Mouser, Digikey, etc. The PCA9306 is one example.

  3. SPI uses "standard" outputs which are driven high/low (as opposed to I2Cs open drain) You can also easily level convert this, since each line is only one direction. A couple of transistors can be used.