I'm contemplating whether its possible to measure the distance to the next car behind me in some easy way.

What I want to do is simple, if the car behind my car is closer than 10m, turn on a rather annoying (but not blinding) light pointing at them.

So, what is the best way to measure the distance to an object through a window. The accuracy needs to be in the region of ~10m +/- 1 meter.


migrated from arduino.stackexchange.com Dec 29 '16 at 5:01

This question came from our site for developers of open-source hardware and software that is compatible with Arduino.

  • \$\begingroup\$ I do it optically with a mechanical feedback actuator for the light. I.e., I look in my read view mirror and turn on my fog lights. 10m is a bit of a long distance for this kind of thing. 1m maybe it could be of some use, but 10m?! And what isn't blinding to you could be blinding to the old lady driving the 1975 maxi behind you... \$\endgroup\$ – Majenko Dec 28 '16 at 10:45
  • 1
    \$\begingroup\$ Also, I don't know where you live, but in the UK there are strict laws governing what lights can be shown on a vehicle. \$\endgroup\$ – Majenko Dec 28 '16 at 11:21
  • \$\begingroup\$ @Majenko Well it does not have to be lights, could be a LED sign with a well chosen word. \$\endgroup\$ – JensB Dec 28 '16 at 13:15
  • 1
    \$\begingroup\$ Last time I checked LEDs were a form of light... sign shaped or not. \$\endgroup\$ – Majenko Dec 28 '16 at 13:18
  • 1
    \$\begingroup\$ ... or offend the person behind you to such an extent that the ram you off the road. ;) \$\endgroup\$ – Majenko Dec 28 '16 at 13:31

Through solid object such as a window consider using Micropower Impulse Radar developed at Lawrence Livermore National Laboratory and used in stud-finders, for security and in vehicles.

  • \$\begingroup\$ Do you have any links where one might acquire such a thing, could not find much for sale anywhere with those keywords. \$\endgroup\$ – JensB Dec 28 '16 at 13:16
  • \$\begingroup\$ Actually there are a number of ways to do this. MIR is probably the better as I think it is used for auto back up sensors. But you could use LIDAR or even Computer Vision (OpenCV). However, with OpenCV you will likely have to abandon low power platforms in favor of full operating systems like the Raspberry Pi. \$\endgroup\$ – st2000 Dec 28 '16 at 13:18
  • \$\begingroup\$ No. I'm not sure why. I thought LLL had listed licensees at one point. Regardless, I'm not convinced this is an economical solution (most people who buy Arduinos don't want to spends 5 to 10 times that on a sensor) as it sounds as complex as LIDAR to manage (time of flight stuff). \$\endgroup\$ – st2000 Dec 28 '16 at 13:22

The system should use the British "Only a fool breaks the 2-second rule" algorithm. That is, the safe distance between vehicles is 2 s. That means you need a velocity input into your system so that you can calculate the separation by \$ \Delta t = \frac {s}{v} \$ where \$ \Delta t \$ is the gap between the cars (s), \$ s \$ is the distance (m) and \$ v \$ is the velocity (m/s). The vehicle speed may be available from the CANBUS or from a GPS interface.

For sensing you have the choice of radar devices or possibly ultrasonic. Ultrasonic would have to be mounted externally (it won't work through glass) and so would have to be waterproof.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.