Skip to content

Latest commit

 

History

History
45 lines (40 loc) · 2.68 KB

README.md

File metadata and controls

45 lines (40 loc) · 2.68 KB

Ultrasound Sensor Array for Automatic Car Distance Control (AC⚡️DC)

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.

Introduction

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

System

Hardware

Wiring

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.
drawing drawing drawing

CAN Frame

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	
-----------------------------