Pages: [1]   Go Down
Author Topic: Reading a 5v distance sensor using a 3.3v Arduino Pro Mini  (Read 1004 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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 smiley

Quote
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
« Last Edit: October 20, 2012, 01:07:21 am by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Shannon Member
****
Karma: 198
Posts: 11620
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-wink ]
Logged

[ I won't respond to messages, use the forum please ]

Pages: [1]   Go Up
Jump to: