Ultrasound Sensor Array with the SRF05 Sensors, Arduino Nano and Seeed CAN-BUS Shield V2.0.
Estimate distance of solid objects using multiple low-cost ultrasound sensors.
Using the cheap SRF05 ultrasonic sensor and an Arduino Uno with a CAN Hat we can build a low cost sensor array for robotics or automotiv applications.
The Arduino code will poll all the sensors and send each sensors' measured distance in cm in byte frame format to the CAN BUS.
For measuring the distances we use a sonar technique to calculate the time of flight of the sound.
The SRF05 is very inaccurate for distance measurement but can be used as a cheap low level fail-safe system for proximity object detection.
The main benefits of using an array of sensors versus using one sensor and one servo to sweep is accuracy and no delay to measure positional distance of a huge area in front of the array.
Currently using an array of 3 sensors we can poll all of them several times per second without any interference.
The code was successfully tested to communicate with 15 ultrasonic sensors.
Source: Ultrasound Sensor Array with the HC-SR04
The SRF05 sensors operate in Mode 2 (Single pin for both Trigger and Echo).
The brigded sensor pins can be connected to a as "FREE labled pin of the CAN HAT.
The maximum distance that can be measured is 400cm.
Therfore we need 2 bytes in the CAN frames' payload for each sensor.
The can frame is structured as follows:
Byte 0 - 1: FRONT LEFT SENSOR
Byte 2 - 3: FRONT MIDDLE SENSOR
Byte 4 - 5: FRONT RIGHT SENSOR
The distance value in cm are displayed and sent in hex format.
Example:
Set data from ID: 0x200
0 A3 0 8 0 A4
-----------------------------
Set data from ID: 0x200
0 6 0 3 0 4
-----------------------------