Photo Speed Radar-Overview
For a long time I wanted to do this project and finally did it in 2018. Speeders on my street have been a problem and I wanted to start recording who they are and what their speeds are. The goal was to record an image of each passing vehicle with enough resolution to read the license plate and to measure its speed with +/- 1 MPH accuracy. The saved image would be stamped with the speed value and additionally its file name would be date and time stamped along with the speed. I successfully put together such a system and it has been working well now for over a year. It consists of a Raspberry Pi 3, Model B with a pi camera equipped with a telephoto lens and a Bushnell Sports Radar adapted to be the input sensor for the RPi 3. Here are some details:
- Bushnell Sports Radar (K band, ~100 USD)
- Raspberry Pi 3, Model B with case (~35 USD and ~7 USD)
- Pi Camera plus telephoto lens (~30 USD and ~22 USD)
- Ubuntu-Mate (16.04) (free)
- OpenCV library (free)
- PIGIO library (free)
- Executable written in C++ (my time and energy)
- A bit of simple circuitry (my time and energy)
How It Works
The Pi begins grabbing images from the videostream when a vehicle passes into the radar beam. This is sensed on a GPIO port connected to the thresholded audio output (a square wave) of the Bushnell radar’s Gunn diode. Grabbing of images continues so long as there is radar beam signal present. Only one of these images is kept for saving, the one more or less within the field of view. The doppler frequency is measured continuously and from the sequence of measurements the maximum speed measured is recorded. The image is then saved to a PNG file with the date, time, and speed embedded in the file name. The speed is also added as text to the image.
System Overview
This is best described by some images. Here we have the radar solidly mounted to a lab stand with clamp and the RPi 3 with telephoto lens sturdily mounted. Power supplies power the RPi 3 and radar separately.
This next image shows much more detail. The radar is powered not by the normal two C cell batteries but by its own 5 volt charger. A 5 volt to 3.3 volt converter steps down the voltage for the radar. After the radar is turned on normally with its switch, the Gunn diode is turned on and kept on with a jumper. The Doppler audio output is delivered to the RPi 3 breakout board via the comparator. The optional relay board is not used.
Operation and Results
This image shows a typical set up where in practice the radar beam is normally incident on passing vehicles at an angle. This angle needs to be known within a +/- a few degrees and is used to apply the cosine law to speed measured. Note that the K band radar has a narrow main lobe, which works well in defining the practical width of the radar beam.
This image shows the result. Note the speed embedded on the image. Shown also is the license plate and its readability. To achieve this, besides the use of a telephoto with 1920×1080 video streaming, the image must be saved as a lossless PNG file and the camera needs to be preset to a fixed and fast shutter speed.
To Be Continued
This is part one of four parts. Part two will describe the hardware in more detail, particularly the hack of the Bushnell radar and its operation. Part three will delve into some important aspects of the C++ executable, and part four will finish with description of set up, operation, and analysis.