Interfacing 5V device to a 3.3V Analoginput
Topic last updated
28 Jul 2012, by
Robert Luketic.
7 replies
AnalogIn
The mbed AnalogInput has a maximum input voltage of 3.3V. I have a 5V device that I would like to interface to it, what should I do?
(option #1) using a voltage divider with two 1K Ohm resistors.
(option #2) how about using an op-amp?
Anybody has a better solution?
Here is what I am trying to do:
I have a Allegro A3516 hall sensor has a range from 0V to 5V output. Which represent -800Gauss to +800Gauss. When it is at 2.5V, it is 0 Gauss.
Please help.
Replies
A voltage divider is the easiest solution. You may want to use different values than 2 resistors of 1K. These values result in a maximum voltage of 2.5V, meaning you dont use the full range of the AD converter and loose some resolution. You may also want to use larger values to reduce the load on the sensor, but not too large to avoid noise.
Op-amps need separate supply, possibly negative, to work. They may be used when your sensor signal needs amplification, buffering or filtering. They may also be used to shift the voltage range. For example when you only want the positive gauss measurement and decide to modify the 2.5V-5V into a voltage range between 0-3.3V.
If this is an experiment rather than a production application you could try powering the sensor from 3.3v instead of 5v. The output is proportional to supply, so if it works it should idle at 1.65v and give 0 or 3.3v for +/- 800gauss, though it would be out of specification (YMMV).
Allegro do make a 3.3v sensor now.
With these devices the sensor and MBED should be powered from the same supply. The sensor produces an output proportional to the supply voltage (ratiometric), and since the MBED measures relative to supply the resulting digital reading is independant of variations in supply.
Incidentally if it won't run from 3.3v then note that a 1.5:1 divider such as 10k series, 20k to ground should scale 5v down to very nearly 3.3v.
If you use 47K, and 91K it scles prfect.
Just multiply by 5.0 not 3.3 to give volts.
To achive correct bipolar range, you will need some analoge electronics,
Probably subtract USB/2 volts .... Caution not actualy 5 volts guarenteed.
Analog application: digital translators won't scale a voltage down in proportion.
My bad. I totally missed the AnalogIn part of this thread. A little bit obvious now.
For what its worth the TXB/S parts aren't going to solve every digital case. The TXB parts look only suited to CMOS-to-CMOS interfacing. Anything that loads the pin such as a termination, pull-up or transistor, is likely to lead to poor results.
Please log in to post a reply.
The mbed AnalogInput has a maximum input voltage of 3.3V. I have a 5V device that I would like to interface to it, what should I do? (option #1) using a voltage divider with two 1K Ohm resistors. (option #2) how about using an op-amp?
Anybody has a better solution?
Here is what I am trying to do: I have a Allegro A3516 hall sensor has a range from 0V to 5V output. Which represent -800Gauss to +800Gauss. When it is at 2.5V, it is 0 Gauss.
Please help.