Analog level converter?

Hi all

once again I come forward with a stupid question...

I'm facing my first Due and want to connect an analog source (a linear Hall sensor) which is presently powered by 5v and puts out a voltage range from about 0 to 5v. I understand that I have to convert this to a range from 0 to 3.3v so I don't fry the Due.

I've discovered logic level converters and bought a few to add to my box of tricks. But I'm not seeing any "analog level converters" out there. Is this because I can just add a pull-down resistor somewhere on the +5 line going back to the Arduino, to reduce the voltage range from the sensor?

The device you need is a voltage divider, or possibly an opamp circuit (which can shift levels, amplify or attenuate, all at the same time).

Are you sure you can't power the 'analogue hall sensor' from 3.3volt.
Then you won't need a voltage divider.

Don't know if you can use a voltage divider with your unspecified hall sensor.
Post a link.

Most 'level shifters' are digital, and won't work for analogue signals.
Leo..

AHA! The word "divider" is the magic bullet. Thank you! Armed with that search term, I quite quickly found this advice:

The simplest possible step-down circuit is a resistive divider. Drive your 5V output into a chain of resistors, from which you tap your 3.3V logic input. A chain consisting of a 2.2k and a 3.3k resistor should produce a 3V output from an applied 5V input. It does not preserve the fan-out characteristic of the 3.3V output and you need to be aware of any capacitances that may also reside in whatever logic is connected to it and the effect they may have along with the resistors on fast rise times, but it should suffice for most simple level downshifting tasks facing a hobbyist. There are variations on this circuit that use diodes instead of a resistor to achieve the required voltage drop.

I have lots of resistors :slight_smile: I am not sure what a fan-out characteristic is but I think for a crude analog sensor like my Hall effect linear device, this should work. "Fast rise time" is hardly an issue here.

I hadn't considered powering the Hall sensor off 3.3v... I'll take a look at that too. It is a cheapie no-brand module that came with one of those "Arduino Beginner's Lab" sets of 50 sensors.

You can use the suggested 2.2k and 3.3k, however I would suggest doubling them 22k and 33k. One of the goals is to use standard values.

It would be helpful if you had a 0.1 or 0.01 µF capacitor to put across the 33k (or 3.3k) both the cap and 33k resistor should be very near the input to the board. This is to suppress any noise picked up on the wires from the sensor.

Fanout is a old logic term having to do with the allowable output current. You don't care here unless you are connecting the sensor to more circuitry.

Regarding the Resistors, what is important is the ratio of the resistors, not necessary the absolute values.

The equation to calculate the resistors is:

We'll call

2.2k = R1
3.3k = R2
5V = Vin
3v = Vout

Vout = Vin * R2 / (R1+R2)

Vout = 5 * 33/(22+33) = 3V (the reason I dropped the K designation is because the ratio is all that matters)

There are other ways to calculate the resistors but this is the "traditional" method, but not the fastest.

I should also mention that "logic level" converters only have full ON and full OFF. It will not maintain the variable signal you are looking for.

Incidentally if the ADC has an input resistance that's not extremely large, you need to factor that
into the divider circuit design - a simple divider only works accurately when not loaded down.

Speed of a divider is related to its output impedance compared to stray capacitances. You can add
a capacitive divider in parallel with a resistor divider for high speed use - for instance this is how
oscilloscope probes work, they are 9M:1M dividers in parallel with 1:9 ratio capacitive divider.