Sonar Range Finder

Hello! Just got my Fez Domino during the weekend. :slight_smile:

I need some advice…
What is the best interface on the LV-MaxSonar-EZ1 to use with my Fez? They provide 3 kind; Serial, Analog Voltage & Pulse Width.
[url]http://maxbotix.com/uploads/LV-MaxSonar-EZ1-Datasheet.pdf[/url]

The Analog Voltage output seems like the most intuitive option. But is the AnalogIn class capable of interfacing with this output?

Why not? All AnalogIn does is measure a voltage, which is exactly what the Analog output of the sensor is providing. Just keep in mind to power the sensor with max 3.3 Volt.

Thanks for the reply EriSan500. Sorry, if my questions are silly. I’m a n00b; just got my first microcontroller (Fez Domino) during the weekend. :-[

I’ve actually tried using the AnalogIn class, but did not get the expected results from the unit. I used AnalogIn.Read() method and the value doesn’t seem to change much when I moved a closer object in its path. I’ve hooked mine up with a 5V input before. I guess I’ll try to hook it up using 3.3V instead.

[quote]Outputs analog voltage with a scaling factor of (Vcc/512) per
inch. A supply of 5V yields ~9.8mV/in. and 3.3V yields
~6.4mV/in. The output is buffered and corresponds to the most
recent range data.[/quote]

I think the GHI NETMF Library doc needs more details & examples on some of its classes. I wasn’t sure if “current analog value” was voltage or some other measure. What is the unit of measure for the “current analog value” returned by the Read() method? i.e. uV, mV, V?

Thanks again.

If you can’t find something in docs then just ask and we will happily help.

The analog inputs are 0 to 3.3V with 1024 step resolution (10-bit) and then you can set your scaling anyway you like. If you do not scale then 1023 = 3.3V

The easy way is to scale from zero to 3300. Then what you read will be in millivolts.

AnalogIn aIn = new AnalogIn(...);
aIn.SetLinearScale(0, 3300);

Thanks guys. I think I get it now. ;D

Also, finally looked through the Contributions forum and found Hai’s post on Maxbotix sensor driver @ (link removed). I think the need to eliminate low/high extreme values and averaging the data he mentioned could explain the seemingly random raw values I’ve been reading.

For those looking for drivers, you may consider MarkH’s Ascended.Sensors drivers @ (link removed)