Skip to content

reardar – a tiny radar for bicyclists

The thing that most terrifies bicyclists in the city is the thing for which the roads that most of them ride were built: the car. Namely, getting hit by a one. We wanted to see if there were a simple way to help make cyclists more safe and help them develop the sixth sense for the approach of cars from behind that cyclists all develop with time and more than a little of dangerous trial and error. We tried to think of what could allow a cyclist to feel the approach of a car without heavy or expensive gear. We call it, cheekily, reardar. In this post we’ll explain how we’re making a radar unit small enough to fit in the back-pocket of cyclist and cheap enough to be worn while biking in the city.

This little 24Ghz radar unit can be found on Alibaba for about $3.

UT8EqTOXsRXXXagOFbXm

It sends out a 24ghz radar signal and measures the difference in the returned signal using the Doppler Effect. You’re probably familiar with the Doppler effect from any time that a ambulance has passed by you on the street: the change in frequency as the source of the sound changes is actually the sound of the wave being stretched or lengthened as the source of that wave speeds towards you or away from you. The same principle can be applied to a radio signal: send out a 24ghz signal and measure how much it has changed as it bounces back to you. Compressed by a lot? The object on which the signal reflected is moving toward you very quickly. Stretched by a lot? The object on which the signal reflected is moving away from you quickly. You’ll be intimately familiar with this if you’ve ever gotten a speeding ticket from a police officer who was using a speed-gun to measure your speed as you drove. The technique that this little radar unit uses is exactly the same but with a dramatically shortened range, about 20-25 meters. It outputs exactly the difference between the wave sent out and the wave received, which can be turned into the frequency with the help of the FreqMeasure library and a little math:


#include 

unsigned long freq;
float speed;

void setup() {
  Serial.begin(115200);
  FreqMeasure.begin();
  
}

void loop() 
{
  if (FreqMeasure.available())  // got any samples?
  {
    unsigned long count = FreqMeasure.read();
    Serial.print(count);
    Serial.print(" ");

    speed = float(count) * 0.00225;  // multiplying freq * 0.00225 will give speed in km/hr
    Serial.println(speed);
    
  }
}

The difference wave that this unit outputs is only about 20mW, not enough for an Arduino or Arduino-compatible board to detect the waveform, so we needed to amplify it enough that something with the speed to process that waveform could detect it. For future iterations of this little thing we’d love to do some fairly complex signal processing so we’re going to be working with a Teensy 3.2 to get all that 32bit ARM goodness.

We used the venerable LM258 opamp to ramp up our signal without distorting the waveform, since the frequency of the wave is very important to figuring out what is coming at the radar unit (and by extension our cyclist):

Screen Shot 2016-05-26 at 17.44.05

Here’s the radar unit plugged into our trusty oscilloscope. My colleague Michael is waving a large cookie tin at the radar to get some differencing waves coming off of it.

tiny $3 radar fun

A video posted by Joshua Noble (@fctry2) on

In our next post we’ll look at the form factor and existing utility/affordance that we’re leveraging (hint, it’s something you’ve probably seen before)