It’s important to keep up the pace restrict on the roads for secure driving, however more often than not, folks ignore it and drive at very excessive speeds even in speed-restricted areas and highway crossings.
To keep away from this, the federal government deploys visitors assistants and officers with doppler radars that may report the pace of autos. This tools permits them to cost fines and take motion towards individuals who violate the regulation.
However deploying the officers with such tools is sort of difficult. It is usually a really tiring job for the officers, as pace studying of all of the autos for twenty-four hours isn’t doable.
So we determined to construct a car pace detector system with Raspberry Pi.
Right here we designed a sensible digicam with a radar that’s automated and can assist in sustaining the pace restrict and compel folks to comply with the visitors pace guidelines. We’ll combine the digicam with the doppler radar. The radar will repeatedly take the pace studying.
If it detects very excessive pace, then the digicam captures an image and a video of that occasion of time with the label of the time stamp. This may enable the federal government to routinely cost a advantageous and take motion based mostly on the info obtained by the digicam concerning the car.
Invoice of Supplies
Programming Automobile Velocity Detector
First write a code for the system to learn the radar sensor knowledge and convert the info to hurry, after which use the digicam to seize the image and video when excessive pace is detected.
We have to set up the newest model of the Python 3 IDE after which set up the OpenCV library to course of the video and frames from the digicam.
Now seize the video and photos of the high-speed car. To put in these modules, open the terminal after which run the next command-
sudo pip3Â set up opencv
Now write the code.
Within the first a part of the code, we import the libraries for utilizing the GPIO of the Raspberry Pi to take the doppler radar sensor knowledge.
Then we import the OpenCV library to seize the video and save the video frames after which course of them with high-speed detection by doppler radar.
Now we import the time library for calculating the time and pace of the car based mostly on the doppler radar sign.
Subsequent, we’ll devise the GPIO pin quantity for the doppler radar sign enter. Right here you should utilize any free GPIO. I’ve used pin quantity 27.
Additional, we have to set the GPIO as enter and likewise set the GPIO pin quantity as board pin quantity, as we’re utilizing the pin numbering as board pin numbering.Â
Now we’ll verify the sign of the doppler radar and extract the frequency that adjustments with proportional to the doppler radar wave.
After that, we convert the frequency to the pace. Right here, in line with the doppler radar datasheet, the wave pace is 31.36, so we divide the frequency of the radar with 31.36 and we get hold of the pace of a shifting car.Â
Now we create a whereas loop the place we repeatedly verify the pace of the car. Right here you possibly can set any desired pace that you simply need to restrict, and if the car pace is bigger than the set pace restrict, we’ll seize the video and put it aside to a file the place the code is saved.
Subsequent, we’ll show the reside video from a digicam after which we’ll overlay the pace of the car on the video utilizing OpenCV on every body. We are able to see the reside video output from the digicam with the detected pace knowledge on the video.Â
Circuit Diagram
Now we join the parts in line with the next circuit diagram.
After finishing connections, we repair the digicam of the Raspberry Pi in any custom-designed case after which the radar over the case. Right here I’ve designed the case for our system with a small gap behind the case for the digicam.Â
Testing:
Now energy the Raspberry Pi and run the code. Transfer your hand very quick so the pace is detected and likewise proven on the digicam output video. Now hold the radar close to the highway. Each time it detects the pace exceeding the pace, set within the code, it would routinely seize the video and photos of the high-speed car.
When you’ve got questions/doubts or face any points whereas making an attempt your arms on this venture, please be at liberty to ask within the feedback beneath. You can too use our Discussion board to debate with the group of engineers and consultants.