Reading a 5v distance sensor using a 3.3v Arduino Pro Mini

I have a GP2D120X analog distance sensor ( www.technologicalarts.com/myfiles/data/gp2d120.pdf ) that requires 5v. I have to connect this to a 3.3v Arduino Pro Mini. I thought that powering the sensor independently and then passing the output from the sensor through a voltage divider to bring the voltage down would be enough but the guy at my local electronics shop insisted that the only way of doing this was by changing the Arduino for a 5v one (which I prefer not to do due to cost and design reasons). I'm not very proficient in electronics so I was wondering if someone could advice on this.

Thanks!

my local electronics shop insisted that the only way of doing this was by changing the Arduino for a 5v one

Let me guess, they have one on the shelf :slight_smile:

passing the output from the sensor through a voltage divider

That should work, looks like it has an analog output so run that into one of the analog pins after the divider.


Rob

Thank you Rob. As a test I connected the sensor to a 5v supply (via a 9v battery and a voltage regulator) and then measured the sensor output with a multimeter (no connection to the arduino or voltage divider). To my surprise the maximum voltage I measured was of 2.9v (close distance limit). I wonder why is this happening when the specsheet says I should get Vcc as max? I checked the output from the regulator and it was spot on 5v.

Actually if you look at the data sheet it shows a peak Vo of just over 3v at 3cm. And the other graph shows a Vo of between 2v7 and just under 3v depending on the reflectance.

So what you are seeing is about right, and it looks like you don't need the divider.


Rob

Ah! Thank you again. I should have checked the graph!

Graynomad:
Actually if you look at the data sheet it shows a peak Vo of just over 3v at 3cm. And the other graph shows a Vo of between 2v7 and just under 3v depending on the reflectance.

So what you are seeing is about right, and it looks like you don't need the divider.


Rob

But add a current-limiting resistor to prevent damage - that datasheet doesn't appear to give the output impedance or drive current level.

[And go back to the shop and tell them they were wrong :wink: ]