View Single Post
  #5   Spotlight this post!  
Unread 21-01-2012, 20:40
Mr. Rogers's Avatar
Mr. Rogers Mr. Rogers is offline
That? That was in the CAD.
FRC #3539 (Byting Bulldogs)
Team Role: College Student
 
Join Date: Apr 2011
Rookie Year: 2011
Location: Romeo, MI
Posts: 67
Mr. Rogers will become famous soon enoughMr. Rogers will become famous soon enough
Re: A reasonably reliable distance sensor with 10m range?

Here's one, 1068 cm max range. http://www.maxbotix.com/products/MB1261.htm
We use analog voltage, the data sheet for this one says:

Pin 3 -
(AN) This pin outputs analog voltage with a scaling factor of
(Vcc/1024) per 2 cm. A supply of 5V yields ~4.9mV/2cm., and 3.3V
yields ~3.2mV/2cm.


So you just connect your +, ground, and signal wire of your pwm accordingly, and plug it into the analog breakout.

It says "about 4.9mV/2cm" So +/- 2cm, maybe a little less accurate than that though.

As far as code goes, it's just a proportion between your voltage and your distance, hence "4.9mV/2cm"
If java's your kind of thing, get.Voltage(); (from AnalogChannel class) it will return the voltage of the sensor, use the above proportion to convert that to a distance.
__________________
Grow the roses of success!
2011 Archimedes 2nd seed,
2011 Waterford Champion, 2011 Troy Simi-Finalist,
2011 Waterford Rookie all star, 2011 Troy Rookie all star
http://www.bytingbulldogs.com/

Last edited by Mr. Rogers : 21-01-2012 at 20:46.