Iām getting my bot ready for our RSSCās contest, the Can-Do Challenge on Feb 14 (https://www.rssc.org/can-do-challenge.html), and need some advice on use of the Ultrasonic sensor use.
Ā
Iāve attached two pictures of my bot. Iāve used this sensor before successfully for at least 2ft in contests a long time ago where I mounted it horizontally. However, in this design I thought vertical would be better to detect a can. I tried horizontal first, but it didnāt work any better.
Ā
https://www.youtube.com/watch?v=dNbv3ONI3cU&list=PLmb0WjGtyZZS9qjUYhY4bdeh4ZQYx7BYS
Each tile has 12in (30cm) sides
Ā
I can reliably get good distance measurements when a can is within 1-2 feet (30-61cm), but I need a 3 feet (91cm) range for the contest.
The sonar seems to be very sensitive to its pitch and if pitched a small angle too low it strangely sticks to reading 23cm, some point on the floor. If it is slightly too high then it misses the can entirely. The further away the target is the smaller the sweet spot angle.
Ā
But keeping it exactly level on a moving platform is challenging. Iāve tried adjusting its pitch very slightly but it has not resulted in an improvement. My earlier bot design was a little more stable and maybe kept the sensor more level?
Ā
I do have a second ultrasonic sensor and am wondering if I should mount it as well. Both units behave the same when mounted in the position shown.
Ā
Thanks,
Jim
Ā
To view this discussion visit https://groups.google.com/d/msgid/rssc-list/1410067103.1200675.1768885196171%40mail.yahoo.com.
Thanks for the advice. After some tests I decided on a rear of robot, centered, and horizontal orientation for the U.S. sensor because I can reliably rotate close to 180 degrees with my odometry based localization and even have an IMU mounted if necessary to use. Even with this the range that the can is visible seems to be maxing out significantly less than 90cm. Iāll try different floors like cement vs. my shiny marble tiles and try the foam tape trick on the lower half of the transmitter.
Ā
Jim
To view this discussion visit https://groups.google.com/d/msgid/rssc-list/CAMEE1iSsWVHXpxQ6PN76Z1rN1Hn%3DoMPvyLiM2Aa%3D7%2BwL%2BiBong%40mail.gmail.com.
Thanks for the pointers to all.
Ā
Hereās a milestone in my progress:
https://youtube.com/shorts/2u_xTZ9i4l8?feature=share
Ā
Now Iāll try to extend the range capability and improve the success rate!
Ā
Re the comments, I do like to take many measurements while the robot is moving or scanning completely past the detected, in range target in this case to find the minimal distance and optimal angle to the target. Because this is for a constrained contest and arena (https://www.rssc.org/can-do-challenge.html), then I donāt need to engineer it beyond those requirements.
Ā
Personally, if I were building a modern robot for this contest, I would not use an Ultrasonic sensor, but instead a ToF infrared sensor module like the VL53L7CX which is available in ready to use boards in the market for a range of prices. I have bought DFRobotās RP2040 uC based board (https://www.dfrobot.com/product-2999.html) available for under $22
Ā
For my YOLO object detection implementation on Big Orange Iāve been using basically the same algorithm Chris describes below for several years, calling it computePersistance(). It works quite well.
Ā
Jim
Ā
Ā
From: Chris Albertson <alberts...@gmail.com>
Sent: Friday, January 23, 2026 10:34 AM
To: John Davis <jfd...@sbcglobal.net>
Cc: Bob Huss <boba...@gmail.com>; Jim DiNunzio <jimdi...@gmail.com>; RSSC-List <rssc...@googlegroups.com>; hbrob...@googlegroups.com
Subject: Re: [RSSC-List] Need advice on Lego NXT Ultrasonic sensor use.
Ā
I tried to solve thisĀ and some other problems with ultrasound by taking advantage of the fact that the robot is moving.
No, return is not required. The essential capability was already in my old code, and I thought it would be cool to keep doing it. š
Ā
BTW, I changed the mount of the sonar to add a tilt axis (itās fun figuring that out in LEGO partsā¦) and adjusted it to maximize the distance it will detect the can from. For 2/3 cans I am using it maxes out at 75cm beyond which tilting up or down yields only unknown measurement. But with one red coke can in one area of the same marble tile floor, it is able to see it the full 91cm I need. So go figure with ultrasonic. I ordered a marked up ToF IR for LEGO NXT so Iāll have another I would hope is a more reliable option.
Ā
Jim
--
You received this message because you are subscribed to the Google Groups "RSSC-List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rssc-list+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/rssc-list/4b9ea123-a9a4-4a6a-8764-e7d3a9a7b4cdn%40googlegroups.com.