SNAP - Ultrasound Distance Measurement - Details

Overview



Background

This page provides some more detailed background on the use of ultrasound devices to measure the distance to passing vehicles.



index

Other Studies

In the UK, Ian Walker formerly of Bath University, now of the University of Surrey, conducted a number of studies which received much publicity in the cycling press.

Some of his conclusions were ...

In Germany there is a very active Open Citizen Science Project called OpenBikeSensor. They publish open source plans and the software needed for a sensor system. They have also developed software to display the results on map backgrounds.


      OpenBikeSensor - handlebar switch and sensor/battery/gps unit



      OpenBikeSensor - handlebar swich and display



      OpenBikeSensor - map of output from multiple users - click for larger image


Both the above systems incorporate a push button switch mounted on the handlebars. When a significant pass occurs the cyclist presses the button. The unit registers the time of this 'push' alongside the distance readings.

This allows 'spurious close passes', such as leaning your bike against a wall, to be excluded.



index

Principles


Ultrasound distance sensors emit a short burst of sound. The diagram below shows one burst of sound as a curved red arc. With time this burst of sound travels (at the speed of sound!) away from the sensor. The diagram shows that after 10 time intervals the sound reaches an object where a small part of the sound is reflected back towards the sensor (shown as blue arcs). After a further 10 time intervals a very small part of the original sound wave arrives back at the sensor.

If D is the distance between the sensor and the object being detected, S is the speed of sound, and T is the time between transmitting the pulse and receiving its echo. Then

                    D = S * T / 2

The factor of 2 accounts for the fact that the sound has to travel the distance D twice (there and back).

For example if the time, T, between transmission and echo is 5.0 milliseconds, the speed of sound, S, is 343 metres/sec, then the distance D is 1.0 metre.






index

Ultrasound Sensor

      AJ-SR04M v3 sensor

The current work uses a AJ-SR04M sensor. This is about 20 mm in diameter. It uses an ultrasound frequency of 40 kHz which is about twice as high as humans can hear.


      Sensor mounted on a pannier rack just behind the seat tube.

The sensor is mounted centrally on a pannier rack. In this position it is about 25 cms in-board of the right outer side of the handlebars.



index

Ultrasound Display


The ultrasound sensor is connected to a small Arduino microprocessor. This also receives time and location data from a GPS. About ten distance measurements are made every second and written to a micro SD card, as well as being shown on a small display.

The above image shows one form of display output, which shows ...



index

Sensor Calibration

            Calibration Curve - click for larger image

The system was calibrated by positioning the sensor at a set of known distances from the side of a saloon car.

The graph above shows the sensor distance as read from the display vs. the distance measured with a ruler.

When the ruler measured 70 cms the ultrasound sensor measured 86 cms (i.e. 16 cms more). On the bike, the sensor is mounted centrally 25 cm inboard of the outer right side of the handlebars.

Thus for this particular combination of sensor and microprocessor the ultrasound readings need to have 25 + 16 = 41 cms subtracted from them to give the correct 'passing distance'.

In addition, allowance needs to be made for any projections from a vehicle (e.g. wing mirrors) which might reduce this distance further.



index

Sample Raw Measurements

A number of tests were undertaken to characterise the performance of the sensors. The measurements shown below were taken on Alphington Road in Exeter opposite the Riverside Leisure Centre. They were made from a stationary bike on the pavement.

This sequence shows eight vehicles passing the sensor. When there is no vehicle adjacent to the sensor it records a default value of 400 cms. When each vehicle passed the distance measured dropped to 150-250 cms. Typically as a single vehicle passes the sensor 6-10 independent measurements are made.

      Click image for larger version


      Click image for larger version




index

The Highway Code - Overtaking Cyclists

The Highway Code provides guidance on overtaking cyclists.

"163 Overtake only when it is safe and legal to do so. You should