Help with Maxbotix HRXL-MaxSonar-WRMT

Not so much robotics per-se, but more home automation… I want to detect a vehicle/person entering my long driveway. I was using a PIR sensor, but it falsely triggered with wind blown trees, but sometimes failed to even detect a FedEx truck. I purchased the Maxbotics in the hope it would not exhibit the same behaviour.

Briefly, the Maxbotix is powered with 5V. The analog output is connected to an XBee module (3.3V) that samples every 50mS ( 10 bit resolution ) and sends a report to a second XBee located at the house. Of course I have all the proper 3v/5v logic conversion circuitry, and the 5V analog output from the sensor is passed through a voltage divider before the XBee. At the house, the serial asynchronous XBee output is read by a microcomputer ( xMega128 ) that decodes the message and extracts the analog voltage seen from the remote Maxbotix sensor.

Aiming the sensor to the sky yields a reading of approximately 1000. When I point it across the empty driveway, I get the same reading. I programmed the xMega to print a report when the value is less than a preset trigger. I started with a trigger of 800, assuming that any reading below 1000 is a probable ‘hit’, but experienced periodic bursts of 10 or 20 rapid readings in the low 200’s range when there was nothing on the driveway. I set the trigger to 200, and still see periodic bursts in the 180 range. With the trigger set at such a low value, I can walk up and down the driveway and not be detected. So far, it appears that I’m not much better off than I was with the PIR; with both false detections and missed detections.

What can cause an ultrasonic sensor to detect an echo when there is nothing there? I have the sensor about 1 foot off the ground and it is level. I don’t want to raise it much higher, as it would then become too conspicuous. When these ghost detections occur, I don’t see any critter activity in the area. I can’t think of any software filtering that could distinguish between a burst of many false detections and a real detection.

Any suggestions or hints of what I can try would be helpful at this point, thanks.

1 Like

Hey @ronter, welcome to the RobotShop community!

I personally feel that home automation is well at home on a robotic forum… :wink:

That sounds like a pretty cool setup. If you ever feel like it, I’d recommend posting about it here.

I assume the Maxbotix HRXL-MaxSonar-WRMT would be the RB-Max-38?
As you can read in its datasheet on the first page, the sensor has a minimum range restriction:

As you can see on page 11 of the datasheet the beam sent out from the sensor is somewhere between one and two feet wide. Therefore, you probably are getting unreliable measurements due to the sensor getting ghost readings from the ground being too close to the sensor.
You can probably improve the readings to a stable state by simply moving the sensor a bit higher.
I’d say try 2 feet and see what kind of results you get at that height.

As a side note, you can simply power the sensor @ 3.3 V DC and its analog value will vary between GND and VCC, as mentioned here (analog voltage output, “pin 2”; “V+”, “pin 6”).

Let me know if that helps a bit. If it does not and you still get random bursts of values then you may have something else causing issues with your sensor in your setup. In that case, detailed pictures of your setup would be helpful to help identify any other potential issues.

Sincerely,

Thanks for your response. Although my application is not strictly robotics, I’m sure there are applications of this device used for robotics.

Sure, if I ever get it to work reliably.

Yes, the RobotShop code is RB-Max-38. I would have thought that since the sensor is level with the driveway, and the driveway is a smooth surface ( asphalt ) the sound would not echo back to the sensor. Also. the behviour is that the sensor may be quiet for hours, then suddenly a burst of readings over the period of a few seconds; I would think that ground echo would be less intermittent. I’m also absolutely positive that there’s nothing there when this occurs. The range of this sensor is 5m. That’s about the width of my driveway at the point where the sensor is placed. I wasn’t very concerned with the spec sheet warning about close distances, but maybe the ground ( 30cm ) is the issue?

I will try the higher position, it’s worth the effort.

In an effort to eliminate the possibility of electrical noise, or some A/D conversion issue around the xBee, I switch to using the async serial output of the Maxbotics and changed my software to read the ASCII value “Rxxxx” as a representation of cm. Mostly I see R5000 which means no detection within the 5m range. Then the bursts still occur at seemingly random times showing anywhere between R06xx and R11xx. (~60cm to 1.1m)

I will bring the sensor inside to a controlled environment, and continue monitoring for these random bursts while changing the off-floor height of the sensor.

Thank you once again for your helpful response.

1 Like

I have a strong feeling the height might help. That being said, I have not had such an issue with Rb-Max products before, so I’m a bit unsure. If we can’t figure it out quickly I’ll get in contact with their support on your behalf to see what thy have to say about it.

Serial is certainly a good idea. As mentioned before, you may want to simply power it at 3.3 V Dc and eliminate more components (voltage shifting)! :slight_smile:

Sounds like a good plan. Very interested in seeing what you get from this.

Happy to help! :slight_smile:

Good luck with the tests!

Just to end the story…

I contacted Maxbotic support. They were very helpful; pointed me to app notes and other articles. Kudos to them for being so responsive! I brought the setup inside to conduct power supply noise testing and to try the sensor in a controlled setting. I was concerned that the XBee might be generating RF interference, but couldn’t see any indication of this on a scope. I changed to a battery power source just to be sure there wasn’t power supply electrical noise, even though I saw no indication on the scope of this either. The sensor worked flawlessly for many hours at several heights off a concrete floor from 30cm right down to 11cm.

Testing outside again, in no time at all, I stared to see many reports of all exactly 30.0cm when there was noting within 5m. This occurred mostly during a rain, but did a few times as well when not raining. There were also frequent phantom detections in the ~1m range. I noticed there were very gusty winds during the time of the outdoor testing. I’m still not sure in what way wind affects ultrasonic detectors.

I sent my test report to Maxbotics; they suggested raising the sensor to 60cm, or to use a narrower beam sensor model. Raising the height is a concern for both aesthetic and conspicuousness reasons. I don’t understand why it would work at 11cm above concrete indoors, but need 60cm above asphalt outdoors.

Every technology is going to have its pros and cons for any given application and environment ( like snow & ice accumulation on the driveway ). For me, passive infrared was a failure, now ultrasonic is not looking too promising. The final technology I have yet to test is IR beam break. Once I’ve done that, I might come back to ultrasonic, and try the longer, narrower beam model at 60cm high. Perhaps I can set it back away from the driveway edge were it doesn’t stick out like a sore thumb.

Hey!

Yes, they are most certainly very helpful!

Quite curious that it worked well indoors but not outdoors with the same setup (assumed from your post).

If IR based system is interesting to you, you may want to look at our LIDAR selection. We have quite a few that may be interesting to you such as:
TeraRanger Evo 64px ToF Rangefinder
RPLIDAR S1 360° Laser Scanner (40 m)
We do have some other options for solid state but they cannot be imported to the USA yet (waiting on FDA certification documentation).

Alternatively, you may want to simply use a completely different technology: camera! Some typical options include the Pixy 2 and some stereo cameras (ex: RB-Myn-01, RB-Myn-02) or even cheap webcam-like USB cameras connected to a PC or RPi.

I hope this helps and good luck with your project! Hopefully you’ll find a solution that really does work well for your use case.

Sincerely,