PDA

View Full Version : Parallax and Maxbotix ultrasonic sensors


Lucretius
01-19-2008, 11:14 AM
Does anyone know if there are device drivers for the Parallax Ping))) and the Maxbotix EZx written for WPIlib? I've looked at the SONAR driver and Qbranch's Ping))) code, but it's based off the default IFI code, and I have no idea any of it works.

We're using a makefile with mcc18 under Wine.

BradAMiller
01-21-2008, 08:01 AM
I was just reading the spec sheet for the Maxbotix EZ1 sensor. It looks like one of it's outputs is analog. So you should be able to connect it directly to an analog input and read range values. The datasheet lists the output at about 9.8mV/inch, so with some simple scaling you could convert the 0-1023 analog input value directly to inches. It also looks like if you use the pulse output it may be directly compatible with the existing driver, but I haven't tested it.

The sensor looks really good - I'm going to order one to play with. More news as it happens.

The Parallax sensor uses timing much like the supported SRF04 (or Vex) sensor, the problem is it does the trigger (digital output) and echo (interrupt) on the same pin. The driver would have to be modified slightly to flip the pin from an output to an input to make it work.

Phalanx
01-21-2008, 09:41 AM
We used the Maxbotics EZ-1 last season using analog with good results.

The formula we used:
Mv =( (adc * 5000) / 1024 )
Inches = Mv / 10
Gave use the distance in inches for the version that used 10mV per inch.

It was changed from 10mV to 9.8mV
So in your case you might want to try:
Mv =( (adc * 5000) / 1024 )
Inches = Mv * 10 / 98

Lucretius
01-21-2008, 02:56 PM
Thanks for the tips regarding the Maxbotix EZ sensors (we'll be using the EZ0).

We actually got the Parallax Ping))) working with the built-in WPIlib functions. The only modification was to convert the two ends of a PWM Y-connector to female so we could plug them into two digital in/outs. Worked like a charm! :yikes:

pogenwurst
02-19-2008, 11:39 PM
We used the Maxbotics EZ-1 last season using analog with good results.

The formula we used:
Mv =( (adc * 5000) / 1024 )
Inches = Mv / 10
Gave use the distance in inches for the version that used 10mV per inch.

It was changed from 10mV to 9.8mV
So in your case you might want to try:
Mv =( (adc * 5000) / 1024 )
Inches = Mv * 10 / 98

I was just looking at the datasheet for the newer versions with 9.8 mV / in. scaling, and it does not specify "9.8" but rather "~9.8". The exact scaling factor for 5V power is (5000 / 512) mV / in.

It shouldn't make much of a difference, but that sort of thing bothers me.

d235j
02-20-2008, 01:34 PM
We just divide the analog output by 2 to get the reading in inches.