5v analog signal into 3.3v Analog In?

06 Dec 2010

I have a simple question for you experts. I have a sensor that outputs a signal up to 5V, but the mbed spec only reads up to 3.3v on the analog ins.

Can I simply scale down the voltage using a resistor and diode, or do I need a more elaborate solution? If so, what would you recommend?

06 Dec 2010

No diode, but yes, scale with a two resistor voltage devider, minding the load placed on the source (resistory value selection)

06 Dec 2010 . Edited: 06 Dec 2010

How much current can your sensor supply?

If it's a couple of milliamps, I would setup a resistor divider.
1.7 kOhm and 3.3 kOhm (not exactly in the E12 row, but you get the generel idea).
whenever 5V is present on the top of the 1.7 kOhm, there will be 3.3V on the top of the 3.3 kOhm.

__________ Signal from sensor
_|_
|    |    1.7 kOhm
|__|
|_________ AnalogIn
_|_
|    |   3.3 kOhm
|__|
|__________ GND


Lerche

06 Dec 2010

Normally I place a potenciometer of 10K of 10 turn  and adjust the top level 3.3V

06 Dec 2010

Thanks for the responses guys. I will try some resistor combinations and see how it works out. Also, I found this document after some searching.

 

http://www.microchip.com/stellent/groups/techpub_sg/documents/devicedoc/en026368.pdf

06 Dec 2010

Don't forget to account for the mbed input impedance while calculating the divider values.

08 Dec 2010

I ended up using a 20K resistor in r1 and 39k in r2, seems to be a pretty good combo.