During the initial search for ultrasonic sensors which could be used for obstacle detection, the primary minimum requirements were:
Operating temperature range of -30°C to 30°C. This temperature range was selected to allow operation under standard winter temperature and testing under standard summer temperature.
IP Rating: IP65. This is to ensure the sensor is able to handle all expected weather conditions the exterior of the snow groomer may experience.
Range: 2.5 meters. This is to ensure the snow groomer has time to make decisions on objects identified ahead of it.
Accuracy: 20 cm. Given objects should be detected at the maximum range of the sensor under a majority of conditions, accuracy is not as important as identifying the object exists and approximately how far away it is.
Precision: 10 cm. This could potentially be larger for the main purpose being obstacle detection, although any rate of change calculations which may be performed on the data magnify any accuracy issues.
After reviewing a range of sensors on sites such as Amazon, Digi Key, Ada-Fruit, DF Robot, and O'Reilly Auto Parts, a Bosch car parking sensor and a DF Robot SEN0311 were selected for testing. The Bosch sensor required reverse engineering due to lacking a technical datasheet while the DF Robot sensor provided a simple interface documented in its datasheet.
Throughout the process of implementing the SEN0311 into a test setup, it was discovered that its temperature range only went down to -20°C, despite this the test went forward as the data collected would be used by the labs to determine if the sensor could be used for other projects.
The SEN0311 sends 4 bytes of data from the sensor to the microcontroller over I2C:
Byte 1: Header
Byte 2: Most significant btye of distance in millimeters
Byte 3: Least significant btye of distance in millimeters
Byte 4: Checksum of bytes 1-3
To obtain the distance in millimeters, byte 2 can be bit shifted and added to byte 3 then stored in a 16 bit (2 byte) unsigned integer.
The test performed had the distance in meters displayed on a small OLED character display connected to the microcontroller while the sensor faced out into the room with markings for various test points in cartesian space. With this being the first ultrasonic sensor tested, there were learning opportunities which were used when developing the test procedure for the second sensor.
The picture below shows the testing area used for the SEN0311 with markups in blue for clarity and some of the tape marks emboldened through editing.
Using this setup, and the reflective surface being the back panel of a computer tower, the test was performed with one person recording data and one person holding the back panel. The data collected is shown in the picture below with all blue and red being post-test markups to improve clarity.
The first test of the Bosch ultrasonic was performed prior to the SEN0311 test and was for getting the sensor working and learning how to interpret the data. One of the learnings from the first test and the SEN0311 test was the test should be recorded for referencing at a later point.
The first test's resulting data with overlayed context and analysis information is shown on the right. The data was collected by observing the LIN bus signal on a PicoScope and screenshotting the data. Following the collection of this data it was compiled into a single image with edges compared by converting pixels to time with the scope divisions. The conversion calculations were performed in Excel and from there observed in the graph below.
Between the scope plots on the right and pulse width graph above, it was determined there would be a y-intercept component of the conversion calculation because of the minimum detection distance of the sensor which appeared to be around 16-18 cm. The next step in this analysis was to identify the scale factor (slope) to be used in the software which is shown below.
The data shows a scale factor just over 0.17 mm/us, which when considering the speed of sound at 343 m/s a connection can be drawn. For a round-trip the accounted speed would be halved, and when converted to mm/us we see the following:
One of the questions which remained after the first test was what the additional pulses were for, one hypothesis was the pulses were for different angles. This hypothesis seemed the most reasonable leading test 2 to be developed around testing different angles.
The test was set up with tape on the floor for different angles and the LIN bus being monitored on a PicoScope. After preliminary analysis it was identified the multiple pulses were independent reflections, and the final test that was recorded was based on that. The test and the resulting data is explained further and shown in the video below, more analysis may end up written here at a later time.
From the testing it was concluded that ultrasonic sensors were unfit for the planned obstacle detection setup the snow groomer would be using because the IR sensors that were being used are intolerant to vibration resulting in false positives which need to be verified by the object sensors. Because the ultrasonics struggle to detect humans they are unfit to be used for IR data verification.
If the IR sensors are replaced with a different model which does tolerate vibration or outputs analog data which can be processed instead of digital human or not human data, then ultrasonic sensors would make great sensors for this application due to their field of view and simplicity in processing.