How to Build Car Speed Detector Using Arduino

For this time, we are going to build a car speed detector circuit using Arduino and IR sensors. You can check the speed of a moving car. We know many rules we have to follow while driving a car. The most common rule is to maintain speed on certain roads. If we violate these rules, we get fined or punished in other ways.

There are many cars and other vehicles in the traffic. A human can’t detect the speed of all vehicles. So traffic officers depend on a handheld gun. This gun works on radar technology. This can manually check speed but for many vehicles, it may fail.

From there the thought arises, how to make this automatic. So we build this automatic speed detection by Arduino. Now you just need to place this project in a fixed place. This system automatically take values and send data without any human intervention. Before going to build this project, first, check out how we can make a DIY Infrared Sensor.

Principle of Car Speed Detector using Arduino

The main parts of this project are Arduino and IR sensors. These sensors can detect the speed of a vehicle. In this project, we use two reflective type IR sensors. These two sensors are placed 10 cm apart.

When a car passes the first sensor, this project starts working. It measures time until the car passes the second one. By this process, it takes data of the movement of the car.

By this value, you can simulate between two sensors to be 5 meters. You can calculate the speed at which the vehicle travelled between those sensors.

All the data and calculations can be done by Arduino and the value is shown in the LCD module.

Project

Car speed detector
Car Speed Detector

Circuit Diagram

Car Speed Detector Circuit Diagram
Car Speed Detector Circuit Diagram

Components Required

  • Arduino
  • IR Module (x2)
  • 16×2 LCD Display Module
  • 10KΩ Variable Resistor
  • 1KΩ Resistor
  • 5V Power Supply

Components Required For DIY IR Sensor/PCB

  • IR Transmitter (x2)
  • IR Receiver (x2)
  • LM358 IC (x2)
  • 10KΩ Variable Resistor (x2)
  • 1KΩ Resistor (x4)
  • Hi-Link 5V

Circuit Design of Car Speed Detector

The circuit design is very simple for this project. The first IR sensor’s digital out is connected to pin 11 and the second IR sensor is connected to pin 12 of the Arduino. The voltage is provided for both sensors.

To see the speed detected by sensors, we used a 16×2 LCD. Its data pins D4, D5, D6, D7 are connected to digital I/O pins of the Arduino D5, D4, D3, D2 respectively. The RS and E pins of the LCD are connected to pin D7 and D6 of the Arduino.

PCB Design

For removing messy wiring and give a clean look, I designed a PCB prototype for this project. It is also helpful for troubleshooting that runs great without any errors. To design this PCB board, I used EasyEDA as it is too easy to use. For ordering PCB for this, I prefer PCBWay.

Gerber file for Car Speed Detector Visual Board Gerber.

Gerber file for Car Speed Detector Infrared Sensor Gerber.

You can view the Gerber file from here Gerber File Viewer.

PCB View

Car Speed Detector Main Board
Visual Board
Car Speed Detector IR Sensor
Infrared Sensor

Order PCB From PCBWay

PCBs are the neatest and professional-looking among the assembled circuit types. Any electronics circuit that needs to be professional looking uses PCB boards. But soldering is still required on the copper area on the PCB. In the early 1900s, the only way to make circuits for electrical or electronic components was by wiring them point to point on a chassis. These chassis were either pan or a sheet. These methods made circuits very fragile and large or bulky, and expensive.

There are so many forums or communities for electronics online in today’s technical world, and one of the famous ones for PCB manufacturing is the PCBWay. PCBWay is a place that brings manufacturers and customers together. They have more than a decade of experience in this field of fabrication and prototyping and assembling of PCBs. PCBWay have proved their focus to their customers’ needs in terms of cost-effectiveness, delivery, and quality. And this can be proved by their outstanding customer reviews. This PCBWay provided a platform for students and electronic hobbyists to display their projects to the community and give sponsorships if their work is attractive. Check out the large pool of sponsored projects here.

How PCB Manufacturing Process Done in PCBWay

Standard quality for any product needs to be maintained using some parameters. PCBWay gives that opportunity by quality control in designing and manufacturing. At first, they ensure accuracy, clarity, validity of the PCB files that we sent to them.

Then all the boards will go through the most stringent tests other than the basic visual check. They adopt most of the testing and inspecting equipment used in the industry, such as Flying Probe Tester, X-Ray Inspection Machine, Automated Optical Inspection (AOI) Machine. PCBWay are having 50+ new engineers on the daily basis around the world using PCBs for their work, who trust for their reliable quality. They produce high-quality pink, orange, grey, even transparent solder mask. Moreover, according to people needs, they can also provide Black core PCB. Check it out for a High-Quality PCB solder mask. There are some pictures below of the new colours of solder musks.

Features of PCBWay

PCB Prototyping & Manufacturing: PCBWay produces FR-4 and Aluminum boards and advanced PCBs like Rogers, HDI, Flexible and Rigid-Flex boards, at a very reasonable price. Just check this Instant Quote to order premium PCBs for your hobby projects.

PCB Assembly: It not only offers PCB Prototyping but also offers PCB Assembly service. You can order a full PCB board with attached components by uploading your file. SMT & THT assembly starts from only 30$ including free stencil and worldwide shipping. The components can be sourced and provided by PCBWay, or by clients themselves.

Open Source Community: It not only offers PCB Prototype & Assembly service but also gives opportunities to students for sponsorships. I think this is so great. They feature their projects on the website also.

3D Printing & CNC: It also produces Rapid Prototyping like 3D printing, CNC Machining, Sheet Metal Fabrication, and Injection Molding. The quality of the product is too premium and reliable. And also the best part is that you will receive your order within a minimum of 3 days.

Services: PCBWay offers great servicing of their products. It takes only 3 to 15 days according to courier service to deliver your products. Also, it has a live support facility. Whenever you have any problems, you can always reach a live customer service person to respond to your emails or messages. They have the “Return and Refund” principle, for every unusable board caused by PCBWay, they will rebuild and refund the order soon.

Guide for Ordering PCB From PCBWay

How to Operate Car Speed Detector?

  • At first complete the circuit as mentioned in the diagram and upload the code in Arduino.
  • Place IR sensors at the edges of the breadboard. So the distance between them is nearly 10 cm. Now power up the circuit.
    Then move your hand or any moveable thing in front of the sensors.
  • At last check the result on the LCD display.

Working of Car Speed Detector Using Arduino

The working of this project is not much difficult. The Arduino continuously get data from the sensors. When the car or any moveable thing passes the first IR sensor it gets alert. After it, Arduino captures a timestamp at this moment.

Then the second IR sensor’s working is started. It sends data to Arduino when the car passes it. Here we used the Millis() function of Arduino to capture the timestamps.

Now Arduino calculates the velocity by assuming the distance is 5 meters. Then send the value to an LCD. The LCD shows the result in kilometres per hour.

Applications of Car Speed Detector

  • It automatically captures speed without any human.
  • With this project you count how many number of cars passes on this day.
  • Also it can be used as a traffic logger or traffic counter.

Arduino Code Without I2C Module

Arduino Code With I2C Module

Leave a Comment